cancel
Showing results for 
Search instead for 
Did you mean: 

bin file is not built by project generated by CubeMX 4.26

Alex Farber
Associate III
Posted on July 03, 2018 at 07:41

After upgrading to STM32CubeMX 4.26 I found, that System Workbench project generated by CubeMX, doesn't produce .bin file during build. Output directory contains .elf and .hex file. In previous versions there was also .bin file.

What happens when such project is executed? Does it burn .elf file to device flash memory? For the same project, bin file has 90 KB size, and elf file is 2900 KB size.

Project generated by old CubeMX version prints this during build:

arm-none-eabi-objcopy -O binary 'rcu.elf' 'rcu.bin'

Project generated by CubeMX 4.26 prints:

arm-none-eabi-objcopy -O ihex 'rcu.elf' 'rcu.hex'

Steps to reproduce: Create new STM32CubeMX project, select any board or MCU, in my case this is STM32469I-EVAL. Select SW4STM32 toolchain.Generate code. Import generated project to System Workbench for STM32. Build the project. Output Debug directory doesn't contain .bin file.

Environment: STM32CubeMX 4.26.0, STM32Cube_FW_F4_V1.21.0, System Workbench for STM32 Version: 1.15.0.201708311556, Windows 10 x64.

Note. I ask this question here and not in OpenSTM32 community, because this seems to be related to STM32CubeMX.

#cubemx-4.26 #system-workbench-for-stm32
4 REPLIES 4
Alex Farber
Associate III
Posted on July 03, 2018 at 09:05

After some investigation, I found that CubeMX 4.26 produces STM32 Workbench project with the following Post-build step:

arm-none-eabi-objcopy -O ihex '${BuildArtifactFileBaseName}.elf' '${BuildArtifactFileBaseName}.hex' && arm-none-eabi-size '${BuildArtifactFileName}'

In previous versions it was:

arm-none-eabi-objcopy -O binary '${BuildArtifactFileBaseName}.elf' '${BuildArtifactFileBaseName}.bin' && arm-none-eabi-size '${BuildArtifactFileName}'

I can get .bin file by manually editing the post build step, for example:

arm-none-eabi-objcopy -O ihex '${BuildArtifactFileBaseName}.elf' '${BuildArtifactFileBaseName}.hex' && arm-none-eabi-size '${BuildArtifactFileName}' && arm-none-eabi-objcopy -O binary '${BuildArtifactFileBaseName}.elf' '${BuildArtifactFileBaseName}.bin'

But this should be done every time after code generation. What is the purpose of this change? It it possible to get .bin file generation back in future CubeMX versions?

Khouloud GARSI
Lead II
Posted on July 04, 2018 at 11:57

Hi Alex,

I have reported this internally for further check. One of our experts will answer you ASAP.

Thanks for your feedback!

Khouloud.

Nawres GHARBI
ST Employee
Posted on July 05, 2018 at 12:44

Hi Alex, 

All ST Projects embed the .hex and CubeMX has been aligned in the 4.26.0 

Is there any special need to have the .bin ?
Posted on July 08, 2018 at 06:30

Hi Nawres,

We burn .bin this file to device flash memory, both when device is produced, and making the firmware update at client sites. Is there another option?