[STM32 Nucleo-F401RE] HELP! BlinkLED

When I do “Blink LED” by writing bellow code on “STM32 Nucleo-F401RE”, it moved the bellow video.
I don’t know why it moves like that.
As a side note, my another same NucleoF401RE moved as a same behavior. On the other side STM32 Nucleo F411RE moved correctly by the same code and circuit.
Please help me!

codes↓

#include "mbed.h"
DigitalOut redled(D2);
int main()
{
  while (1)
  {
    redled = 1;
    ThisThread::sleep_for(1s);
    redled = 0;
    ThisThread::sleep_for(1s);
  }
}

Video

Hello,

I would like to help, but I am not sure what I look on because the video is very short for me.
The code is nothing special, just 1s delay between states and seems to be OK.

BR, Jan

Hi
I run your program on Nucleo-F401RE with Mbed-os6.16.
I cannot see any problem.

1 Like

Hi,

I would suggest:

  • Check the STLink Virtual Comm Port (USB serial console) output whether you get any crash report
  • Update STLink firmware
    Nucleo Firmware - | Mbed

I had also this idea about MbedOS Crash report, but LED1 is on PA_5 (D13) and not on PA_10 (D2).

BR, Jan

Everyone,thank you for replies!
it solved.
I am embarrassed to tell you this but it was caused by the LED.
The LED was “Auto blink LED” that it blinks just by constant 3.3V.
I’M SORRY !

2 Likes