Infineon Logo AIROC BTSDK v4.8 - Documentation
 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Embedded Flash Interface

Defines a driver for the Embedded Flash interface. More...

Macros

#define FLASH_SECTOR_SIZE   (0x200u)
 819 uses 512 byte sector, 256KB on chip flash.
 
#define FLASH_SIZE   0x40000
 
#define FLASH_BASE_ADDRESS   (0x500000u)
 
#define APPLICATION_SPECIFIC_FLASH_RESERVATION   0
 Number of sectors reserved from the end of the flash for the application specific purpose (for ex: to log the crash dump). More...
 

Functions

wiced_result_t wiced_hal_eflash_init (void)
 Initializes the embedded flash. More...
 
wiced_result_t wiced_hal_eflash_read (uint32_t offset, uint8_t *p_buffer, uint32_t length)
 Reads the data from eflash. More...
 
wiced_result_t wiced_hal_eflash_write (uint32_t offset, uint8_t *p_buffer, uint32_t length)
 Writes the data to eflash. More...
 
wiced_result_t wiced_hal_eflash_erase (uint32_t offset, uint32_t length)
 Erase the eflash. More...
 
wiced_result_t wiced_hal_eflash_erase_whole (void)
 Erase the whole eflash. More...
 
uint32_t wiced_hal_eflash_get_size (void)
 Gets the size of the eflash. More...
 

Detailed Description

Defines a driver for the Embedded Flash interface.

Macro Definition Documentation

#define APPLICATION_SPECIFIC_FLASH_RESERVATION   0

Number of sectors reserved from the end of the flash for the application specific purpose (for ex: to log the crash dump).

By default no reservation Note:- 16K of flash is used for internal firmware operation. (Remaining of the flash - reservation) can be divided equally and used for active and upgradable firmware. So, application should care the OTA firmware (application+patch) size while reserving using below.

Function Documentation

wiced_result_t wiced_hal_eflash_erase ( uint32_t  offset,
uint32_t  length 
)

Erase the eflash.

Erase is performed page-wise. eflash page size is 0x200 bytes. eflash page count is 0x200.

Parameters
offsetThe start offset of eflash page to be erased.
lengthThe length of data in byte's to be erased, erase performed page-wise.
Returns
  • WICED_SUCCESS
  • WICED_ERROR
wiced_result_t wiced_hal_eflash_erase_whole ( void  )

Erase the whole eflash.

Returns
  • WICED_SUCCESS
  • WICED_ERROR
uint32_t wiced_hal_eflash_get_size ( void  )

Gets the size of the eflash.

Returns
eflash size
wiced_result_t wiced_hal_eflash_init ( void  )

Initializes the embedded flash.

Returns
  • WICED_SUCCESS
  • WICED_ERROR
wiced_result_t wiced_hal_eflash_read ( uint32_t  offset,
uint8_t *  p_buffer,
uint32_t  length 
)

Reads the data from eflash.

Parameters
offsetThe start offset of eflash from which data to be read, offset should be word aligned
p_bufferThe pointer to the buffer to which data is to be read, buffer should be word aligned
lengthThe length of data in byte's to be read
Returns
  • WICED_SUCCESS
  • WICED_ERROR
wiced_result_t wiced_hal_eflash_write ( uint32_t  offset,
uint8_t *  p_buffer,
uint32_t  length 
)

Writes the data to eflash.

Interrupts will be locked for the duration of the write. And only writes to an already erased location is valid.

Parameters
offsetThe start offset of eflash to be written, offset should be word aligned
p_bufferThe pointer to the buffer from which data will be written, buffer should be byte, half-word, or word aligned.
lengthThe length of data in byte's to be written, length should be word aligned
Returns
  • WICED_SUCCESS
  • WICED_ERROR