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.

TMS570LC4357 writing partial words in flash

Other Parts Discussed in Thread: TMS570LC4357

Hi,

I'm currently trying to modify a bootloader from the TMS570LS31 to work on the TMS570LC4357. The bootloader uses the XCP Protocol via CAN Bus to transfer data to the controller. This data should then be programmed to flash banks 0 and 1.

Due to the length of the CAN messages there are at most 7 bytes in one message which should be programmed to flash (one byte is used to notify the programming command). Very often only 4 bytes per message should be programmed (it is not possible to wait until 8 bytes have been received, as there is no evidence that the data comes in sequential order via the CAN bus).

Therefore i have to use the 'Fapi_DataOnly' command with the 'Fapi_issueProgrammingCommand' function, as an ECC value should not be calculated and programmed automatically beacuse there is no complete word to be programmed. This leads to wrong values in the flash, as they are automatically "corrected" by the unprogrammed ECC values.

When I'm trying to "manually" calculate an ECC value afterwards when the word is completed (by using 'Fapi_calculateEcc', 'Fapi_remapMainAddress' and 'Fapi_issueProgrammingCommandForEccAddresses', I'm able to calculate and program an ECC value but this does not fix the automatically "corrected" values in the flash. So i still have corrupted data after ECC calculation.

After going through several topics in this forum, I'm quite sure that i use the correct F021 library, execute the library from RAM, etc....

I also have noticed that there is a way to program partial words on bank 7, however this doesn't help either, as I'm willing to program the received data to bank 0 and bank 1.

Does anyone know how to program impartial words in these banks or does have another approach to fix this problem?

Thanks in advance.

Best regards,

Max

  • I think this will be very difficult to do. You can do partial programming of bank 0 or 1, but you cannot read back what you programmed until you have also programmed the ECC. I suspect the Fapi_calculateECC function does not work because you read from the flash then passed that data to the function. If you calculate the ECC externally and include that as part of the data passed in by CAN, then you can program all of the main flash, then program the ECC. I have not thought of any solution that does not put some additional constraints on your CAN bootloader.