Cmsis library for Nucleo f103rb

Hey,

I’m using platform IO for nucleo f103rb board. I work with CMSIS framework. I want the linker script and the startup.c for this board. Where exactly I can find it?

Per cmsis.py the linker script sourced from the tool-ldscript-ststm32 package (or generated from a template file if not found) and the startup file is used verbatim from framework-cmsis-stm32<series>.

So for a config like

[env:nucleo_f103rb]
platform = ststm32
board = nucleo_f103rb
framework = cmsis

that means

  • C:\Users\<user>\.platformio\packages\tool-ldscripts-ststm32\stm32f1\STM32F103RBHX_FLASH.ld is the used linker script
  • C:\Users\<user>\.platformio\packages\framework-cmsis-stm32f1\Source\Templates\gcc\startup_stm32f103xb.s

All of this information is also visible without any knowledge of the builder script by just building in verbose mode and looking at the paths of the compiled and linked in files. (project tasks → Advanced → Verbose Build).

arm-none-eabi-gcc -mthumb -mcpu=cortex-m3 -x assembler-with-cpp -DPLATFORMIO=60107 -DSTM32F103xB -DF_CPU=72000000L -IC:\Users\Max\.platformio\packages\framework-cmsis@2.50501.200527\CMSIS\Include -IC:\Users\Max\.platformio\packages\framework-cmsis-stm32f1\Include -c -o .pio\build\nucleo_f103rb\FrameworkCMSIS\gcc\startup_stm32f103xb.o C:\Users\Max\.platformio\packages\framework-cmsis-stm32f1\Source\Templates\gcc\startup_stm32f103xb.S
arm-none-eabi-gcc -o .pio\build\nucleo_f103rb\FrameworkCMSIS\system_stm32f1xx.o -c -Os -ffunction-sections -fdata-sections -Wall -mthumb -mcpu=cortex-m3 -DPLATFORMIO=60107 -DSTM32F103xB -DF_CPU=72000000L -IC:\Users\Max\.platformio\packages\framework-cmsis@2.50501.200527\CMSIS\Include -IC:\Users\Max\.platformio\packages\framework-cmsis-stm32f1\Include C:\Users\Max\.platformio\packages\framework-cmsis-stm32f1\Source\Templates\system_stm32f1xx.c
arm-none-eabi-gcc -o .pio\build\nucleo_f103rb\src\main.o -c -Os -ffunction-sections -fdata-sections -Wall -mthumb -mcpu=cortex-m3 -DPLATFORMIO=60107 -DSTM32F103xB -DF_CPU=72000000L -Iinclude -Isrc -IC:\Users\Max\.platformio\packages\framework-cmsis@2.50501.200527\CMSIS\Include -IC:\Users\Max\.platformio\packages\framework-cmsis-stm32f1\Include 
src\main.c
arm-none-eabi-gcc -o .pio\build\nucleo_f103rb\firmware.elf -T C:\Users\Max\.platformio\packages\tool-ldscripts-ststm32\stm32f1\STM32F103RBHX_FLASH.ld -Os -Wl,--gc-sections,--relax -mthumb -mcpu=cortex-m3 --specs=nano.specs --specs=nosys.specs .pio\build\nucleo_f103rb\FrameworkCMSIS\gcc\startup_stm32f103xb.o .pio\build\nucleo_f103rb\FrameworkCMSIS\system_stm32f1xx.o .pio\build\nucleo_f103rb\src\main.o -LC:\Users\Max\.platformio\platforms\ststm32\ldscripts -L.pio\build\nucleo_f103rb -Wl,--start-group -lc -lgcc -lm -lstdc++ -Wl,--end-group
1 Like

And just to be clear. You do not need to add these manually to the project, PlatformIO already adds them during the build process.

1 Like