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

Debugging nRF52840 Dongle via J-Link to DK and Segger Embedded Studio

I am attempting to run the mesh Light Switch example with a provisioner, client and a server in debug mode using the Segger SES.  I am attempting to debug the server code on a nRF52840 DONGLE (PCA10059, v1.0.0) using the Segger IDE talking to DK board, which is in turn connected to the dongle via the "Debug Out" port P19 and a two other jumpered signals (Vdd & Reset).

My question is:  
After programming the dongle using the SES / J-Link, why would the dongle slowly flash its red LED, as if in DFU wait mode?  I can neither single step through the code nor get any RTT output via SES.  Neither the Reset button nor the push button on either client or server dongle does anything.

Background
----------------
System Setup:
1) Mesh SDK 2.2
2) nRF  SDK 15.0.0_a53641a
3) Soft Device 140
4) Segger SES, Release 3.50  Build 2018081000.36713 (64-bit)
5) Windows 7, 64-bit Pro

I had the Provisioner code running on nRF52840 DK board (PCA10056, v1.0.0) and the server & client code running on separate nRF52840 dongles (PCA10059, v1.0.0).  The SES RTT output showed that the Provisioner saw the UUIDs of each of the dongles (mesh elements/models, I should say)... but not much else was happening.  Buttons pushed on the client and/or server dongles did nothing.  No LEDs turned on or off.  It appeared communications was happening, but no mesh had been provisioned.  In reading some of the other Dev Site notes... I have some code to revise to get the mesh up and running... but that is not really the issue right now.

I then attempted to connect one of the dongles to DK board via Debug Out port P19:

     pin #  DK signal (P19)  Dongle signal (P1)
     -----  ---------------  ------------------
     1      Ext Vtg          Vdd*
     2      SWDIO            SWDIO
     3      Gnd              Gnd
     4      SWCLK            SWCLK
     5      Gnd              NC***
     6-8    NC               NC
     9      Gnd Detect       NC
            (jumpered to pin 3)
     10     NC               jumper from DK board P20 "Reset"**

**  Vdd from P20 on the DK was jumpered to pin 1 on Dongle connector P1
**  Reset from DK connector P20 was jumpered to pin 10 on Dongle connector P1
*** NC = Not Connected

I rebuilt the server project on SES and then clicked Debug>>Go. Segger displayed the following:
--------------------------------------------------------------
Preparing target for download
Executing script TargetInterface.resetAndStop()
Reset: Halt core after reset via DEMCR.VC_CORERESET.
Reset: Reset device via AIRCR.SYSRESETREQ.
Downloading ‘s140_nrf52_6.0.0_softdevice.hex’ to J-Link
Programming 2.5 KB of addresses 00000000 — 00000a17
Programming 144.9 KB of addresses 00001000 — 000253c7
J-Link: Flash download: Bank 0 @ 0x00000000: Skipped. Contents already match
Download successful
Downloading ‘light_switch_server_nrf52840_xxAA_s140_6.0.0.elf’ to J-Link
Programming 95.9 KB of addresses 00026000 — 0003dfdf
Programming 0.3 KB of addresses 0003dfe0 — 0003e113
J-Link: Flash download: Bank 0 @ 0x00000000: Skipped. Contents already match
Download successful
--------------------------------------------------------------
Note: I changed Preprocessor variable to "BOARD_PCA10059" and revised the LED_START / LED_STOP definitions to get this to compile.

At this point, the dongle red LED flashed on/off lazily at around 1 flash every 2 seconds.  (Same flash rate as occurs when pressing the reset button at power on).  Note that originally I did not have the Reset line connected.  I added that thinking that this pin enabled the Segger chip to reset the dongle after programming.  It made no difference.
 
I have more detailed notes of exactly what I did (Segger project settings, etc.), but I won't include those here unless asked.

Thanks in advance.

  • OK... I think I solved the problem, but I am not entirely sure how.  Originally I used J1 pads on the dongle with a TC2050 pogo-pin connector. Reset does not exist on those pads (I now assume these pads are for programming only... no debug), so I had to tack a jumper from DK board, port P20 Reset pin to dongle, port P1, pad 10.  I forgot to change this on my pinout list above. 

    I then decided to instead solder on a 2x5 pin header onto P1 and use a straight 10-wire ribbon cable to connect DK to the dongle.  I still needed a jumper from Vdd on the DK to the VddOut pad on the dongle (one of the notched pads on the edge).  HOWEVER, I made this change to a second dongle (i.e. not the same one I had issues with).

    Viola, the Segger downloaded the example server program and immediately went into single step debug mode.  So, I have no idea if my 1st attempt was a bad solder job or simply an issue with the 1st dongle... but I am back in business and debugging like a frog in fly season. 

    For those of you following along... don't waste time trying to debug with TC2050 pogo-pin cable (which are pretty awesome, I must say).  Instead, solder 2x5, 0.05" (1.277mm) pitch, male pin header directly to the dongle's P1 pads; add another jumper from DK for the dongle's Vdd and you should be good to go.

Related