Flash Library Reference Function Documentation
Flash_Initialize
FlashStatus_t Flash_Initialize(unsigned int num, FlashClockFrequency_t freq)
Location: flash.h:85
Parameters
Direction | Name | Description |
---|---|---|
in |
num |
Flash instance to be initialized |
in |
freq |
Flash clock frequency in Hertz, only defined frequencies supported |
Return
See: FlashClockFrequency_t
See: FlashStatus_t
NOTE: System clock frequency should not be changed while the flash is being erased or programmed.
An accurate system clock frequency of 1 MHz or higher is required for proper flash operation. If using the RC oscillator, care must be taken as the trimmed frequency for this oscillator has a high temperature dependency.
Flash_WriteWord
FlashStatus_t Flash_WriteWord(uint32_t addr, uint32_t word, bool enb_endurance)
Location: flash.h:105
Parameters
Direction | Name | Description |
---|---|---|
in |
addr |
Address of the word to be written. |
in |
word |
Data to be written to flash. |
in |
enb_endurance |
Set to 0 for default flash endurance; |
Return
See: FlashStatus_t
NOTE: addr must be word aligned.
Contents of flash must be erased prior to performing a write.
Interrupts are not disabled; operation is undefined if the calling application modifies the values of flash registers before returning from this function call.
Flash_WriteBuffer
FlashStatus_t Flash_WriteBuffer(uint32_t addr, uint32_t word_length, const uint32_t * words, bool enb_endurance)
Location: flash.h:137
Parameters
Direction | Name | Description |
---|---|---|
in |
addr |
Address of first word location in flash. |
in |
word_length |
Total number of words to be written to flash. |
in |
words |
A 32-bit C pointer to the memory location of |
in |
enb_endurance |
Set to 0 for default flash endurance; |
Return
See: FlashStatus_t
NOTE: addr must be word aligned.
Contents of flash must be erased prior to performing a write.
Interrupts are disabled during critical sections, to ensure proper flash operation.
Applications must ensure that the function completes and that the return value is FLASH_ERR_NONE to consider the two-stage programming to be complete.
Source address of data being read and destination address being written, can not be part the same flash instance.
CRC peripheral registers are modified during execution, and restored before returning. The CRC must not be used by the application while writing the buffer to flash.
Flash_WriteDouble
FlashStatus_t Flash_WriteDouble(uint32_t addr, const uint32_t * word, bool enb_endurance)
Location: flash.h:164
Parameters
Direction | Name | Description |
---|---|---|
in |
addr |
Address of the word to be written in flash. |
in |
word |
32-bit C pointer to the word and ECC data to be written to flash:
|
in |
enb_endurance |
Set to 0 for default flash endurance; |
Return
A read-back verification is performed after write to ensure the write has been successful.
See: FlashStatus_t
NOTE: addr must be word aligned.
Interrupts are not disabled; operation is undefined if the calling application modifies the values of flash registers before returning from this function call.
Flash_ReadWord
FlashStatus_t Flash_ReadWord(uint32_t addr, uint32_t * word)
Location: flash.h:181
Parameters
Direction | Name | Description |
---|---|---|
in |
addr |
Address in flash to be read. |
out |
word |
32-bit C pointer to the word read from flash. |
Return
See: FlashStatus_t
NOTE: addr must be word aligned.
Interrupts are not disabled; operation is undefined if the calling application modifies the values of flash registers before returning from this function call.
Flash_ReadBuffer
FlashStatus_t Flash_ReadBuffer(uint32_t flash_addr, uint32_t dram_addr, unsigned int word_length)
Location: flash.h:202
Parameters
Direction | Name | Description |
---|---|---|
in |
flash_addr |
Address of first word location in flash. |
in |
dram_addr |
Address of first word location in static memory. |
in |
word_length |
Total number of words to be read from flash. |
Return
See: FlashStatus_t
NOTE: flash_addr and dram_addr must be word aligned.
Interrupts are not disabled; operation is undefined if the calling application modifies the values of flash registers before returning from this function call.
This function fails if the DMA or CryptoCell continuously blocks memory accesses by the flash copier by accessing memory on every cycle.
Flash_ReadDouble
FlashStatus_t Flash_ReadDouble(uint32_t addr, uint32_t * word)
Location: flash.h:227
Parameters
Direction | Name | Description |
---|---|---|
in |
addr |
Address of the word to be read from flash. |
out |
word |
32-bit C pointer to the word and ECC data read from flash:
|
Return
NOTE: ECC checks are not performed on the 32-bit data word or 6-bit ECC value.
See: FlashStatus_t
NOTE: addr must be word aligned.
Interrupts are not disabled; operation is undefined if the calling application modifies the values of flash registers before returning from this function call.
Flash_EraseFlashBank
FlashStatus_t Flash_EraseFlashBank(uint32_t num)
Location: flash.h:245
Parameters
Direction | Name | Description |
---|---|---|
in |
num |
Flash instance not to be erased. |
Return
See: FlashStatus_t
NOTE: A blank check is not performed to ensure that the flash has been successfully erased. Flash_BlankCheck can be used by an application to verify if the erase has been successful.
NVR regions are not erased. Interrupts are not disabled; operation is undefined if the calling application modifies the values of flash registers before returning from this function call.
Flash_EraseChip
FlashStatus_t Flash_EraseChip()
Location: flash.h:262
Return
See: FlashStatus_t
NOTE: A blank check is not performed to ensure that the flash has been successfully erased. Flash_BlankCheck can be used by an application to verify if the erase has been successful.
NVR regions are not erased.
Interrupts are not disabled; operation is undefined if the calling application modifies the values of flash registers before returning from this function call.
Flash_EraseSector
FlashStatus_t Flash_EraseSector(uint32_t addr, bool enb_endurance)
Location: flash.h:278
Parameters
Direction | Name | Description |
---|---|---|
in |
addr |
An address within the flash sector to be erased. |
in |
enb_endurance |
Set to 0 for default flash endurance; |
Return
NOTE: Interrupts are not disabled; operation is undefined if the calling application modifies the values of flash registers before returning from this function call.
Flash_BlankCheck
FlashStatus_t Flash_BlankCheck(uint32_t addr, unsigned int word_length)
Location: flash.h:294
Parameters
Direction | Name | Description |
---|---|---|
in |
addr |
Address of the first word in flash to be verified. |
in |
word_length |
Total number of words to be verified. |
Return
NOTE: Interrupts are not disabled; operation is undefined if the calling application modifies the values of flash registers before returning from this function call.
addr must be word aligned.