8 years, 11 months ago.

Offline compile of RTOS application is failing silently – Ubuntu + GCC .

Folks I am not sure any one is tested this but I am having the following issue.

Platform : Nucleo L152RE Test Code :

#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(500);
    }
}

Test 1: Compiled on online and working as designed

Test 2: Compiled on offline on Ubuntu without any errors however LED is not blinking as expected.

Please refer Offline config details;

OS: Ubuntu 14.04.2 LTS

GCC Info:

levent@levent-Inspiron-3847:~/Projects/CAT_1/Nucleo_blink_led_test$ arm-none-eabi-gcc --version
arm-none-eabi-gcc (GNU Tools for ARM Embedded Processors) 4.9.3 20141119 (release) [ARM/embedded-4_9-branch revision 218278]
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Test 3: Standard Blinking Led project Compiled online and offline and worked as expected.

Question relating to:

1 Answer

8 years, 11 months ago.

I use Ubuntu and the gcc-arm with a 1768 (xubuntu 14.04 and gcc-arm-none-eabi-4_9-2015q1 using nanolib). This is running very fine .
I have no confidence in the RTOS implementation for a off-line compiler; I tested this one year ago with bad results and I prefer my own task scheduling.
Today I made some tests of your program with a Nucleo L152RE and with a Mbed1768.

Nucleo
A first remark is : this Nucleo has only one user LED. I replaced LED2 with a printf short message. The result is:
-ok with the online compiler
-not ok with the offline compiler (with some debug "printf" I found that the Thread::wait(500) does not return )
LPC1768
Here I use two leds. -ok online and offline

I hope this can help . My own conclusion is : the RTOS implementation is not reliable when you want to compile offline.

Accepted Answer

Hi Robert,

Thanks for the test and feedback. Then this can be a Nucleo HAL issue. I have some other boards I will run the same test there and put some results here, Really appreciated.

Levent

posted by Levent Sasmazel 25 May 2015

One more test with RTOS Current target platform is STM32L152RE. LED blinking program compiled under uVision 5.14 on Windows 8 is working without any issue.

posted by Levent Sasmazel 26 May 2015