SPRUJC5 April 2024 TMS320F28P550SJ , TMS320F28P559SJ-Q1
Sets up data and issues 512-bit (32 16-bit words) AutoEcc generation mode program command to valid Flash or OTP memory addresses.
Fapi_StatusType
Fapi_issueAutoEcc512ProgrammingCommand (
uint32 *pu32StartAddress,uint16*pu16DataBuffer,
uint16u16DataBufferSizeInWords
)
pu32StartAddress [in] | Start address in Flash for the data and ECC to be programmed. |
pu16DataBuffer [in] | Pointer to the Data buffer address. Address of the Data buffer should be 512-bit aligned. |
u16DataBufferSizeInWords [in] | Number of 16-bit words in the Data buffer. Max Databuffer size in words should not exceed 32. |
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 will program 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 will collide with the previously programmed ECC value.
SECTIONS
{
.text : > FLASH, ALIGN(32)
.cinit : > FLASH, ALIGN(32)
.const : > FLASH, ALIGN(32)
.init_array : > FLASH, ALIGN(32)
.switch : > FLASH, ALIGN(32)
}
If you do not align the sections in flash, you would need to track incomplete 512-bit words in a section and combine them with the words in other sections that complete the 512-bit word. This will be 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 (C2000Ware) or any custom Flash programming solution may assume that the incoming data stream is all 512-bit aligned and may not expect that a section might start on an unaligned address. Thus, it may 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 allowed programing range for the function, see Table 3-3.
FlashAPI | Main Array | DCSM OTP | ECC | Link pointer |
---|---|---|---|---|
Fapi_issueAutoEcc512ProgrammingCommand() | Allowed | Allowed | Allowed | Not allowed |
Example implemention for this function will be released in next C2000ware release.