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

wait not working on 401RE

07 May 2014

The examples that use the wait function aren't working on the 401RE. I got them to work by changing all the wait calls to wait_ms.

07 May 2014

Hello there, I can confirm this issue and I solved it the same way ... :)

07 May 2014

Hello,

can you share a link to an example which can show this issue? I would like to test it first in the offline version and then in the online compiler. What does it mean it does not working? It does not execute, compile error?

Regards,
0xc0170

07 May 2014

Compilation in the online compiler ok, it generates a Nucleo_r.bin file When I copy the file to the USB storage and press the RESET button, the program is expected to run, so pressing the USER button should toggle the LD2 LED, but doesn't. changing to the wait_ms() function and commenting the wait() function, the program behaves as expected. Hope this helps to find the bug.

sample code

#include "mbed.h"
 
DigitalIn mybutton(USER_BUTTON);
DigitalOut myled(LED1);
 
int main() {
  while(1) {
    if (mybutton == 0) { // Button is pressed
      myled = !myled; // Toggle the LED state
      //wait_ms(200); // 200 ms
      wait(0.2); // 200 ms
    }
  }
}
 
07 May 2014

I have had the same problem. I had a project that I compiled offline using emblocks. It was calling the wait(0.2) and worked fine. The same project compiled online did not work until I modified it to call wait_ms(200).

07 May 2014

Hello,

I have the same problem. I've just exported "Blinky" to Keil 5.1 and tried to run it on 401RE, but it hangs on "wait" function. Even "wait_ms" and changing "Floating Point Hardware=Not Used" (as advised in another thread) didn't help.

Regards, Kijes

07 May 2014

I solved the problem for me this way:

right click on the "mbed" library in the Program Workspace in the online compiler window and click update.

08 May 2014

I can confirm this, after updating the mbed library the wait() function works as expected. (update was from rev 78 to rev 83)

08 May 2014

The FPU should be used in the library and also in project settings at the moment, so that was a problem. There was most probably a mismatch somewhere .

Thank you guys for reporting!

Regards,
0xc0179

08 May 2014

When you try to use mbed_src lib you got this error message:

Warning: Function "SetSysClock" declared implicitly in "mbed-src/targets/hal/TARGET_STM/TARGET_NUCLEO_F401RE/sleep.c", Line: 48, Col: 5 Error: Undefined symbol SetSysClock (referred from sleep.c.NUCLEO_F401RE.o).

A Addition: wait_ms works with mbed.lib but with mbed_src.lib I got the error above..

10 May 2014

after 2 hour finding why led was not blinking your thread helped me. now working by using wait_ms