This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320F280025C: Overwrite data at a flash address to 0x0000

Part Number: TMS320F280025C

Hi,

I have implemented a DFU over CAN, where the bootloader checks, if the application header is correct (a key) or not. To start a DFU, the application should modify the header to 0x0000, such that

the bootloader notice, that the firmware needs to be updated. I implemented a small program to test, if I can overwrite some flash data by using the Fapi_issueProgrammingCommand(), but the overwrite process always fails with a 0x48 error:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/////////////////////////////////////////////////////////////////////////////////////////////////////Reset Flash header
//Init flash first:
initFlashSectors();
EALLOW;
uint16_t miniBuffer1[4] = {0x0000};
uint16_t miniBuffer2[4] = {0x0000};
miniBuffer1[0] = 0x46ab;
miniBuffer1[1] = 0x17c4;
miniBuffer1[2] = 0x1289;
miniBuffer1[3] = 0x3ffe;
//////////////////////////////////////////////////////////////////////////////////////////////////////Write first to flash header
Fapi_issueProgrammingCommand((uint32_t *) 0x0008F000, miniBuffer1,
sizeof(miniBuffer1), 0, 0, Fapi_AutoEccGeneration);
while (Fapi_checkFsmForReady() != Fapi_Status_FsmReady){};
Fapi_FlashStatusType oFlashStatus = Fapi_getFsmStatus();
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

How can the data at a specific flash area be modified (of course with 0x0000, otherwise it will not work), without erasing the sector?

  • Hi Sebestian,

    Once you program a flash location along with ECC, you will not be able to modify those contents again without erasing.

    Please let me know if you have further questions.

    Thanks and regards,

    Vamsi