cancel
Showing results for 
Search instead for 
Did you mean: 

.bin / .hex File Generation

Ddu P
Associate II

Hi 🙂

I have just downloaded STM32CubeIDE and am trying to get a simple BlinkLED going on STM32F401CB.

I go through the steps, and first off Build does not work out of the box - it is necessary to first change "Builder type" to "Internal builder" in the Project Properties (Windows environment).

Now, I want to generate .hex / .bin files - so I go to C/C++ Build -> Settings -> MCU Post build outputs and tick "Convert to binary file (-O binary)" and "Convert to Intel Hex file (-O ihex)" (for all configurations) - but the .bin (or .binary) / .hex (or .ihex) files just don't seem to be generated... I also don't see any "-O binary" or "-O ihex" anywhere in the output during build.

Is this because "Internal builder" is selected? If so, then any tips on getting the External builder working (I get the error "The system cannot find the path specified") with the External Builder)?

Thank you!

8 REPLIES 8
tinkerer42
Associate III

Did you end up solving this by any chance? no binary generation is a showstopper for my scenario, and I have encountered the same problem you did...

Ddu P
Associate II

I got busy with other things and proceeded with a different IDE/compiler which I already had working - I had an idea that the problem might perhaps be that I installed STM32CubeIDE under a folder which has spaces in the name (although the workspace / project path did not have any spaces in it) - will have to test when I get a gap...

tinkerer42
Associate III

hmm, I also installed it in a folder with space (C:\Program Files\ST\...). Will check too.

Really, this default install folder in C:\ST looks rather unprofessional. There's a designated place for apps in Windows... and if it causes little things to *silently* fail that's even worse.

Ddu P
Associate II

Yip that's what I did as well (C:\Program Files...).

Ozone
Lead

Check if some ../bin folder of your toolchain contains an objcopy executable.

You an convert the output manually, or add it as post-build step to your project.

In case you don't know, it is a command line tool to convert between object/binary file formats.

All gcc-based toolchains used to have it.

tinkerer42
Associate III

OK, so I found out this problem with missing generation of binaries is related to the spaces in the installation folder path, but in a roundabout way:

As some other users have reported, I found that the 'external builder' setting doesn't work and must be changed to 'internal builder' (Project Properties-->C/C++ Build -->Builder Settings tab). It turns out that this is a problem only with spaces in the installation folder. I just reinstalled the IDE at the default folder (under C:\ST) and now the default 'External Builder' works - and that external builder also generates the binary output that was missing!

So, to summarize:

  • 'External Builder' is broken when there are spaces in the installation folder, e.g. as in "C:\Program Files\ST".
  • 'Internal Builder' does work with spaces in the installation folder, but the generation of binary output is broken when using this builder.

Ddu P
Associate II

Thank-you tinkerer42! :D

sbay.1
Associate

if output compiler error duplicate function Check On source.mk it any list double file

goto project properties

delete any list folder , this work for me

0693W000005BXkTQAW.png