2020-07-13 11:31 AM
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
Solved! Go to Solution.
2020-07-14 03:31 PM
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.
2020-07-13 11:39 AM
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.
2020-07-13 11:47 AM
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.
2020-07-13 12:10 PM
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?
2020-07-13 12:27 PM
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.
2020-07-13 12:56 PM
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.
2020-07-13 01:30 PM
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.
2020-07-13 06:43 PM
> 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.
2020-07-14 08:13 AM
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.
2020-07-14 03:31 PM
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.