SPRUJB8 April 2024
Sets up the flash state machine registers for the 512-bit (32 16-bit words) programming with user provided flash data and issues the programing command to valid Flash.
Fapi_StatusType Fapi_issueDataOnly512ProgrammingCommand(
uint32 *pu32StartAddress,
uint16 *pu16DataBuffer,
uint16 u16DataBufferSizeInWords
)
pu32StartAddress [in] | 512-bit aligned flash address to program the provided data. |
pu16DataBuffer [in] | Pointer to the Data buffer address. 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 will only program the data portion in Flash at the address specified. It can program 512-bit data (Second parameter) at the user provided 512-bit aligned flash address. This function is used when a user application (that embed/use Flash API) has to program 512- bit of data and corresponding 64-bit of ECC data separately. 512-bit Data is programmed using Fapi_issueDataOnly512ProgrammingCommand () function and then the 64-bit ECC is programmed using Fapi_issueEccOnly64ProgrammingCommand() function. Generally, most of the programming utilities do not calculate ECC separately and instead use function Fapi_issueAutoEcc512ProgrammingCommand(). However, some Safety applications may require to insert intentional ECC errors in their Flash image (which is not possible when Fapi_AutoEccGeneration mode is used) to check the health of the SECDED (Single Error Correction and Double Error Detection) module at run time. In such case, ECC is calculated separately (using the Fapi_calculateEcc() function as applicable). Application may want to insert errors in either main array data or in the ECC as needed. In such scenarios, after the error insertion, Fapi_issueDataOnly512ProgrammingCommand () API and then the 64-bit ECC is programmed using Fapi_issueEccOnly64ProgrammingCommand() API can be used to program the data and ECC respectively.
Refer Table 3-5 for allowed programming range for the function
Flash API | Main Array | DCSM OTP | ECC | Link Pointer |
---|---|---|---|---|
Fapi_issueDataOnly512Pr ogrammingCommand() | Allowed | Not allowed | Not allowed | Not allowed |
As described above, this function can program only a max of 512-bits (given the address provided is 512-bit aligned) at a time. If the user wants to program more than that, this function should be called in a loop to program 512-bits at a time.
The Main Array flash programming must be aligned to 512-bit address boundaries and 32 16-bit word may only be programmed once per write or erase cycle.
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_AsyncIncorrectDataBufferLength (failure: Data buffer size specified is incorrect. Also, this error will be returned if Fapi_EccOnly mode is selected when programming the Bank0 DCSM OTP space)
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”)