Part Number: TMS320F28374D
Other Parts Discussed in Thread: C2000WARE
Hello,
I have been trying to create a checksum using the addresses that are reserved for the program that is loaded into the flash memory. The location of the program are at the following registers with the following lengths:
FLASHB : origin = 0x082000, length = 0x002000 /* on-chip Flash */
FLASHC : origin = 0x084000, length = 0x002000 /* on-chip Flash */
FLASHD : origin = 0x086000, length = 0x002000 /* on-chip Flash */
FLASHE : origin = 0x088000, length = 0x008000 /* on-chip Flash */
I have then tried using the Flash API provided in C2000Ware using the following code:
uint32 Flash1Start = 0x20000008;
uint32 Flash2Start = 0x40000008;
uint32 Flash3Start = 0x60000008;
uint32 Flash4Start = 0x80000008;
uint16 FlashLength = 0x002000;
uint16 FlashLength2 = 0x008000;
Fapi_initializeAPI(F021_CPU0_BASE_ADDRESS,200);
while (Fapi_checkFsmForReady() != Fapi_Status_FsmReady){}
g_structMeterData.Chksum_1 = Fapi_calculateFletcherChecksum(&Flash1Start,FlashLength);
g_structMeterData.Chksum_2 = Fapi_calculateFletcherChecksum(&Flash2Start,FlashLength);
g_structMeterData.Chksum_3 = Fapi_calculateFletcherChecksum(&Flash3Start,FlashLength);
g_structMeterData.Chksum_4 = Fapi_calculateFletcherChecksum(&Flash4Start,FlashLength2);
However I noted that the Fapi_calculateFletcherChecksum has two inputs that are both uint16. I assumed this meant that it was casting my 32bit address to 16bit as when I made changes to the main.c it was not seen as a change in the checksum.
With this in mind, I went into the Fapu_calculateFletcherChecksum function, and changed the first input to accept uint32... After making this change g_structMeterData.Chksum_1 g_structMeterData.Chksum_2 g_structMeterData.Chksum_3 are all static however everytime the code is loaded using the debugger g_structMeterData.Chksum_4 has a different value.
Am I going in the correct direction or is there a different route I should be taking?
Thank you,
Ethan