NUCLEO-F446RE under Mbed 6.2.0 freeze


I have an Mbed-OS 6.2.0 program on a NUCLEO-F446RE which stops after an indefinite time (between 15mn and 1 hour approximately). This program has a while (1) loop in the main and a watchdog, yet it doesn’t even restart, it’s frozen. There is an LED on a PWM output that is normally always on or flashing but at this time it goes out.
This NUCLEO-F446RE is connected to an electronic assembly. I ran a simple blink program for 3 hours to see if this was caused by this setup, in which case it doesn’t stop.

If you have any idea where the problem is? I’ll take it.

Hi @marcusbaslerus,

@MarceloSalazar @donatien Do you have any idea on what may be causing this issue?
One difference I can think of is that Studio by default opens a serial monitor connection when the board is connected. I recommend closing the serial panel for the connected board (it will close serial connection).

Arek - Mbed Studio team

thank you for your reply

I therefore understand that the serial connection could cause a Nucleo to freeze.
But my program uses serial communication via USB to communicate with a LabView program, for that I close the serial panel of Mbed Studio.
I had already had a freezing problem which ended up resolving it without my understanding why.
I also had a recurring problem (every 30 minutes) of interrupted serial communication via USB between the Nucleo and LabView under Windows 10 that I was able to solve by deactivating the “USB MSD” which concerns the Nucleo (to find: open the Windows 10 peripheral manager - USB bus controller - USB mass storage device) (see: Nucelo L432KC freeze). But I need the USB MSD as long as I am developing the program.
I would do a test by disabling USB MSD and letting the Nucleo run for a few hours.


I tested by disabling the “USB MSD”: The Nucleo-F446RE worked for 5 hours.
What bothers me is that I would like to understand how to improve the program so that it does not freeze. I suppose you have to look for the setting of the USB serial link. I am currently using the “BufferedSerial” instruction, I had also tried the “UnbufferedSerial” instruction, in both cases I have the Nucleo which can freeze.

Hi Marc,

Just for clarity, are you using the serial link connected to the DAPLink chip (itself connected over USB) and you have a you’re using Mbed’s USBMSD as well? Could you share a simple program that displays the issue?

Kind regards,


Hello Marc,

maybe I am wrong but when the problem was solved by disabling of the USB MSD functionality which is provided by the ST-link then the issue can not be on the Mbed side, I think. That seems be some an issue between Windows10 and ST’s drivers for ST-Link.
Did you tried to update ST-Link drivers and firmware?

You also wrote about it not appear with the blinky example. That looks like the problem appears only with any serial communication through the ST-Link. So the VCP driver.

You didn’t show us the code, but of course, if your program is based on serial communication with the PC and the communication will stop, then also the board will stop of course.

I do not know what exactly you have connected to your Nucleo board but theoretically you can try two other options:

That will provide you a serial communication without the ST-Link and also you can normally use ST-link for debug and programing without another setting in the future…

BR, Jan

To answer Donatien:
Thank you for your answer.
The serial link goes through the original NUCLEO USB connector and therefore through the ST-Link chip. I don’t know if there is a link with DAPLink? I saw that DAPLink allows debugging, I have no experience in debugging on a microcontroller (it is certainly wrong).
I use the USBMSD as long as I need to expand, then in use I will be able to disable it.
I did not do a simple program that causes the fault, I tried the program on another target (L432KC) by re-assigning I / O when possible and neutralizing another. the result is that this target operated for a full day.

To answer Jan:
Thank you for your answer.
According to an answer I had already had on Nucelo L432KC freeze the management of serial ports in Windows 10 is at issue:

I could understand that the reboot program (by what I’m using a watchdog), but why is it freezing? Is it a fault generated by the ST-Link chip that stops the microcontroller?

At the moment I don’t think of using another serial link instead. As I have already written during the use phase I will be able to deactivate the USB MSD bu thanks for this idea.