Debug axf (ELF) file but flash binary file

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Debug axf (ELF) file but flash binary file

1,694 Views
tomaskrysl
Contributor I

Hi I would like to debug the axf (ELF) file with LPCXpresso but flash from another (binary) file to the target.

I create the binary file from the axf file with objcopy in a post build step.

Is that possible?

The reason for this binary file is I am adding ONEinspect debug info into it.

And I want to have that debug info available even when debugging with LPCXpresso (I can normally flash the bin file with LPCXpresso flash utility).

Unfortunately ONEinspect's Formatconverter does not (yet) support direct management of ELF files.

LPCXpresso seems to support only the axf (ELF) file, because when I select my bin file as source in my Debug configuration the debugger fails to load it.

Thank you

Labels (1)
0 Kudos
3 Replies

1,022 Views
lpcxpresso_supp
NXP Employee
NXP Employee

Please note LPCXpresso v7.5.0 is quite dated. The current supported version is LPCXpresso v8.2.0. Without looking back through the release notes of several interim releases, it's possible you might benefit from updating.

Thanks and regards,

LPCXpresso Support

0 Kudos

1,021 Views
lpcxpresso_supp
NXP Employee
NXP Employee

As you're aware, LPCXpresso can flash a binary file for flash-only operations. It needs the base address. You're not allowed to specify a binary file within a project debug configuration. There would be little point to load a file format which does not (or cannot) incorporate the debug information. If you want to flash the binary file in a separate step (e.g. IDE flash dialog), you can do so. Then, create a project debug configuration using the attach option. This allows LPCXpresso to attach to a running target. LPCXpresso will not flash the image resident in the .axf file. It does read in the .axf file DWARF debug information, if it exists. The last thing I'll say is ONEinspect claims to support LPCXpresso. I recommend you contact them for assistance.

Thanks and regards,

LPCXpresso Support

0 Kudos

1,022 Views
tomaskrysl
Contributor I

Thank you the attach only option works fine and we can live with that (unfortunatelly the restart button does not work). In future it would be great to have this automated through a single click on debug button. I mean to be able to flash the app exactly like via the flash dialog, but in background, and then attach the debugger (configure post-builded binary or hex file for flash operation and ELF file with debug info for debugging). Plus have the restart button working.

Another solution would be to replace the text section content in the axf file but this solution would be clearly an overkill. Objcopy from version 7.5.0 (we use now) does not support --update-section anyway.

0 Kudos