4 years, 7 months ago.

Why does MBED rtos start fail on LPC4088 (config issue?)?

Hi, I face the problem that MBED rtos starts fails if I omit defining an (from application perspective: not used) EthernetInterface instance. I assume some configuration issue but failed to find the root cause.

I am using MBED-OS 5.13 (but same occured with 5.11) on an LPC4088 and gcc-arm-none-eabi-8-2019-q3-update. Compilation is done cia cmake and a corresponding CMakeLists.txt file (called when using Eclipse CDT). I do not use mbed-cli.

When analyzing it turned out that the issue becames visisble in function MBED_NORETURN void mbed_rtos_start() located in the file mbed_rtos_rtx.c (/media/uploads/cdelfs/mbed_rtos_rtx.c) Creating the thread mbed_start in line 64 apparently succeeds as the result is not NULL. Nevertheless, debugging showed that the thread mbed_start is never entered - and as consequence main() will not be called. The following osKernelStart() operation returns and the MBED_ERROR instructions are executed ("Failed to start RTOS").

As an example I created a little program main.cpp (/media/uploads/cdelfs/main.cpp) which redirects the mbed_error() call in mbed_rtos_rtx.c to main.c code (just for simplicity, otherwise breakpoints have to be placed in mbed_rtos_rtx.c ).

The linker operation succeeds regardless of whether I have the definition of the EthernetInterface instance in line 33 (main.cpp) or not. But the execution either leads to a blinking LED (success) or the re-defined mbed_error function gets called (failure), depending on whether EthernetInterface is instantiated or not. The test program uses the same configuration as the bigger application where the error first occured.

My assumption is that some MBED configuration is wrong. But, even if this is the case, I am wondering why both variants of main.cpp can be compiled and linked without an error. The whole MBED configuration is taken from an earlier test program (which I do not have any longer :-() from 2017 which was - as far as I remember - a simple Ethernet application using threads. Since then the CMakeLists.txt file evolved and I made some adaptations to allow FLASH write operations (not needed of course for the tailored test program).

Hoping that it helps I included the mbed_config.h and CMakeLists.txt (renamed to .c, as upload rejects .txt files) : /media/uploads/cdelfs/cmakelists.txt.c and /media/uploads/cdelfs/mbed_config.h

Help is highly appreciated! Many thanks in advance!

Be the first to answer this question.