4
\$\begingroup\$

I want to build code for my STM32F030F4 using arm-gcc-none-eabi. The STM32CubeF0 is already downloaded, and inside the repository, I found the location of the startup file.

However, I haven't found where the linker script is located. There is some internet tutorial explaining how to write the linker script, but I would like to use the official STM32 version.

Where can I find the file?

\$\endgroup\$
2
  • \$\begingroup\$ Have you searched for the file in all directories? \$\endgroup\$
    – Justme
    Commented Jan 17, 2023 at 0:32
  • \$\begingroup\$ yes, I did a "find -iname *ld | grep -i F030", but none of them are correspondent to my microcontroller. \$\endgroup\$
    – andre.hre
    Commented Jan 17, 2023 at 0:37

2 Answers 2

2
\$\begingroup\$

If you create an stm32cube project with this micro the linker command line and be found in the settings. Page 61 of the stmcube manual details the linker settings, which includes the command line that specifies the .ld file to be used: manual linker snip

https://www.st.com/resource/en/user_manual/um2609-stm32cubeide-user-guide-stmicroelectronics.pdf

\$\endgroup\$
2
  • 1
    \$\begingroup\$ But OP still needs that file to use it. And likely is not using CubeIDE, or not a project generated with CubeMX which would generate the linker script. \$\endgroup\$
    – Justme
    Commented Jan 17, 2023 at 5:30
  • \$\begingroup\$ @Justme I see that now. Op would have to create a project using the desired chip and then investigate the settings. Not the most straightforward option for sure. \$\endgroup\$
    – Bryan
    Commented Jan 17, 2023 at 5:50
1
\$\begingroup\$

ST linker scripts are almost identical between devices in the series. You can take this file and change the memory sizes to suit your device.

Alternatively, download STM32CubeMX, generate a project for your device and copy the linker script from there.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.