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.

TMS320F28388D: Bootloader and HEX generator

Part Number: TMS320F28388D


I implemented a bootloader modifying the ROM code boot_spi_cpu1. I use it with bin files generated with C2000 Hex Utility with bynary output format. It worked for a while, but now I have a problem.

Tracking down the issue, it gives an error writing the second block of data: the instruction Fapi_issueProgrammingCommand returns Fapi_Error_AsyncIncorrectDataBufferLength.

Looking in the bin files it seems that the first blocks are very short: 2 and 5 word. I copy here the beginning of the bin file.

AA 08 - Header
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - Init data
08 00 00 00 - Entry point
02 00 - Block size
08 00 00 00 - Destination address
4A 00 9D 12 - Data
05 00 - Block size
08 00 02 00 - Destination address
AA 55 77 99 58 14 78 00 95 25 - Data
FE FF 08 00 10 00 10 FE 49 2B 49 92 02 52 E7 FF
31 0F 00 52 09 61 01 52 E0 FF 27 0F 1F 76 7E 04

If I undestand correctly, the problem is in the EEC generation that prevent to write again in the same 64-bit block of data (from TMS320F2838x Flash API Version 1.60.00.00: "Once ECC is calculated and programmed for a 64-bit data, those 64 bits can not be reprogrammed (unless the sector is erased) even if it is programming a bit from 1 to 0 in that 64-bit data, since the new ECC value will collide with the previously programmed ECC value).

How can I prevent the C2000 Hex Utility to generate such kind of bin file?

Or do I need to modify the bootloader code?