4 years, 6 months ago.

Nucleo: What am I doing wrong?

I am unable to get an ST-NucleoF401RE board working. A new board was delivered, and the example 'blinky' program worked. However, I cannot download a program from mbed and get it to work.

I have updated the firmware on the Nucleo board to V2.J23.M6 by running ST-LinkUpgrade.exe. I have also made sure the latest USB driver is installed, by running st-link_v2_usbdriver.exe. The nucleo board shows up as a drive in anexplorer window, and upon dragging a .bin file into this the green LED on the board flashes red which seems to indicate a file has been downloaded. BUT, upon resetting the board, the mbed program does not run.

For reference, here is the program I've tried downloading to the nucleo:

  1. include "mbed.h"

DigitalOut myled(LED1);

int main() { while(1) { myled = 1; LED is ON wait(0.2); 200 ms myled = 0; LED is OFF wait(1.0); 1 sec } }


Question relating to:

Affordable and flexible platform to ease prototyping using a STM32F401RET6 microcontroller.

I figured it out. The mbed version needed to be updated!

posted by Jim Cooke 11 Sep 2014
Comment on this question

7 Answers

4 years, 4 months ago.

I just bought an Nucleo F104RE board and upgraded STLINK firmware to V2.J23.M6. Also upgraded the V2 driver on windows 7.

I can see the Nucleo drive. /media/uploads/mrunmoy/nucleo_drive.png

I built a simple Hello, World code from online compiler. /media/uploads/mrunmoy/code.png

Saved the bin file in a directory. Copied the bin file into the Nucleo drive. When I go out of the drive and come back in, the file is gone! This happens everytime.

When I disconnect the USB cable and then reconnect it. I can't see the file.

Whatever code I downloaded into the drive, does not execute.

Although the Nucleo drive shows 512KB of 528KB full and the file I was copying was of 14KB. /media/uploads/mrunmoy/drivesize.png

What am I doing wrong? Doesn't Nucleo work like other mbed platforms? I have a LPC1768 and I just build and copy the bin file into the mbed drive. reset the board and it executes the binary! easy!

Do I need an IDE to run the code on Nucleo F401RE?

4 years, 4 months ago.

Your program should never compile successfully since the intended comments are no comments (missing doubleslash).

int main() { while(1) { myled = 1; LED is ON wait(0.2); 200 ms myled = 0; LED is OFF wait(1.0); 1 sec } }

4 years, 6 months ago.

Try to replace digitalout with fastout

4 years, 6 months ago.

I have had the same problem with Nucleo F401RE board when using example code imported from the import wizard.

After you have downloaded example code, make sure to point the mbed library in the project manager and click the update button on the rigth panel to use uptodate library.

4 years, 6 months ago.

Many times the first error that a lot of users have (me too) is that the wait() statement in "blinky programs" dont work properly, because the mbed platform dont provide an up-to-date (or automatic update) libraries in projects that are imported. First thing you probably do is to change the wait() for wait_ms() and its work but, the problem is that the mbed library is not updated and you may have more problems in the future.

Like Frederic said, you must rigth click the mbed library and press update button.

It seems that your problem go that way.

4 years, 6 months ago.

This happened to me too when I first got my Nucleo board; and I can confirm that by updating mbed library to the latest version fixed my problem.

4 weeks ago.

can we programme the board without using mbed.h header file.

No! Not on the Mbed compiler. Mbed.h is the starting point header file. And.... why would you not want to use mbed.h?

posted by Paul Staron 23 Feb 2019

To post an answer, please log in.