Page 1 of 1

Porting to 32L152CDISCOVERY (STM32L152RCT6)

Posted: Tue Nov 12, 2013 5:36 pm
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 :)

Re: Porting to 32L152CDISCOVERY (STM32L152RCT6)

Posted: Tue Nov 12, 2013 7:57 pm
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