Code when compiled into HEX format then downloaded into MCU doesn't fully work

Hi,

We have been using Mbed and Mbed Studio for quite some time, now run into some really weird issues. During development, we will just compile firmware into bin file and download into MCU(STM32F767ZI) with a ST-link/mass storage. Then during production, we will compile firmware into HEX format, by adding the following line into mbed_app.json

"target.OUTPUT_EXT": "hex",

When compiled hex file is downloaded into MCU via commerticial tool, everything will go through, and after system will power up and everything will appear to be working just fine. But upon careful inspection, some feature(s) actually doesn’t work while the same feature will work just fine if a BIN file is downloaded to MCU.

I understand building into HEX is probably not a commonly used feature, but we have been using it since many years ago, and this feature worked until now. So my question is, is this an issue of mbed studio or our code?

Please advise.
Thanks,
ZL

Two questions:

  • What features, specifically, are not working when using the hex file? Is it possible it’s something to do with having the debugger connected affecting whether it’s working or not?
  • Have you tried using the same commercial tool to download a bin file? Could be a good way to figure out where the problem is. I know if it’s J-Link you can flash a binfile just fine, IDK about others.
1 Like

When I tried it again 10 minutes ago, after downloading hex file, system simply doesn’t power up. Previously it was only a minor feature that didn’t work. We always disconnect debug tool after downloading firmware, so it is unlikely this was affected by debug tool.

It is tool developed by Elprotroinics. We have been using the very same tool for previous versions with STM32F407 and other STM32 MCUs without any problems. I guess the tool itself can be a source of problem. I will try to verify with ST-link and see what I can find.

Just tried flashing the same BIN file with the same tool, a different part of the code didn’t work. I guess the tool itself has run its course, or something is wrong with either setup or tool.