How to debug lwm2m_client sample on Thingy91 development kit?

Our company is in the process of developing a new IoT product for LTE-M and NB-IoT. The sample application lwm2m_client runs fine on our devkits nRF9151DK & Thingy91 and connects fine with Leshan, AVSystems and nRFCloud. UART console of both devkits show a lot of shell outputs. So far so good.
Past days I had to debug an issue but depending on some conditions I didn't know some times I could easily SWD debug and sometimes not. In the end I found this out:

  • nRF9151DK both standard builds and debug-build configs run just fine on those boards, UART output is correct.
  • Thingy:91 (nRF9160):
    • standard builds work both via MCUBoot-Update and via SWD debugger. In the debugger I can single step and run and the app run fine.
    • debug builds for the Thingy/nRF9160ns target (-Og, -DCONFIG_DEBUG_THREAD_INFO=y) dont work, dont show UART outputs, even the blinky sample is doing nothing
    • debug builds for the Thingy/nRF9160 target (no ns, -Og, -DCONFIG_DEBUG_THREAD_INFO=y) work, show UART outputs, but this is only valid for very simple MCU-like applications. Using the no-ns build target is preventing applications which require the LTE modem (TP-M)

Currently I'm out of ideas how I can debug an application using the LTE modem on the Thingy91 platform. Whats the supposed way to go in May 2025?

Parents Reply
  • Hi, 

    Do you use VS Code for building and flashing? Do you see the same behavior if you do not use VS Code?

    Do you see the same problem if you do not use "Optimize for debugging (-Og)" but instead add both
    -DCONFIG_DEBUG_THREAD_INFO=y and -DCONFIG_DEBUG_OPTIMIZATIONS=y
    to your build command manually?

    Do you see the same result when using only -DCONFIG_DEBUG_THREAD_INFO=y (without optimization)?

    Best regards,
    Dejan

Children
Related