Skip to main content
SSkje.1
Associate II
July 16, 2020
Question

STM32F030F4 with STM32Cube tools

Hi I used STM32CubeMX to create a new project for STM32F030F4 + STM32CubeIDE.

The project was created, but when I compile, all the data by default is mapped to address 0x00008000, just after the valid range of the flash mirror. How strange...

Problem one: The file STM32F030F3Px_FLASH.ld was never created in my project, so I found one online and put it into my project folder

Problem two: The linker argument builder is not able to resolve the ${workspace_loc:/${ProjName}/STM32F030F4PX_FLASH.ld} path, so no -T "c:\foo\bar\STM32F030F4PX_FLASH.ld" is added to the linker command-line.

Work-around for problem two:

Added under other flags for the linker: -T "${workspace_loc:/${ProjName}/STM32F030F4PX_FLASH.ld}" - The quatation marks are important, else \ for windows paths turns into escape characters...

Windows 10, English language, Norwegian locale

STM32CubeMX: 5.6.1

STM32CubeIDE: 1.3.1

com.st.stm32cube.ide.feature.mcu.linker.ui 1.3.0.202002181050

com.st.stm32cube.ide.feature.mcu.toolchain.arm_none 1.3.0.202002181050

(The missing linker script causes all kinds of funky errors when trying to load the resulting file with the different softwares for the hardware dongles)

This topic has been closed for replies.

12 replies

TDK
July 16, 2020

I just tried this. Linker file is generated just fine. Same OS and software versions as you (but English locale).

0693W000001t4YLQAY.png

Are you selecting STM32CubeIDE as the Toolchain/IDE? Share your IOC file.

"If you feel a post has answered your question, please click ""Accept as Solution""."
Cartu38 OpenDev
Graduate II
July 17, 2020

I agree linker file is part any project generation whatever from STM32CubeIDE or STM32CubeMX.

Root issue is at project generation ... @Community member​ please could you share more details about your project creation way of working ?

SSkje.1
SSkje.1Author
Associate II
July 17, 2020

Started STMCubeMX and configured my setup

  • external crystal
  • HSE with PLL up to max as clock source
  • Enable SWD
  • 6 x GPIO as outputs
  • Setting heap memory down to 0x000 bytes
  • STMCubeIDE as target toolchain, and generated the project into c:\users\stian\Documents\P107LED

Started STMCubeIDE that already had one project loaded, added project into the workspace by browsing the project file

Compiled project could not be loaded into STM32 MCU using any of the adapter settings (using a STM32-devel kit as SWD bridge to my actual board).

After some studying of the result .ELF file with arm-none-eabi-objdump, I saw that the entire .code and .data sections were mapped into 0x8000.

Then I noticed that there was no linker script in the project folder, so I added that manually

But it still was not used, no -T argument used for linking, so added the -T argument manually, and finally I had a working binary that does give assertions in openOCD or disconnect errors with STLINK tools.

SSkje.1
SSkje.1Author
Associate II
July 17, 2020

IOC file is attached

Cartu38 OpenDev
Graduate II
July 17, 2020

Got linker file without issue from your .ioc file (IDE 1.3.1)

0693W000001t7S1QAI.jpg

I've done my trial based on File > New > STM32 project from .ioc file

Project compiles without any issue

0693W000001t7SkQAI.jpg

SSkje.1
SSkje.1Author
Associate II
July 17, 2020

So you generated the project inside STMCubeIDE, not inside STMCubeMX?