Page 1 of 1

STM32F103 linker files

Posted: Wed Jan 13, 2016 1:15 pm
by a.giacomolli
Hi

We're using STM32F103RCT6 in a project with ChibiOS. It is a high density device and uses STM32F103xC.ld linker script. This file is not provided with ChibiOS, so I would like to know which files I need to change in order to provide support to our hardware.

I started creating linker script with memory regions (256 kB flash; 48 kB SRAM) and changing stm32_registry.h to verify STM32F103xC macro definition. This define maps the device with STM32F10X_HD macro, enabling hardware peripherals in ChibiOS. However, the number of GPIOs in configuration file are not consistent with this device, that has only PA, PB and PC. So, how can I extend this file to support the device?

Anderson

Re: STM32F103 linker files

Posted: Wed Jan 13, 2016 1:20 pm
by Giovanni
Hi,

You just need to create the .ld file using the simple template. The registry entries only consider the largest package for any given subfamily, smaller packages only bring out less signals but the ports are still in silicon and may need initialization (put them all as input-pullup in board files).

In case the port is not physically in silicon then you would get an exception while trying to initialize the non-existing port but this should not be the case from past experience.

Giovanni

Re: STM32F103 linker files

Posted: Wed Jan 13, 2016 1:39 pm
by a.giacomolli
Hi

Fast reply :)

Thanks, Giovanni. It worked at first.

Anderson