SPRUJB8 April 2024
Sets up the flash state machine registers for the 64-bit (4 16-bit words) programming with user provided ECC data and issues the programing command to valid Flash and OTP memory.
Fapi_StatusType Fapi_issueEccOnly64ProgrammingCommand(
uint32 *pu32StartAddress,
uint16 *pu16EccBuffer,
uint16 u16EccBufferSizeInBytes
)
pu32StartAddress [in] | 512-bit aligned flash address to program the provided ECC data. |
pu16EccBuffer [in] | Pointer to the ECC buffer address |
u16EccBufferSizeInBytes [in] | Number of 8-bit bytes in the ECC buffer. Max Eccbuffer size in words should not exceed 8. |
This function will only program the ECC portion in Flash ECC memory space at the address (Flash main array address should be provided for this function and not the corresponding ECC address) specified. It can program 64-bit of ECC data (Second parameter) at the ECC address corresponding to the user provided 512-bit aligned flash address. 64-bit ECC data can be split as 8 bytes ECC data correlated to 512-bit aligned data (4 * 128, each 2 bytes corresponding to each 128 data).
Refer Table 3-6 below
512 bits data (4 * 128bits) | |||
---|---|---|---|
1st 128-bit data | 2nd 128-bit data | 3rd 128-bit data | 4th 128-bit data |
LSB of pu16EccBuffer[0] | LSB of pu16EccBuffer[1] | LSB of pu16EccBuffer[2] | LSB of pu16EccBuffer[3] |
MSB of pu16EccBuffer[0] | MSB of pu16EccBuffer[1] | MSB of pu16EccBuffer[2] | MSB of pu16EccBuffer[3] |
Flash API | Main Array | DCSM OTP | ECC | Link Pointer |
---|---|---|---|---|
Fapi_issueEccOnly64Prog rammingCommand() | Not allowed | Not allowed | Allowed | Not allowed |
As described above, this function can program only a max of 64-bits ECC at a time. If the user wants to program more than that, this function should be called in a loop to program 64-bits at a time.
The Main Array flash programming must be aligned to 512-bit address boundaries and 64-bit ECC word may only be programmed once per write or erase cycle.
ECC should not be programmed for link pointer locations. 512-bit address range starting with link pointer address shall always be programmed using 128-bit Fapi_issueProgrammingCommand().
Fapi_Status_Success (success) • Fapi_Status_FsmBusy (FSM busy)
Fapi_Error_AsyncDataEccBufferLengthMismatch (failure: Data buffer size either is not 64-bit aligned or data length crosses the 128-bit aligned memory boundary)
Fapi_Error_FlashRegsNotWritable (failure: Flash register writes failed. The user should make sure that the API is executing from the same zone as that of the target address for flash operation OR the user should unlock before the flash operation.
Fapi_Error_FeatureNotAvailable (failure: User passed a mode that is not supported)
Fapi_Error_InvalidAddress (failure: User provided an invalid address. For the valid address range, see the TMS320F28P65x Microcontrollers Data Manual)
(Please refer to the flash programming example provided in C2000Ware at “C2000Ware_.....\driverlib\F28P65x\examples\....\flash\flashapi_512bit_programming\flashapi_cpu1_512bitprogramming.c”)