How to add SPL Framework to Nucleo L152RE board?

Hi, when I was developing embedded software on Keil uVision, I wrote some libraries based on spl. But on the PlatformIO IDE, this board (Nucleo L152RE) only has the mbed framework. So I would like to know, how can I add the spl framework to this board.

Hi @FPablo!

SPL library doesn’t have support for new ST MCUs, but it’s possible in theory. Our SPL package contains source files for L1 family, so you just need to find the closest relative MCU to STM32L152RET6 and create a custom board. As an example, you can take config for disco-l152rb:

    "disco_l152rb": {
        "build": {
            "core": "stm32",
            "extra_flags": "-DSTM32L1 -DSTM32L152xB -DSTM32L1XX_MD",
            "f_cpu": "32000000L",
            "ldscript": "stm32l15xx6.ld",
            "cpu": "cortex-m3",
            "mcu": "stm32l152rbt6",
            "variant": "stm32l152xb"
        "frameworks": ["cmsis", "spl", "libopencm3"],
        "name": "ST Nucleo L152RE with SPL",
        "platform": "ststm32",
        "upload": {
            "maximum_ram_size": 16384,
            "maximum_size": 131072,
            "protocol": "stlink"
        "url": "http://url",
        "vendor": "ST"
1 Like

Thanks for the quick reply, I will try it.