This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Crash while debugging the mqtt_simple example

Hello

I have a very strange behaviour with debugging the mqtt_simple example for the nRF9160. The example is crashing in debugg configuration. (This happens with Segger Studion 4.18 and 4.20).

Here is what I have done so far:

- I loaded the "mqtt_simple" project from the Nordic_SDK into Segger Studio, changed the MQTT settings to my toppics on mosquitto broker and than build the project.

- after downloading and running the example on the DevKit, everything works fine: it establishes the LTE connection (takes some minutes) and connects to the MQTT broker and subscribes to the configured topic

(Screenshot from LTE Link Monitor)

What I can not do with the default configuration is debugging. This because of the per default enabled code optimization (nearly not possible to set break point, wild jumping to code lines while executing single steps etc). As I learned here one can disable the optimization by adding CONFIG_NO_OPTIMIZATIONS=y to the prj.conf file.

But this change had a very strange effect: On one side, now it seams to be possible to debug every line of code BUT the mqtt_simple example crashes everytime with code optimization disabled!

Here is what happend: Initialisation of the modem takes no time (normally it would take some minutes), and it says "LTE Link Connected". But this is not true. At that time, no LTE connection is established. After that, the example crashes - everytime!

This only occures with code optimization disabled (CONFIG_NO_OPTIMIZATIONS=y).

Has anybody an idea what could cause this behaviour?

Regards

ExAg

Related