Mbed does not start

Hi,

First of all, sorry if this question is too basic, but I am new on mbed-os.

I have a mbed-os application compiled using mbed online compiler and running nicely in a Nucleo-L432KC.

In order to create my own device, I have designed my own PCB in order to avoid using the demo board. (I have tested a simple blink led on this PCB using STM32Cube and it works fine).

The issue is, when I flash the binary that is running fine on the Nucleo board on my PCB, it seems that the uC does nothing.

So, in order to check what is happening, I have tried to flash a simple mbed-os blink led, but again, nothing happens.

For flashing the binary I am using a ST_LINK V2 programmer and the binary is being flashed into 0x08000000 address.

My thoughts were that the oscillator was not being setup properly. But checking mbed code it seems to use MSI oscillator, so that should not be the issue.

Could anyone point me to the right direction to check what is going on? Do I need to flash the binary on any other address?

Below you can check how the uC is set up on the PCB.

Thank you vey much for your time!
Regards

Since the chip can program OK but doesn’t seem to execute code, it does smell like an oscillator related problem. The system_clock.c settings seem to use MSI by default, but looking at targets.json it assumes there is a LSE crystal connected. Try adding the below into your mbed_app.json to explicitly set the clock settings:

 "target_overrides": {
    "*": {
        "clock_source": "USE_PLL_MSI",
        "target.lse_available": 0
    }
}

Hi Jamie, indeed that was the issue! Thank you so much for your support!

just added the lines below and mbed booted fine.

“target_overrides”: {
“*”: {
“target.clock_source”: “USE_PLL_MSI”,
“target.lse_available”: 0,
}
}

However the 200ms blink timing is now around 468ms.
In order to fix this I tried using “target.clock_freq”: “80” but it did not work.
So I workaround it configuring the clock to 80MHz using STM32CubeMx given function and updating mbed clock using SystemCoreClockUpdate(); after that.
This seems to work fine, but I do not know if there is a better way to do it.

Really appreciate your help, thanks dude!

Best regards,