Hey folks,
I am working towards a customized bootloader on 79d device, which involves wirting the obtained application image to on-chip flash.
After readings on the spru513p guide, I adopted the intel format as the hex file to be parsed and transmitted to 79d, and the boot firmware will be writing or say programming the derived bytes into flash.
Question arises when populating the bytes to write Flash from the hex format image data. Some lines of the hex are not fullfilling 128 bits with some unfiled in the end. According to spnu629a guide for the FlashAPI on 2837xD device, which says:
Fapi_AutoEccGeneration – This mode will program the supplied data in Flash along with automatically generated ECC. The ECC is calculated for every 64-bit data aligned on a 64-bit memory boundary. Hence, when using this mode, all the 64 bits of the data should be programmed at the same time for a given 64-bit aligned memory address. Data not supplied is treated as all 1s (0xFFFF).
So my interpretation is, if there are unfilled bytes in the hex data, I should populate all 1s (e.g. FF) . Below are some example lines I got from the application hex file:
example 1 :140BA800003301000254880A10F0540A910A0000A80A000072
So based on the intel hex format definition, exclude the first 8 hex numbers, (number of bytes, address, type) and last 2 hex (CRC), this line has 14 ie. 20 bytes, the bytes to write to flash are (I aligend the representation below by every 128 bit i.e 8 * 16-bit hex)
"0033 0100 0254 880A 10F0 540A 910A"
"0000 A80A 0000 FFFF FFFF FFFF FFFF"
example 2 :1F0B8800061F22C029681A4AA8A5A4CDA6034A5A0622052EC4021A0625002500010606AF
This line has 1F i.e. 31 bytes, so my interpretation is
"061F 22C0 2968 1A4A A8A5 A4CD A603 4A5A"
"0622 052E C402 1A06 2500 2500 0106 06FF"
The FF with background color is what should be writen to the Flash.
Please don't bother with the detailed numbers, is my interpretation correct regarding the FF padding part?
Thanks for your suggestions in advance.
Regards,
Wei