This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

DFU file not word aligned

Hi

I've to provide support to an old project created with SDK 6, under GCC and Eclipse platforms. I've never had problems when creating the HEX file to be used on DFU service... until today.

When trying to update, I get an error related to "DFU file not word aligned". Looking in this forum, I've seen that this problem may occurs when the application size is bigger than the threshols limit. But in my case, I've made updates with bigger HEX file with no problems. So all I think is that in fact, my HEX file is not word aligned.

To transfer the file, I'm using just the HEX file, with no init packet. In order to create the HEX file from the ELF (OUT) output, I use the following sentence:

arm-none-eabi-objcopy -O ihex my_app.out my_app.hex

What am I doing wrong?

Thanks in advance, Regards,

Elena

  • Could it be that arm-none-eabi-objcopy formats the hex file incorrectly? Can't you configure Eclipse and GCC to compile you application to a hex file and not an .elf file?

  • I've tried too, but it looks that internally the procedure is the same: GCC first generates the ELF file, and later the HEX file by converting it. I see no differences in the file. Thanks anyway.

  • Hi again

    I've been able to detect where's the problem. Here below the complete description:

    I've inspected the generated HEX file and I've found the following suspect line:

    :10AD4000321D30F94877825A3CBF737FDD4F15754D
    :10AD5000BC89D897B2D29C3C33A7A8D523F64939F1
    :10AD60003DA7F444FD0FA5329D978CCF08BA5B2513
    :10AD7000436FAC642806180E303132333435363721
    :03AD80003839005F
    :08AD8400686AFF7F0100000076
    :10AD8C0001000000FFFFFFFF02000000AC5628147A
    :10AD9C00FFFF0000F7A90200010000000000000006
    

    The line :03AD80003839005F is incorrect because it makes reference to 3 bytes, instead 4 or other aligned number. I've replaced manually by this new value:

    :04AD8000383900005F

    Now is working correctly. I'll try to find how can I configure arm-none-eabi-objcopy in order to avoid this problem.

    Thanks again

    Elena

Related