cancel
Showing results for 
Search instead for 
Did you mean: 

How do I generate a .bin or .hex file for Release configuration ?

MLawr
Associate III

My project compiles with no errors and no warnings. Debug configuration generates a .bin, but Release configuration will only generate a .elf, that STLink will not use under Windows. I have tried selecting C/C++ Build ->Settings ->Tool Settings ->MCU Post Build Outputs for .bin etc., but this doesn't work.

7 REPLIES 7
Ethan HUANG
ST Employee

Did a quick test by using STM32CubeIDE v1.0.2 over Win10 and was not able to replicate this issue:

08:45:39 **** Build of configuration Release for project 01_F746-DISCO ****

make -j8 all 

...

Finished building target: 01_F746-DISCO.elf

arm-none-eabi-size 01_F746-DISCO.elf 

arm-none-eabi-objdump -h -S 01_F746-DISCO.elf > "01_F746-DISCO.list"

arm-none-eabi-objcopy -O binary 01_F746-DISCO.elf "01_F746-DISCO.bin"

 text data bss dec hex filename

11612 120 1720 13452 348c 01_F746-DISCO.elf

Finished building: default.size.stdout

Finished building: 01_F746-DISCO.bin

Finished building: 01_F746-DISCO.list

08:45:50 Build Finished. 0 errors, 0 warnings. (took 10s.543ms)

I think you used the right setting for Debug configuration, but curious if you did the same for Release configuration?

Meanwhile, STM32CubeProgrammer (successor of ST-LINK Utility) supports ELF file.

MLawr
Associate III

I can see no difference between the settings for Debug and Release configurations, but I am new to all of this and I may not know what to look for. Please let me know what settings I need to create a Release configuration that STLink will accept. I am using Internal Build instead of external make.

KnarfB
Principal III

Enabling the binary/hex check boxes in Project > Settings works fine for me:

0690X00000A9bMRQAZ.png

hth

Frank

I had set the binary/hex checkboxes for my Release configuration and I have updated STM32CubeIDE Version 1.0.2, , but I am still not generating .hex or .bin executables. Also, looking at the internally-generated makefile, there appears to be no command to build .hex or .bin; only .elf.....?

I had set the binary/hex checkboxes for my Release configuration and I have updated STM32CubeIDE Version 1.0.2, , but I am still not generating .hex or .bin executables. Also, looking at the internally-generated makefile, there appears to be no command to build .hex or .bin; only .elf.....?

Could you help let us now which OS you are using now?

MLawr
Associate III

I am using Windows 10.