Mbed os 6.0 not working on STM32

I’m having some trouble getting Mbed OS 6.0 running on my STM32F767 chip, while when I’m using Mbed OS 5.0 it seems to be working fine for the same code, which simply just toggles a pin with a led connected to it:
Screenshot 2023-04-14 at 13.55.10

When debugging the application it seems to hang after this part:
Screenshot 2023-04-14 at 13.56.00

I’ve tried numerous releases of version 6 of Mbed, but none seem to work. This while all version 5 releases of Mbed do seem to work on my board.

Hello,

please be more specific with description of your hardware, environment and the issue (errors) you faced.
I am using Nucleo-F767ZI with MbedOS 6+ for years without significant problems.

BR, Jan

I’m publishing the code I specified in the topic start to upload to the STM32 chip (not nucleo board, but just the STM32F767 chip soldered on a custom board). When publishing the program with these settings:

everything works as expected and the led turns on. But when commenting out the last line (which results in the newest available version of MBED os being used, so 6.xxxx), the led doesn’t turn on anymore and the program doesn’t seem to run at all.

So this is kinda where I’m at a loss…

but this maybe a problem with platformIO. Have you tried the online Compiler or the Mbed CLI? That is the official way to compile Mbed code.

Yes I have tried it using the online compiler and CLI. But uploading does not work with these tools, because I don’t have an STLink and use a J-link lite to upload code to the board, which again works perfectly for Mbed os 5.x but not for Mbed os 6.x.

There seems to be some improvement when using the bare metal version of Mbed os 6.x, as running this code does actually turn on the led. But I don’t get this, since the STM32F767 chip should be able to support the full version of Mbed with RTOS.

After finaly setting the correct UART pins, I received some additional error information:

The last line of the MbedOS crash report seems to be important, I believe it is about LowPowerTicker

For test you can try to disable it via Mbed_app.json, just add

        "device_has_remove": [
            "LPTICKER"
        ]

BR, Jan

I finally got the problem resolved!

I fixed the problem by adding the following line to the mbed_app.json:
"target.macros_remove": ["MBED_TICKLESS"]

This solution also worked like a charm!

Thanks!

Let me ask. Do you have a LSE on your custom board? For example Mbed needs change some setting according to your hardware and LSI can be used instead.

BR, Jan

I think also it is something with the clock configuration that is maybe different in OS 5 and 6.

You say you don’t have a STLink, but the Nucleo has it onboard. Are you using a custom hardware? The Nucleo boards do supply the clock from the STLink to the main MCU. So the default config is to use external XTAL and this not correct when you have a crystal on your hardware. It is possible that your hardware is running with internal RC clock.