AnsweredAssumed Answered

HEX files and customized bootloader

Question asked by Yaniv Bouhadana on May 30, 2016
Latest reply on May 31, 2016 by Bob Paddock

I'm working with K64 and KDS .

since there is no USB Host Bootloader for this device I'm tring to implement my own Bootloader.

Based on a "BM USB Host" example for this device (USB Host Project with KSDK 1.3 and Processor Expert ) I create a tool which read and parse .hex file in order to program it automatically.

I edited the original linker file for the code to push adresses by 0x020000 so all the data should be writen in the rest of the memory.

When I'm asking the KDS complier to create in addition to the elf file a HEX file there is just one critical problem : somewhere in the middle of the HEX file one of the packets size takes just 4/8 bytes and then the addresses of the rest of the file now is starting from a XXX8 and XXXC address which is not aligned anymore.

tring to program this packets on the flash returns with FTFx_ERR_SIZE (0x2000) error for the first 4 Byte packet and with FTFx_ERR_ACCERR (0x0020) error for the rest packets probably since the data is not 16 byte aligned anymore.

What is the solution for this situation? is there a simple way to enforce the compiler to create a 16 bytes aligned HEX file or i should invest more time with better robust algorithm for handeling the non-align data?

2016-05-30_16-46-01.png

Outcomes