Flash Library Reference Function Documentation
Flash_Initialize
FlashStatus_t Flash_Initialize(unsigned int num, FlashClockFrequency_t freq)
Location: flash.h:155
Returns:
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.
Returns:
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.
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
num |
Flash instance to be initialized |
|
in |
freq |
Flash clock frequency in Hertz, only defined frequencies supported |
Flash_WriteWord
FlashStatus_t Flash_WriteWord(uint32_t addr, uint32_t word, bool enb_endurance)
Location: flash.h:175
Set to 1 to enable two-stage programming for higher endurance of the data programmed.
Returns:
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.
Returns:
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.
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; |
Flash_WriteBuffer
FlashStatus_t Flash_WriteBuffer(uint32_t addr, uint32_t word_length, const uint32_t * words, bool enb_endurance)
Location: flash.h:207
the buffer to be written to flash.
Set to 1 to enable two-stage programming for higher endurance of data programmed.
Returns:
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.
Returns:
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.
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; |
Flash_WriteDouble
FlashStatus_t Flash_WriteDouble(uint32_t addr, const uint32_t * word, bool enb_endurance)
Location: flash.h:234
A read-back verification is performed after write to ensure the write has been successful.
- word[0] contains the data to be written to flash
- word[1] [5:0] contains the 6-bit data to be written as the ECC value.
Set to 1 to enable two-stage programming for higher endurance of data programmed.
Returns:
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.
A read-back verification is performed after write to ensure the write has been successful.
Returns:
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.
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; |
Flash_ReadWord
FlashStatus_t Flash_ReadWord(uint32_t addr, uint32_t * word)
Location: flash.h:251
Returns:
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.
Returns:
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.
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
addr |
Address in flash to be read. |
|
out |
word |
32-bit C pointer to the word read from flash. |
Flash_ReadBuffer
FlashStatus_t Flash_ReadBuffer(uint32_t flash_addr, uint32_t dram_addr, unsigned int word_length)
Location: flash.h:272
Returns:
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.
Returns:
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.
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. |
Flash_ReadDouble
FlashStatus_t Flash_ReadDouble(uint32_t addr, uint32_t * word)
Location: flash.h:297
NOTE: ECC checks are not performed on the 32-bit data word or 6-bit ECC value.
- word[0] contains the data to word read from flash.
- word[1] [5:0] contains the 6-bit data ECC value read.
Returns:
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.
NOTE: ECC checks are not performed on the 32-bit data word or 6-bit ECC value.
Returns:
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.
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:
|
Flash_EraseFlashBank
FlashStatus_t Flash_EraseFlashBank(uint32_t num)
Location: flash.h:315
Returns:
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.
Returns:
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.
Parameters
| Direction | Name | Description |
|---|---|---|
|
in |
num |
Flash instance not to be erased. |
Flash_EraseChip
FlashStatus_t Flash_EraseChip()
Location: flash.h:332
Returns:
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.
Returns:
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:348
Set to 1 to enable two-stage erase iteration for higher endurance of flash.
Returns:
NOTE: Interrupts are not disabled; operation is undefined if the calling application modifies the values of flash registers before returning from this function call.
Returns:
NOTE: Interrupts are not disabled; operation is undefined if the calling application modifies the values of flash registers before returning from this function call.
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; |
Flash_BlankCheck
FlashStatus_t Flash_BlankCheck(uint32_t addr, unsigned int word_length)
Location: flash.h:364
Returns:
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.
Returns:
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.
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. |