Porting to 32L152CDISCOVERY (STM32L152RCT6)

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
alan5
Posts: 24
Joined: Mon Nov 11, 2013 5:06 pm
Has thanked: 1 time
Been thanked: 1 time

Porting to 32L152CDISCOVERY (STM32L152RCT6)

Post by alan5 »

Hi guys,

For a Uni project I'll be using a 32L152CDISCOVERY which is the discovery board for the STM32L152RCT6. I believe this is intended to be the replacement for the previous model, the STM32L-DISCOVERY. Its a few pennies more and comes equipped with 256KB/32KB Flash/RAM.

I was interested in using ChibiOS and was hoping for some advice on porting this (unless anyone has already done it :P) I'm thinking this shouldn't be too bad with being devices coming from the same family... I'm assuming that for the most part the only difference is going to be the increased memory size? I'm not too familiar with the code base yet, but after looking at http://www.chibios.org/dokuwiki/doku.php?id=chibios:guides:port_guide, I think the main things I need to change are:

• Board files
â—‹ ./boards/ST_STM32L_DISCOVERY to
â—‹ ./boards/ST_${BOARD}

• Linker script
â—‹ ./os/ports/GCC/ARMCMx/STM32L1xx/ld/STM32L152xB.ld to
â—‹ ./os/ports/GCC/ARMCMx/STM32L1xx/ld/${MCU}.ld

• Demo.
â—‹ ./demos/ARMCM3-STM32L152-DISCOVERY to
â—‹ ./demos/ARMCM3-${BOARD}

Where
• BOARD=32L152CDISCOVERY or similar
• MCU=STM32L152xC.ld

I was wondering if anyone had any thoughts/advice that might point out my naivety before I start? Currently I'm looking through bits and pieces of documentation. For example wrt the linker script (something I'm rather unfamiliar with) I'm thinking it should just be a memory len change? I'm expecting the majority of this just to be a copy, paste and rename job...

BTW: I've currently been following the 2.6 branch on Github, and I'll be using GCC for development :)
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Porting to 32L152CDISCOVERY (STM32L152RCT6)

Post by Giovanni »

Hi,

Basically the steps you described are exactly what you need to do, changes to the linker script are just the memory lengths as you guessed. If the board design is exactly the same then the board files should be equal except for board names.

Post here in case of problems.

Giovanni
Post Reply