Infineon Logo AIROC BTSDK v4.4 - 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)
 719 uses 512 byte sector, 1 MB on chip flash.
 
#define FLASH_SIZE   0x100000
 
#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)
 Function wiced_hal_eflash_init. More...
 
wiced_result_t wiced_hal_eflash_read (uint32_t offset, uint8_t *p_buffer, uint32_t length)
 Function wiced_hal_eflash_read. More...
 
wiced_result_t wiced_hal_eflash_write (uint32_t offset, uint8_t *p_buffer, uint32_t length)
 Function wiced_hal_eflash_write. More...
 
wiced_result_t wiced_hal_eflash_erase (uint32_t offset, uint32_t length)
 Function wiced_hal_eflash_erase. More...
 
wiced_result_t wiced_hal_eflash_erase_whole (void)
 Function wiced_hal_eflash_erase_whole. More...
 
uint32_t wiced_hal_eflash_get_size (void)
 Function wiced_hal_eflash_get_size. 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 
)

Function wiced_hal_eflash_erase.

Erase the eflash. Erase is performed page-wise. eflash page size is 0x1000 bytes. eflash page count is 0x100.

Parameters
[in]offset:start offset of eflash page to be erased.
[in]length:length of data in byte's to be erased, erase performed page-wise.
Returns
: wiced_result_t
wiced_result_t wiced_hal_eflash_erase_whole ( void  )

Function wiced_hal_eflash_erase_whole.

Erase the whole eflash

Returns
: wiced_result_t
uint32_t wiced_hal_eflash_get_size ( void  )

Function wiced_hal_eflash_get_size.

Gets the sizeof the eflash

Returns
: eflash size
wiced_result_t wiced_hal_eflash_init ( void  )

Function wiced_hal_eflash_init.

Initializes the embedded flash

Returns
: wiced_result_t
wiced_result_t wiced_hal_eflash_read ( uint32_t  offset,
uint8_t *  p_buffer,
uint32_t  length 
)

Function wiced_hal_eflash_read.

Reads the data from eflash

Parameters
[in]offset:start offset of eflash from which data to be read, offset should be word aligned
[in]p_buffer:Pointer to the buffer to which data is to be read, buffer should be word aligned
[in]length:length of data in byte's to be read.
Returns
: wiced_result_t
wiced_result_t wiced_hal_eflash_write ( uint32_t  offset,
uint8_t *  p_buffer,
uint32_t  length 
)

Function wiced_hal_eflash_write.

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
[in]offset:start offset of eflash to be written, offset should be word aligned
[in]p_buffer:Pointer to the buffer from which data will be written, buffer should be byte, half-word, or word aligned.
[in]length:length of data in byte's to be written, length should be word aligned
Returns
: wiced_result_t