6 years, 4 months ago.

OS get stuck in us_ticker_read

Hi,

I'm trying to build a working project within eclipse cdt. I got my project building and linking properly but I ran into a runtime bug..

What I've done so far is :

  • Download mbed-os 5.4.7
  • Build it as a library.
  • Download the latest libmDot library.
  • Import everything into eclipse, let eclipse know where everything is. Import all the compilation flags from the build log of the mbed os library into eclipse. Set the correct link flags (checking with the same log).
  • Got the project to build and link. Set up the debug configuration with openocd and gdb (within eclipse).

Here comes the problem : First the instruction plan = new lora::ChannelPlan_EU868(); throws the following error : mbed assertation failed: interrupts_disabled, file: ./platform/mbed_critical.c, line 57

After some research, I found this issue https://github.com/ARMmbed/mbed-os/issues/3115 and I tried to add the MBED_CONF_RTOS_PRESENT flag into my eclipse project.

And now any wait instruction (for example into the dot = mDot::getInstance(plan); line) makes the os stuck into the us_ticker_read() function.

Btw my target is the mts_mdot_f411re.

Do someone have a hint about what I'm forgetting ?

Thanks

Colin.

Question relating to:

MultiTech's official mbed team.

1 Answer

6 years, 4 months ago.

If you're getting "mbed assertation failed: interrupts_disabled", then that's a sign that something during startup didn't go well. Maybe the device is stuck in a critical section. A quick workaround (to make sure everything is set up correctly) is to set the project up using Mbed CLI, and then export to Eclipse.

$ mbed import https://os.mbed.com/teams/MultiTech/code/Dot-Examples
$ cd Dot-Examples
$ mbed add https://os.mbed.com/teams/MultiTech/code/libmDot-mbed5/
$ cd mbed-os
$ git checkout mbed-os-5.4.7
$ cd ..
$ mbed export -m MTS_MDOT_F411RE -i eclipse_gcc_arm

(You can also do this from the online compiler).

Hi Jan, and thank you for your answer.

The problem is that the target MTS_MDOT_F411RE is not supported by eclipse_gcc_arm.

I already got the project running on the target only using mbed_cli tools. But to make things easier in eclipse I built it in the form of a static lib before importing it, using :

compile command

mbed compile -c -D_GLIBCXX_USE_CXX11_ABI=0 --library --profile ./mbed_os/tools/profiles/debug.json

Maybe something is missing when I am doing it this way.

PS: the _GLIBCXX_USE_CXX11_ABI=0 flag is necessary to be compliant with a third party lib I have to use. I don't know if this could disturb anything ?

Colin

posted by Colin Calas 01 Dec 2017

Shouldn't disturb anything... How I do it personally is to just setup Eclipse myself (by calling mbed compile --profile=debug in the build tab, and setting up OpenOCD in debug tab), or using make_gcc_arm exporter and then importing project with existing makefile in Eclipse. Maybe that works. I don't have an mDot at hand to test...

posted by Jan Jongboom 06 Dec 2017

If you dont create a static library but just dump the objects in your eclipse project, does the same assert happen? If not this would seem to be a weak reference getting lost in the link step due to being buried in the archive.

posted by Sam Grove 12 Dec 2017