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

Debugging external nRF51422

Hi,

I am programming and debugging an external customised board by following the DK manual and the below link: electronut.in/.../

I use the interface P20 instead of P19, and wire the four signals (VTG, GND_Detect, SWDIO and SWDCLK) to the external board. I think the programming should be fine because I can see the programming processing bar. However, I cannot debug this external board. As mentioned in the manual of DK, the DK should bypass the internal chip and debug the external one if the external one is powered on, but from what I could see, the DK is still debugging the internal chip.

Could you please give me some suggestions? Thanks

[Update]

I checked again about this problem, and I do the following efforts:

  1. I first upload a script into the chip, so the chip will print characters on the serial port.

  2. I connect the VDD and SH_VTG of P20, GND and SH_GND_DETECT of P20 together (as the photo show below, without connecting the external board). image description

  3. Under this configuration, I suppose the DK should bypass the internal chip. However, it does not. After powering on the DK, the serial port is still doing the printing.

  4. Under this configuration, I tried to do the programming, but it is not successful - meaning the programming is directed to the external chip.

Would you please give me some suggestions?

  • Type 'P20' into the search box and read some of the previous threads about the difficulties of using P20 over P19. P20 is really designed for arduino shield debugging, P19 is the real debug out. There are a couple of suggestions in those threads which include shorting a couple of pins together. The best suggestion however is to use P19, the header which is actually designed for debug out.

  • Thanks for your help and reply. What really confuse me is that the DK can actually programme the external chip, but the debugged target is not correct (I can tell it is debugging the internal one). Does this problem relate to whether pin19 or P20 I am selecting? Many thanks.

  • programming and debugging are exactly the same - if it's connected to the external one for programming, it's connected to the external one for debugging also, it's all done via the exact same interface. So I doubt you are seeing what you think you are seeing.

    And I have no idea whether it's related to P19 vs P20, however P19 is the standard debug out, P20 is really designed for debugging things connected via arduino shields and if you check the links I pointed you to you will see lots of people have failed to use P20

  • Many thanks. I will use P19 instead and see whether it would recover this problem.

  • Hi, I did change to P19 for programming, but the same problem still exists, the code is uploaded to the external chip but the debugging is directed to the internal one. Here is how I judge it (if the code is uploaded correctly, it will print on the serial port): 1. Connecting all the cables from P19 to the external board; 2. Powering on the external board and programming it from the DK; 3. Monitoring from the serial port shows nothing; 4. Disconnect only SWCLK signal from the external board, programming failed; 5. Disconnecting the whole external board, and programming the DK; 6. The serial port is printing normally; 7. Reconnecting the external board to P19, the serial port still works normally; So from above steps, I can tell the programming function works fine, but the debugging does not. I measured the voltage on Pin1 of P19, it is 3.3V, so I suspect the DK should bypass the internal chip. Would you please guide me on this? Many thanks.

Related