Custom boot firmware, elf2img and interrupt vector table

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

In debugging our custom boot firmware with the latest SDK, I found that the latest version of elf2img uses the program header data instead of the section data to generate the image.

   

This causes it to generate an img file that includes writes to address 0x00 through 0xFF, which is reserved for the interrupt vector table and is automatically populated in the firmware initialization.

   

This would be fine, except when using a custom boot firmware, the boot firmware doesn't avoid writing to 0x00 through 0xFF, and so when the command to write to that section comes in, it proceeds to clobber the vector table with bad addresses.  It then promptly crashes andfails.

   

Either generating an image that avoids writing to 0x00-0xFF or modifying the USB boot code to avoid writing to those addresses fixes the issue, but I'm surprised that this issue has not been hit in your testing.

0 Likes
1 Reply
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hi,

   

              

   

This is a mistake in the elf2img tool. We have initiated steps to correct the BETA4 package and plugged the test gap that caused this incorrect tool version to get packaged. Please use the attached version of the elf2img tool with BETA4.

   

Sorry for the inconvenience cause. Thanks for bringing this up.

   

Regards,

   

Anand

0 Likes