cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F030F4 with STM32Cube tools

SSkje.1
Associate II

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)

12 REPLIES 12
TDK
Guru

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

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
Associate II

IOC file is attached

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.

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

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

I just tested. I renamed the file into mk2, opened it in STM32CubeMX and hit generate code, and then "open folder"0693W000001t7ZHQAY.png

Yes I'm only relying on STM32CubeIDE as far as MX integrated.

According your snapshot you're right if MX standalone sounds you're lacking linker file ... quite weird. Which MX version are you relying on ?

Just in case looking in details at your snapshot ... could be issue the fact you'have set 0x000 as heap size ? I would guess such is preventing linker file generation ...

As specified in the initial post: STM32CubeMX: 5.6.1 (and yes, problem is generate project from MX, not import/create from inside the IDE itself)