cancel
Showing results for 
Search instead for 
Did you mean: 

Debugging .hex file on STM32f469i Board

TLian.11
Associate II

Hello All,

I want to load AND debug a precompiled .hex file onto my STM32f469i Discovery board. I've looked around and tried several tools such as the STM32CubeIDE and the ST-Link utility, but no luck. The CubeIDE seems to be unable to flash the file, and the ST-Link can't debug. Any advice? Is something like this even possible?

Thank You,

Tom

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

It will only let you select ELF files if you hit the "Search Project..." button, but you can type in the HEX file name into the "C/C++ Application" field and it'll upload and start debugging just fine.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

10 REPLIES 10
LMI2
Lead

I know that ST link utility can upload and Keil IDE can upload and debug a hex-file. Cubedownloader works too. Very likely other IDEs too. By the way, St link cannot debug, it is only a downloader. The CubeIde can do both probably.

TLian.11
Associate II

I'll download the Keil IDE and give it a try, but if you know how it can be done on the CubeIDE, I'd rather use that. I've searched around to see if .hex file loading can be done on the CubeIDE and came up with nothing.

LMI2
Lead

Unfortunately this machine is 32bit Windows and CubeIde doesn't work here. I should install Win 10/64 but I have not done it yet.

But Iam pretty sure there is something wrong with your set up. Either your board, your cables or something like that.

Is your Discovery board working, Nucleo boards have short circuit coding pins, and some Discovery boards have those in for STlink control. Are those correct?

TLian.11
Associate II

The discovery board works, I'm able to compile and load the sample programs set up by the CubeIDE, as well as flash the demo file from the st website onto the board.

The ability to debug is going to be relatively limited on a .HEX only file. Basically disassembly and register view. The .HEX file doesn't contain any symbols.

The ST-LINK Utilities, has a very rudimentary debug interface.

Other methods are to create a proxy project, flag not to download as part of the debug, flag not to run-to-main(), and then debug and step into the code.

In Keil one method is to create a proxy project for the chip/platform, build it, and then substitute the AXF/ELF file. Here I'd probably convert the HEX to an ELF just to simplify things, and if really adventurous I'd add symbols, and review a rough disassembly.

Tips, buy me a coffee, or three.. PayPal Venmo Up vote any posts that you find helpful, it shows what's working..
TLian.11
Associate II

Basic disassembly and register view is what I was looking for, console output too if it exists. The Keil IDE seems to be the right tool, but I'm surprised that the CubeIDE doesn't support loading .hex files for debug.

Is there an easy way to convert the .hex to a .elf? I've looked into that, but the methods I've seen all involved writing linker files which I have no experience with.

TDK
Guru

> I'm surprised that the CubeIDE doesn't support loading .hex files for debug.

Works just fine for me. Obviously it's limited to disassembly and register views.

Choose the HEX file instead of the ELF file in your debug configuration.

If you feel a post has answered your question, please click "Accept as Solution".
TLian.11
Associate II

When I go to the debug configurations, it lets me to select the file path for project files compiled by the CubeIDE. Unless I am missing something, it doesn't let me load standalone .hex files.

TDK
Guru

It will only let you select ELF files if you hit the "Search Project..." button, but you can type in the HEX file name into the "C/C++ Application" field and it'll upload and start debugging just fine.

If you feel a post has answered your question, please click "Accept as Solution".