NUCLEO-L412KC support

Hi ST members,
NUCLEO-L412KC seems not supported by Mbed Studio: do you plan to support it soon?
I suppose porting from NUCLEO-L432KC should be quite easy.
Thank you.

Hi
Yes, it should be easy starting from

I will be pleased to review your coming pull request for NUCLEO-L412KB support :slight_smile:
Thx

Jerome

Thank you Jerome for your kind reply.

Hi Jerome,
your effort to support STM32L412 seems stuck for a license statement “issue” (SPDX) on a startup .S file. Do you know if the problem could be easily fixed?
I’d like to start as soon as possible a new project using NUCLEO-L412KC .
Thank you very much for you support.
Kind regards.

Hi
PR is now merged, I will be pleased to review NUCLEO-L412KC support PR :slight_smile:

Hi,
even after merging STM32L412 support on git master, it seems Mbed Studio doesn’t support NUCLEO-L412KB.
Do you know how to use NUCLEO-L412KB using Mbed Studio?
Thank you in advance for your reply.


Hello,

you asked about support of Nucleo-L412KB by Mbed Studio, but the target must be first ported to MbedOS and that is not done.
From my point of view, Jerome added only the necessary files for L412xB MCUs and that is not all what must be done.

  • Currently there is missing a folder for Nucleo-L412KB and its files - PeripheralPins.c, PinNames.h. Must look alike Nucleo-L432KC.
  • Although the targets.json file contains MCU_STM32L412xB (it was added in the PR above), it does not contain Nucleo-L412KB as target. As example we can again use Nucleo-L432KC.

BR, Jan

Hi Jan,
now “the picture” is more clear to me.
I will study the porting process documentation, but, in the meantime, I will ask again STMicroelectronics community members if they plan to support their NUCLEO-L412KB board.
Thank you for you support.
Kind regards.

Hi,
I’m trying to port NUCLEO-L412KB on my local disk just to make a preliminary test.

  • Add the new board to targets.json
    "NUCLEO_L412KB": {
        "inherits": [
            "MCU_STM32L412xB"
        ],
        "detect_code": [
            "0770"
        ],
        "device_name": "STM32L412KBUx"
    },

Question: from where I get the right “detect_code” value?

  • Create a folder TARGET_NUCLEO_L412KB under TARGET_STM32L412xB.
  • Copy the content of TARGET_NUCLEO_L432KC to TARGET_NUCLEO_L412KB.
  • Make changes to CMakeList.txt:
# Copyright (c) 2021 ARM Limited. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

add_library(mbed-nucleo-l412kb INTERFACE)

target_sources(mbed-nucleo-l412kb
    INTERFACE
        PeripheralPins.c
)

target_include_directories(mbed-nucleo-l412kb
    INTERFACE
        .
)

target_link_libraries(mbed-nucleo-l412kb INTERFACE mbed-stm32l412xb)
  • Make changes to PeripheralPins.c to remove peripherals not supported on STM32L412 (i.e. DAC, CAN, etc.)
  • No changes to PinNames.h
  • Added system_clock.c to TARGET_STM32L412xB (copied from TARGET_STM32L432xC) and removed line 260 due to a compiler error:
//    RCC_OscInitStruct.PLL.PLLP            = 7;    /* 45 MHz */

Now Mbed Studio “sees” the new board.
When I compile my application using NUCLEO-L412KB target, I see the following messages:

Configuration error: Bootloader not supported on this target. ROM start not found in targets.json.
Configuration error: Bootloader not supported on this target. RAM start not found in targets.json.

The compiler completes without errors.

After successfully flashing the board, it runs for a while but it resets (WDT reset) after few seconds…
The same application runs properly using NUCLEO-L432KC.
Do you have any idea about the issue? It could depend on something wrong on the porting?
Thank you in advance for your support.
KR

Giordano

— Update —
The issue is related to my application (RAM) and not to the porting!

I found this:

BR, Jan

Yes, detect_code is used for mbedls feature.

It is the 4 first digit in the code id of MBED.HTM file.
For NUCLEO_L412KB, it should be 0846.

You could add it in:

For pyOCD use, you could need to update:

Jerome

Hello,
thank you Jan & Jerome for your kind replies.

How to fix the bootloader messages?

Configuration error: Bootloader not supported on this target. ROM start not found in targets.json.
Configuration error: Bootloader not supported on this target. RAM start not found in targets.json.

Moreover, because of I don’t use git, I need your support to commit my changes to mbed-os repository. It is something I can do from Mbed Studio?
Thank you.
Kind regards.

Giordano

Hello,

first, I think that is not so big problem at the moment. I can successfully compile and run program on Nucleo-L152RE where this Conf error also occurs. How description try to tell you, it is for Bootloader feature I think.

You can also check out this topic- Custom board target WITHOUT bootloader - Custom and community boards - Arm Mbed OS support forum

BR, Jan

Hi

How to fix the bootloader messages?

In targets.json, you added:

"device_name": "STM32L412KBUx"

Unfortunately, this device is not really available there: :frowning:

You need to change to STM32L412KBTx (no impact for you!)

Hello Jerome,
your suggestion fix my configuration error: thank you.

Hello Jan,
thank you for your reply.

Kind regards.

Giordano