10 years, 5 months ago.

Codesourcery 2013.11-24 and mbed-rtos library issue

Hi!

Today I run into the next problem: I was trying to run the multithreaded application, which uses mbed-rtos library. However, my app was hanging up every time, when it was trying to create Thread instance. I used codesourcery 2013.11-24 toolchain.

Please help! Thanks!

you might get faster help if you share your program. What does it mean "it hangs"? Fault? blocking loop?

posted by Martin Kojtal 04 Jun 2014

It just stucks when I try to use something from mbed-rtos library (found it out by toggling one of the LEDs with delays after every line of code). For instance this example application (https://mbed.org/users/mbed_official/code/rtos_basic/docs/209f4db62daf/main_8cpp_source.html) doesn't work if it is compiled with codesourcery:

Basic example showing the Thread API

#include "mbed.h"
#include "rtos.h"
 
DigitalOut led1(LED1);
DigitalOut led2(LED2);
 
void led2_thread(void const *args) {
    while (true) {
        led2 = !led2;
        Thread::wait(1000);
    }
}
 
int main() {
    //Thread thread(led2_thread);
    
    while (true) {
        led1 = !led1;
        Thread::wait(1500);
    }
}

P.S.: I use 32-bit codesourcery on 64-bit Ubuntu

posted by Aida Mynzhasova 04 Jun 2014
Be the first to answer this question.