6 years ago.

blinky not working on NUCLEO F091 with mbed os 5

The “simple mbed blinky program” does not work on the NUCLEO-F091RC when using latest mbed-os-5.10.4 . The problem occurs when using the wait function. The program compiles but when flashed the delay is not working and halts the microcontroller. This problem occurs with all possible mbed wait functions. The problem seems similar to an earlier “bug” #1494 for and older version of mbed, maybe it is the same problem again.

/* mbed Microcontroller Library
 * Copyright (c) 2018 ARM Limited
 * SPDX-License-Identifier: Apache-2.0
 */
#include "mbed.h"
#include "stats_report.h"
DigitalOut led1(LED1);
int main()
{
   // SystemReport sys_state(500 /* Loop delay time in ms */);
    while (true) {
        led1 = !led1;
        wait(0.5f); // osDelay(500);     
        //sys_state.report_state();
    }
}

When I leave the wait function commented, the program runs and I can slow the program down with:

       for(int i = 0 ; i<10000;i++){
           printf("%i\r\n",i);
       }

So I’m pretty sure my toolchain is configured correctly and there might be something wrong with the libraries.

I was able to get this "error report" from the "serial monitor (putty)" when I discovered the problem with the wait function when I was using a different program. But the problem is already visible by running the blinky program.

-- MbedOS Error Info --

++ MbedOS Error Info ++Error Status: 0x80020125 Code: 293 Module: 2
Error Message: CMSIS-RTOS error: Stack overflow
Location: 0x8003DFF
Error Value: 0x1
Current Thread: Id: 0x20001010 Entry: 0x8003DC9 StackSize: 0x200 StackMem: 0x20001098 SP: 0x20007EB0
For more info, visit: https://armmbed.github.io/mbedos-error/?error=0x80020125
-- MbedOS Error Info --

I opened an issue at github already https://github.com/ARMmbed/mbed-os/issues/9106

Be the first to answer this question.