This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nRF52840 dongle with J-Link EDU Mini fails in VSCode debugging and also fails with external power supply

Having developed a dual-role Central and Peripheral BLE app, I've been trying to use the Dongle to do power measurements.
My app works fine in VSCode with the nrf52 on a RF9160DK, but fails to run/debug when built for the dongle and J-Link.

In an effort to get the dongle running properly, I am using the zephyr/samples/basic/blinky example.
VSCode programs the nRF52840 fine through the J-Link EDU Mini, but the code never reaches 'main'.  Stepping (through the assembly file shown) only runs five lines in a loop--nothing more.

So then I tried Segger Studio to do the same thing (blinky) and it worked perfectly.

HOWEVER, trying to run the Dongle on an external supply (SB2 cut, SB1 connected) even 'Blinky' will NOT run. 

My own application (built in Segger) won't run with the external supply either. It runs fine with the J-Link connected though.

Also, if I get either application running just by downloading using Segger and the J-link, the app will run fine. Then I can disconnect the J-link and it continues to run fine on the external supply. But they don't run using ONLY the external supply. 

Summary:
VSCode cannot run or debug an application on the dongle.
Segger CAN flash and/or debug an app on the dongle. 
A stand-alone app will continue to run on an external supply IF and ONLY IF, power is left applied while disconnecting the J-Link.

Note: The RF Connect SDK, and all associated programs are the latest available, and my dongles are marked 2.0.0 2021.1.

Parents Reply Children
  • Apparently the behavior changes with which board you select. 

    I used VSCode to compile the same code (both blinky and my app), but changed the target board from the nRF52840dongle_nrf52840 to nRF52840dk_nrf52840 and now both codes work with an external supply.

    So there must be some configuration discrepancy between the two. 

    Perhaps it has to do with the presence of the DFU bootloader and startup vector or something. 

  • This seems to be the case I added "CONFIG_BOARD_HAS_NRF5_BOOTLOADER=n" to my proj.conf file and now VSCode can run/debug on the dongle through the J-Link Mini.  The Dongle's normal bootloader resides in the first 0x1000 offset which doesn't apply when using a debugger which wipes out the bootloader...

Related