Skip to main content
GTull
Associate
March 2, 2019
Question

[Solved ]TrueStudio does not create an .elf file.

  • March 2, 2019
  • 2 replies
  • 2299 views

Hi

I started learning Stm32 and got a problem: when compiling a project, TrueStudio does not create an .elf file.

Console log:

12:26:17 **** Incremental Build of configuration Debug for project STM32100B-EVAL_GPIO_IOToggle ****

Info: Internal Builder is used for build

arm-atollic-eabi-gcc -c ..\Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_flash.c -mthumb -mcpu=cortex-m3 -std=gnu11 -DUSE_STM32100B_EVAL -DSTM32F10X_MD_VL -DUSE_STDPERIPH_DRIVER -I../src -I../Libraries/STM32F10x_StdPeriph_Driver/inc -I../Libraries/CMSIS/Device/ST/STM32F10x/Include -I../Libraries/CMSIS/Include -I../Utilities/STM32_EVAL/Common -I../Utilities/STM32_EVAL/STM32100B_EVAL -O0 -ffunction-sections -fdata-sections -g -fstack-usage -Wall -specs=nano.specs -o Libraries\STM32F10x_StdPeriph_Driver\src\stm32f10x_flash.o

12:26:21 Build Finished (took 3s.875ms)

There are no errors in the “Problems�? window.

I tried several projects including downloaded from the TrueStudio repository. The result is the same. I used TrueStudio 8.0 and 9.3 with "out-of-box" settings.

What can I do?

This topic has been closed for replies.

2 replies

MEder
Associate III
March 3, 2019

I had a problem with no elf file for a release build and I used the following:

​This was gleamed from a touchGFX project that a ST employee posted. 

Create a bat file with...

arm-atollic-eabi-objcopy --remove-section=ExtFlashSection %1.elf intflash.elf

arm-atollic-eabi-objcopy -O binary intflash.elf intflash.bin

arm-atollic-eabi-objcopy -O binary --only-section=ExtFlashSection %1.elf extflash.bin

Then add the bat file to your build configuration (release)

Add the directory/file name of the hex file  to the command line. Then when you build the release, the elf file is created.

It will create the intflash and extflash elf file for programming.

If you don't need the extflash section then you can ignore it.

Good luck

GTull
GTullAuthor
Associate
March 3, 2019

I didnt understand how to do these. I can only create a bat-file on the disk by external text editor.

>>Then add the bat file to your build configuration (release)

In which section of the project settings it should be done?

-Add the directory/file name of the hex file  to the command line. Then when you build the release, the elf file is created.

PS Now after build only files .su appear.

MEder
Associate III
March 3, 2019

If you get a s record then maybe Convert is checked in the Output Format section?

Anyway PostBuild settings are in C/C++ Build->Settings, Build Steps Tab.

My bat file is in the project directory. Your directory names will be different.

There's somewhat of a learning curve to use these tools.

0690X000006DytOQAS.png

0690X000006DysVQAS.png

MBake.3
Visitor II
March 15, 2021

The problem for me was that the error only shows up in the console and not under problems.