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

App Crash if modem commands are issues on the main thread

I think that the related ticket to the problem that we have observed is:

https://devzone.nordicsemi.com/f/nordic-q-a/60850/nrf9160-secure-services-causing-a-crash

I have seen some info where this crash is being investigated, but I am not sure if solution exists in SDK 1.4.1. I see a workaround and I have not tried it as it seems to require changes to SPM, which I'm not familiar with.

If this is the same issue, we are reporting what we have observed...

Our original application would would make use of following AT commands:

  • Obtain time from modem with AT+CCLK?
  • Obtain modem IMEI with AT+CGSN=1

On button press, the app would make some https calls and establish an MQTT link to azure. After some time or on another button press, the application would disconnect MQTT and LTE. Another button press would repeat the cycle. The cycle would include obtaining modem time with  AT+CCLK? right after LTE link would be obtained. Application has no (k)threads.

The problem is that on a third cycle or so, the application would crash typically on HTTP requests or rarely during MQTT startup.

The application has a generous stack and heap allocation of 8K each. We have also tried tweaking various stack sizes and Kconfig settings per some posts that we have seen on the forums, but none of those seemed to help. The same behavior existed in SDK 1.3.0, 1.3.1 and 1.4.0.

We have since modified our code to make use of date_time and modem_info libraries provided by Nordic and the problem completely disappeared and the application is stable now.

I have posted this ticket in hopes that it would help reproduce and resolve this issue and in hopes that someone can review and determine whether this is the same problem and whether the same workaround applies.

Parents
  • Hi,

     

    The problem is that on a third cycle or so, the application would crash typically on HTTP requests or rarely during MQTT startup.

    The application has a generous stack and heap allocation of 8K each. We have also tried tweaking various stack sizes and Kconfig settings per some posts that we have seen on the forums, but none of those seemed to help. The same behavior existed in SDK 1.3.0, 1.3.1 and 1.4.0.

    We have since modified our code to make use of date_time and modem_info libraries provided by Nordic and the problem completely disappeared and the application is stable now.

    I have posted this ticket in hopes that it would help reproduce and resolve this issue and in hopes that someone can review and determine whether this is the same problem and whether the same workaround applies.

     It could be that the issue is related to the SPM stack size. Please see this thread on how to adjust that higher:

    https://devzone.nordicsemi.com/f/nordic-q-a/68395/nrf9160-sdk-1-4-crash-in-random-number-generation

     

    Do you have any details on what the fault previously were? Like a printout or stack trace?

     

    Kind regards,

    Håkon

Reply
  • Hi,

     

    The problem is that on a third cycle or so, the application would crash typically on HTTP requests or rarely during MQTT startup.

    The application has a generous stack and heap allocation of 8K each. We have also tried tweaking various stack sizes and Kconfig settings per some posts that we have seen on the forums, but none of those seemed to help. The same behavior existed in SDK 1.3.0, 1.3.1 and 1.4.0.

    We have since modified our code to make use of date_time and modem_info libraries provided by Nordic and the problem completely disappeared and the application is stable now.

    I have posted this ticket in hopes that it would help reproduce and resolve this issue and in hopes that someone can review and determine whether this is the same problem and whether the same workaround applies.

     It could be that the issue is related to the SPM stack size. Please see this thread on how to adjust that higher:

    https://devzone.nordicsemi.com/f/nordic-q-a/68395/nrf9160-sdk-1-4-crash-in-random-number-generation

     

    Do you have any details on what the fault previously were? Like a printout or stack trace?

     

    Kind regards,

    Håkon

Children
No Data
Related