Skip to main content
Visitor II
August 13, 2019
Question

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

  • August 13, 2019
  • 3 replies
  • 3065 views

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.

    This topic has been closed for replies.

    3 replies

    ST Employee
    August 14, 2019

    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.

    MLawrAuthor
    Visitor II
    August 15, 2019

    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.....?

    MLawrAuthor
    Visitor II
    August 14, 2019

    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.

    Super User
    August 14, 2019

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

    0690X00000A9bMRQAZ.png

    hth

    Frank

    MLawrAuthor
    Visitor II
    August 15, 2019

    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.....?

    ST Employee
    August 16, 2019

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