SPRUJE7A January 2025 – July 2025 F29H850TU , F29H859TU-Q1
Sets up data and issues 512-bit (64 bytes) AutoEcc generation mode program command to valid Flash, BANKMGMT, and SECCFG memory addresses.
Fapi_StatusType Fapi_issueAutoEcc512ProgrammingCommand(
uint32_t *pu32StartAddress,
uint8_t *pu8DataBuffer,
uint8_t u8DataBufferSizeInWords,
uint32_t u32UserFlashConfig,
uint8_t u8Iterator
);
| pu32StartAddress [in] | 1024-bit aligned flash address to program the provided data and ECC. |
| pu8DataBuffer [in] | Pointer to the Data buffer address. Address of the Data buffer can be 1024-bit aligned. |
| u8DataBufferSizeInWords [in] | Number of bytes in the Data buffer. Max Databuffer size in words can not exceed 64. |
| u32UserFlashConfig [in] | User flash configuration bitfield |
| uint8u8Iterator [in] | Iterator for program and erase operations on interleaved banks. 0: Data Flash/non-interleaved 1: B0or B2(dependent on provided address) 2: B1 or B3 (dependent on provided address) |
This function automatically generates 8 bytes of ECC data for the user provided 512-bit data (second parameter) and programs the data and ECC together at the user provided 512-bit aligned flash address (first parameter). When this command is issued, the flash state machine programs all of the 512-bits along with ECC. Hence, when using this mode, data not supplied is treated as all 1s (0xFFFF). Once ECC is calculated and programmed for a 512-bit data, those 512-bits cannot be reprogrammed (unless the sector is erased) even if it is programming a bit from 1 to 0 in that 512-bit data, since the new ECC value collides with the previously programmed ECC value.
| Address | Data |
|---|---|
| 0x10000000 | Data bytes 0-15 |
| 0x10000010 | 0xFFFF |
| 0x10000020 | Data bytes 16-31 |
| 0x10000030 | 0xFFFF |
And so on. If the ordering of the data buffer is important, an example of how to properly format the buffer so that it maintains its order in flash can be found in this function's sample implementation. ("f29h85x-sdk > examples > driverlib > single_core > flash > flash_mode0_512_program").
Here is an example:
SECTIONS
{
.text : > FLASH, palign(64)
.cinit : > FLASH, palign(64)
.const : > FLASH, palign(64)
.init_array : > FLASH, palign(64)
.switch : > FLASH, palign(64)
}
If you do not align the sections in flash, you must track incomplete 512-bit words in a section and combine them with the words in other sections that complete the 512-bit word. This is difficult to do. Hence, it is recommended to align your sections on 512-bit boundaries.
Some 3rd party Flash programming tools or TI Flash programming kernel examples, or any custom Flash programming solution can assume that the incoming data stream is all 512-bit aligned and can not expect that a section might start on an unaligned address. Thus, it can try to program the maximum possible (512-bits) words at a time assuming that the address provided is 512-bit aligned. This can result in a failure when the address is not aligned. So, it is suggested to align all the sections (mapped to Flash) on a 512-bit boundary.
For the allowed programming range for the function, see Table 3-3.
| Flash API | Main Array | ECC | BANKMGMT and SECCFG |
|---|---|---|---|
| Fapi_issueAutoEcc512ProgrammingCommand() | Allowed | Allowed | Not allowed |
Also, the user application can use the Fapi_doVerify() function to verify that the Flash is programmed correctly.
This function does not wait until the program operation is over; it just issues the command and returns back. Hence, the user application must wait for the Flash Wrapper to complete the program operation before returning to any kind of Flash accesses. The Fapi_checkFsmForReady() function can be used to monitor the status of an issued command.
(For more information, see the flash programming example provided in the F29H85x SDK at “f29h85x-sdk > examples > driverlib > single_core > flash > flash_mode0_512_program”)