NOR FLASH

Nor Flash Overview

NOR Flash (Non-Volatile Read-Only Memory) is a type of non-volatile memory technology commonly used for storing firmware, bootloaders, configuration data, and other essential software in embedded systems, microcontrollers, and consumer electronics. Unlike traditional ROM, NOR Flash memory allows for both reading and writing data. It provides fast read speeds, making it suitable for applications where fast data retrieval is crucial

Application Interface

The below table captures the functions that are to be called from the application layer.

API Functions

Function

Description

rs_norflash_read_id

To reads the ID of the NOR flash.

rs_norflash_read

To reads data from NOR flash memory.

rs_norflash_write

To writes data to NOR flash memory.

rs_norflash_erase_sector

To erases a sector of NOR flash memory.

Error Code

  • Every API’s for the Serial returns some success or failure values. Please refer below section,

NOR Flash Header Details

Documentation from the relevant header as follows:

NOR flash Specific APIs.

Defines macros and functions prototypes for providing NOR flash storage.

Author

Embien RAPIDSEA Team

Copyright

Embien Technologies India Pvt. Ltd.

Functions

rs_ret_val_t rs_norflash_read_id(rs_handle_t handle)

Reads the ID of the NOR flash.

This function reads the unique identifier (ID) of the connected NOR flash memory.

Parameters:

handle[in] - A handle to the NOR flash memory device.

Returns:

0 on success or error code on failure

rs_ret_val_t rs_norflash_read(rs_handle_t handle, uint32_t u32_address, uint8_t *ptr_read_data, uint32_t u32_read_len)

Reads data from NOR flash memory.

This function reads a specified length of data from NOR flash memory starting at the given address.

Parameters:
  • handle[in] - A handle to the NOR flash memory device.

  • u32_address[in] - The address in the NOR flash from which to start reading.

  • ptr_read_data[out] - Pointer to a buffer where the read data will be stored.

  • u32_read_len[out] - The length of data to read (in bytes).

Returns:

0 on success or error code on failure

rs_ret_val_t rs_norflash_write(rs_handle_t handle, uint32_t u32_address, uint8_t *ptr_write_data, uint32_t u32_write_len)

Writes data to NOR flash memory.

This function writes the specified data to the NOR flash memory starting at the given address.

Parameters:
  • handle[in] - A handle to the NOR flash memory device.

  • u32_address[in] - The address in the NOR flash where the data should be written.

  • ptr_write_data[in] - Pointer to a buffer containing the data to write.

  • u32_write_len[in] - The length of data to write (in bytes).

Returns:

0 on success or error code on failure

rs_ret_val_t rs_norflash_erase_sector(rs_handle_t handle, uint32_t u32_address)

Erases a sector of NOR flash memory.

This function erases the sector in NOR flash memory that contains the specified address.

Parameters:
  • handle[in] - A handle to the NOR flash memory device.

  • u32_address[in] - The address within the sector to erase. The address should be aligned to the start of the sector.

Returns:

0 on success or error code on failure