Custom STM32L0 Board with bare-metal profile: No linker script found

Hello Everyone,

I am trying to get NUCLEO-L011K4 working with mbed-os 6 with bare-metal profile.
This Board was supported some versions ago. So I created a new custom board as described in the docs. You can see the Directory structure here:

Most of the files are copies of the implementation in the earlier mbed-os versions and from ST.
Also the entry in custom_targets.json is a modified copy from earlier mbed-os:

When i try to compile the baremetal blinky example it works up to 100% but the linking is not working. I am getting “No linker script found

Any suggestions what i missed?

Hi
As a first quick review, I can suggest few tests in the json file:

  • inherit: use MCU_STM32_BAREMETAL
  • supported_toolchains: remove line
  • default_toolchain: remove line
  • default_lib: remove line
  • release_versions: remove line

Again No linker script found

Hello Wenzel,

As far as I can remember programs created for this target with the online compiler in the past could be exported only for the uARM toolchain, which is not supported by Mbed OS 6 (supported_toolchains).

Try to build your program with the GCC ARM compiler to check whether that one is usable.

Best regards, Zoltan

Hello Wenzel,

When reading the Mbed documentation about Using small C libraries in Mbed OS bare metal I found some info about Scatter file for Arm toolchain that could be useful.

Best regards, Zoltan

Hi thank you for the Link!

As you can read here Removal of ARM Compiler 5 and uARM toolchain | Mbed
ARMC6 should be able to replace uARM Toolchain

I was not able to compile the target with GCC. It seems not to be supported.

But as i wrote compilation with ARMC6 is complete and linking is not working.

I fixed it. There was another Directory in my Project with another linker script for backup reason. Somehow the build script found this one and throws the error.
After removing the directory, it is linking correctly and successful runs on the Board!

1 Like

Hi, which one directory it was? i’m faceing to same issue :confused:

Im also faceing this issue, can you please give the name of this file/folder ? thx

Hi,

i put my additional files on github: GitHub - pentabarf/mbed-L011K4: custom board files for STM32L011K4
you have to copy them to the root of your mbed project.
i think i modified them to my purpose, maybe you have to do some changes to PinNames.h

But keep in mind, that mbed-os - even the bare-metal configuration (which is enabled in this files) - will take a lot of your Flash and RAM and there is not much space for your application. Thats why i stopped development with mbed for this platform and swichted to stm32cubeIDE

Hi

Quick comment about mbed-L011K4/custom_targets.json at master · pentabarf/mbed-L011K4 · GitHub
there is no more “MCU_STM32_BAREMETAL”…

I think your setup should not be so different than NUCLEO_G031K8: