Using code for the ST Nucleo L152RE on a different STM32L152 series board

24 Feb 2014

I would like to use mbed code with an Olimex STM32-H152 board. So both of these boards use the STM32L152 series, but they have different amounts of ram, pin outs, crystals...etc. I am looking for advice on which files I need to change in the "mbed/TARGET_NUCLEO_L152RE/" folder to make this happen.

I changed the TARGET_NUCLEO_L152RE/stm32l1xx.h for the correct target STM32L device (#define STM32L1XX_MD) and the HSE and LSE crystal speeds by default are already correct (8MHz & 32768). I also changed PinNames.h and PortNames.h to add the extra pins and port. But the board does not run.

If anyone has done this I would love to hear some tips...

My tools are linux, openocd & an ARM-USB-OCD jtag

24 Feb 2014

Hello,

just a reminder, look at mbed tools: http://mbed.org/handbook/mbed-tools

Are you working offline? Sources from git and building them?

As you noticed start with CMSIS folder for your target. Assuming you are running linux, so GCC is your choice. GCC ARM is not yet supported for example for L152RE, you have to create startup files (check other targets what files are needed). Once you have cmsis set, move to mbed HAL implementation for your target. Good start is with gpio, which is easy to implement and even faster to test.

Once you have it set, build your target using build.py script file.

Regards,
0xc0170

25 Feb 2014

Hello Martin,

1st i have seen the work you have done here at mbed (cc3000 & kl46z) its appreciated. I have used the cc3000 code myself but no projects yet. the cc3000 is just so expensive....

so i downloaded the git sources and learned a lot. i created the cmsis stuff, and successfully compiled with the gpio api. But when i tried to compile with the us_ticker i got errors. it turns out that just because both board use STM32L152 they don't have the same interrupts/hardware. i spent the better part of a day playing with the code and looking at how other people have created their specific us_ticker.c (surprisingly a lot of different ways).

I want to thank you for pointing me in the right direction to resolve my issue. Sadly i don't think it is worth my time just for 1 project when i can just make something with a lpc11u24 and have confidence that the all the api's (usb, etc) are going to work and i can focus on the code for my specific project.

once again thanks for for helping me out.