SPRADE8A November 2023 – April 2024 F29H850TU , F29H859TU-Q1 , TMS320F28P650DH , TMS320F28P650DK , TMS320F28P650SH , TMS320F28P650SK , TMS320F28P659DH-Q1 , TMS320F28P659DK-Q1 , TMS320F28P659SH-Q1
The EEPROM_Program_64_Bits() function provides functionality for programming four 16-bit words to memory. The first parameter, Num_Words, allows the user to specify how many valid words are written. The data words are assigned to the first 4 indexes of the Write_Buffer to be used by the Fapi_issueProgrammingCommand function. If less than four words are specified in the function call, missing words are filled with 0xFFFF. This is done to comply with ECC requirements.
First, a full EEPROM unit is tested for.
EEPROM_Get_64_Bit_Data_Address();
Next, the Write Buffer is filled with 1s if less than 4 words are specified.
int i;
for(i = Num_Words; i < 4; i++)
{
Write_Buffer[i] = 0xFFFF;
}
Next, data is programmed and the pointer is incremented to the next location to program data.
// Clears status of previous Flash operation
ClearFSMStatus();
Fapi_setupBankSectorEnable(FLASH_WRAPPER_PROGRAM_BASE+FLASH_O_CMDWEPROTA, WE_Protection_A_Mask);
Fapi_setupBankSectorEnable(FLASH_WRAPPER_PROGRAM_BASE+FLASH_O_CMDWEPROTB, WE_Protection_B_Mask);
oReturnCheck = Fapi_issueProgrammingCommand((uint32*) Bank_Pointer,
Write_Buffer, 4, 0, 0,
Fapi_AutoEccGeneration);
// Wait for completion and check for any programming errors
EEPROM_CheckStatus(&oReturnCheck);
Empty_EEPROM = 0;
// Increment to next location
Bank_Pointer += 4;