nrf5340 Sample Application hangs in Bootloader in Thingy91X

I am using  the Thingy91X kit, and I am trying to make a sample 'hello_main" to work on the nrf5340. My project configuration is as follows:

Sample:         zephyr/samples/hello_world

SDK:              3.4.0

Toolchain:      nRF Connect SDK Toolchain v3.4.0

Board Target: thingy91x/nrf5340/cpuapp, NordicKits

SysBuild:         No sysbuild

Problem: 

When I click debug, the application hangs in bootloader. What do I need to do to debug my application?

JLinkGDBServerCL: SEGGER J-Link GDB Server V9.24a Command Line Version
JLinkGDBServerCL:
JLinkGDBServerCL: JLinkARM.dll V9.24a (DLL compiled Mar 5 2026 11:00:44)
JLinkGDBServerCL:
JLinkGDBServerCL: -----GDB Server start settings-----
JLinkGDBServerCL: GDBInit file: none
JLinkGDBServerCL: GDB Server Listening port: 63103
JLinkGDBServerCL: SWO raw output listening port: 2332
JLinkGDBServerCL: Terminal I/O port: 2333
JLinkGDBServerCL: Accept remote connection: localhost only
JLinkGDBServerCL: Generate logfile: off
JLinkGDBServerCL: Verify download: off
JLinkGDBServerCL: Init regs on start: off
JLinkGDBServerCL: Silent mode: on
JLinkGDBServerCL: Single run mode: on
JLinkGDBServerCL: Target connection timeout: 0 ms
JLinkGDBServerCL: ------J-Link related settings------
JLinkGDBServerCL: J-Link Host interface: USB
JLinkGDBServerCL: J-Link script: none
JLinkGDBServerCL: J-Link settings file: none
JLinkGDBServerCL: ------Target related settings------
JLinkGDBServerCL: Target device: nrf5340_xxaa_app
JLinkGDBServerCL: Target device parameters: none
JLinkGDBServerCL: Target interface: SWD
JLinkGDBServerCL: Target interface speed: 4000kHz
JLinkGDBServerCL: Target endian: little
JLinkGDBServerCL:
=thread-group-added,id="i1"
=cmd-param-changed,param="pagination",value="off"
0x000007b6 in ?? ()

Note: I have read somewhere that there are two options - 

    • Let the bootloader run and then attach the debugger after the app has started (attach mode instead of reset-and-halt), or
    • Disable MCUboot for debug builds if your board configuration allows it.

The first option does not work in my VS-Code. The second, 

  • Hello,

    Working directly on the nRF5340 on the Thingy91x is not trivial. If you intend to write an application for the nRF5340 (or any other nordic BLE chip) I strongly suggest that you get hold of an nRF5340DK, or even better, the nRF54L15 DK. Is there any particular reason why you are using the nRF5340 specifically? And is there any particular reason why you are using the Thingy91X for developing BLE applications?

    And if you have a good reason, can you let me know what exact HW you have access to? Do you have an external debugger? What device are we seeing the log from now? Is it the nRF5340 on the Thingy, or the nRF91 on the thingy?

    Let the bootloader run and then attach the debugger after the app has started (attach mode instead of reset-and-halt), or

    If you do have a debugger, you can do this. Click the 3 dots on the right hand side of "debug" in VS code, and select "Attach Debugger to Target". Although, I am not convinced this will help.

    Disable MCUboot for debug builds if your board configuration allows it.

    probably the easiest, but it is not straight forward on the Thingy either. Again, it depends on what kind of setup you have. External debugger?

    Best regards,

    Edvin

  • For the second option, I tried CONFIG_BOOTLOADER_MCUBOOT=n in zephyr/.config, but it did not make a difference.

  • I am using the Thingy91 as a development kit. In a few weeks, we shall have our own board with a 9151 and 5340 on it. The demo kit has a nice application on it, and we want to create an application that uses most of the features in Thingy91X. At this moment, I have no choice. I do not understand why developing on the demo kit should be impossible. It seem to be stuck on a trivial issue - mainly due to lack of precise information how to overcome this particular issue. If the the only way would be to sign the image so that the bootloader could run it, so be it - this problem should be solvable too.

  • By the way, I have a SEGGER J-link, and I can see the nrf5340 on NRF Connect for Desktop V5.3.2, Programmer v4.8.0.

  • .

    Could you provide the recommended method for building a thingy91x/nrf5340/cpuapp debug image without MCUboot/TF-M involvement?
Related