MBED studio and STM32L071 (non supported platform)

Hello,
I developed a complete program in MBED Studio and based on Bluepill board with MCU STM32F103C8 (128kB flash). Unfortunately, there was a requirement to use another low-power processor with RTC. In the end, it will be the STM32L071KBU6 processor, but unfortunately this type is not a supported platform in the MBED studio.
Is it possible to use MBED studio for this type as well? Can you please advise me how to set up an MBED studio for this type? (or if there are already ready configuration files, etc.)

Thank you very much for your help.

Hi

See STM32L0: add MCU_STM32L071xB support by jeromecoutant · Pull Request #15277 · ARMmbed/mbed-os · GitHub
and Add MCU_STM32L071xB · ARMmbed/stm32customtargets@14db266 · GitHub

I hope it helps

Regards,
Jerome

Dear Jerome,
thank you very much for your answer. Honestly, I’m not very wise about it - I got a bit further, but not yet to the finish line …

  • I updated MBED studio to the latest version 1.4.4
    including all tools:
    Tool Name Version Status
    ARM Compiler 6.16 up to date
    Clangd 12.0.2 up to date
    Example projects 1.10.1 update available
    GDB client 6-2017-q2-updateup to date
    Git 2.30.0 up to date
    Mbed Library Cache 1.10.0 up to date
    Python tools 0.6.0 up to date
    Debug Packs 1.1.0 up to date

  • I updated the MBED OS library to mbed-os6.15.1

  • I imported customtargets from Git into my project

Now I see in the Target menu a suitable type that I have chosen:

MCUs and custom targets
GENERIC_STM32L071KB

But if I try to build a program I get an error message:

argument -m / - mcu: GENERIC_STM32L071KB is not a supported MCU. Supported MCUs are:
ADV_WISE_1510, ADV_WISE_1570, ARCH_MAX,
ARCH_PRO, ARDUINO_NANO33BLE, ARM_CM3DS_MPS2,
ARM_MPS2_M0, ARM_MPS2_M0P, ARM_MPS2_M3,
ARM_MPS2_M4, ARM_MPS2_M7, ARM_MUSCA_B1,
ARM_MUSCA_S1, B_L4S5I_IOT01A, B_U585I_IOT02A, …

… long list of supported MCU, but my target is missing.

It looks that i am still doing something wrong.

Regards Lukas

Hi
2 quick comments to start:

I updated the MBED OS library to mbed-os6.15.1

Pull request that added STM32L071xB support is not yet in some release. You need to go on top of the master branch.

I imported customtargets from Git into my project

Please note there are 2 git branches in that repo.

Regards,
Jerome

Dear Jerome,
I’ve spent a few hours with it, but I’m still in the same place as before:

  • i have imported the GENERIC_TARGET from git.
    obrazek

  • the structure is visible in my project.

  • the Target is visible in menu
    obrazek

I also tried adding custom_target.json to root or changing the root address in the .mbed file, but all efforts ended in the same result:

obrazek

Looks like I’m still doing something wrong and the compiler can’t find my target that I imported and I want to use …

I’m sorry for maybe stupid questions, but I’m a complete beginner in this. So far, I have used MBED for many projects, but they were based on STM32F103, which is supported by default…

Regards Lukas

Hello,

you still have MbedOs6.13 in your project, try to update to master branch (not latest but the master), with custom_targets.json in root directory.

BR, Jan

Hello Jan,
i put the custom_targets.json into the root directory and updated the mbed-os to the master. The result is the same :frowning:

obrazek

obrazek

Could you try with MBED CLI and not MBED studio ?

I need to install the CLI and get to know it - I’ve never used it. I will let you know…

I tried that yesterday and it was working.
According to your second picture it seems you have the custom_targets.json in the root folder of Workspace and not in the root of your project, that means the file is out of your project.

  • the file icon is not alignment with files above
  • because it is sorted by name, then the file must be between CONTRIBUTING.md and main.cpp an not under

BR, Jan

Dear Jan,
thank you very much. Looks like I’m winning first prize - idiot of the month. I overlooked that the file isn’t really in the project …

I’ll have the first pieces of hardware available tomorrow, so I’ll test to see if all the peripherals are working.

Thanks again for the help.

BR Lukas

Hello Lukas,

it’s not such a tragedy, sometimes it happens…

Good luck

BR, Jan

Hello,
HW was late and I assembled a PCB over the weekend. The ST link connected without any problems and MBED studio also detected the connected target - the last good news.

But the test program (LED flashing only) did not start. I using STM32L071KB without external crystal and without external source CLK (no place) - so I want to use internal oscillator HSI.

I added the mbed_app.json file to the root to force the MCU to use HSI:
obrazek

Without success.
Next, based on the discussion in this thread

I have tried to add recommended code to system_clock.c, which is in
stm32customtargets/TARGET_STM32L0/TARGET_GENERIC_STM32L071KB

Again without success.

I have no idea where the problem is…

BR Lukas