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

Programming nRF51422 externally

Hi,

I have designed and made a PCB with the nRF51422 chip on it. I am programming the chip externally using the P20 header pins on the nRF51-DK. I am not sure whether the chip on the PCB is being detected by the DK as the program is being loaded onto the DK chip. Is the chip on the DK also programmed normally when trying to program a chip externally or is the DK chip completely ignored once an external chip is detected? Also, is there a way to check whether the external chip is even being detected (in Keil uVision)?

Regards, Ehsan.

  • You should be able to test flashing with some simple FW which e.g. starts to blink with LEDs on DK board so if nRF5x chip on the board is erased and then it starts to blink (don't forget to reset the board to be sure it's not halted in debug mode or something similar) then you know you are not targeting external chip through P19 or P20. There are posts which can help with good set-up, see here and here. I personally use the trick with short between PIN2 (VDD) and PIN3 (VTG) on P20, that will make sure that SEGGER J-Link OB will always try to program external target on P20 and not internal chip. You can verify easily that even if you unplug other wires from P20 if you short VDD and VTG nrfjprog (or other flashing program you use) reports error "target not attached" (or something similar;).

  • I just tried what you recommended. When I short the VDD (pin 2) and VTG (pin 3) pins on p20 together, the led LD5 on the DK turns off and no J-Link device is found. However, as soon as I disconnect this short circuit, the led on the DK comes back on. Is this expected?

    EDIT: The set-up included a short between GND DETECT on P20 with GND on P13. However, when I removed the connection to GND on P13 and kept the short between VDD and VTG on P20, the led on the DK came back on. Now, when I try to program the external board in uVision, it fails and displays the message: No Cortex-M SW Device Found. I'm not sure what's going on. I would be grateful if you could help. Thanks.

  • Well most probably you have bad cabling (make sure that you wire nRF5x DK and target board with solid and short wires, preferably all the same length, also USB cable to the DK board matters sometimes). If you think all connections are OK then make sure that grounding and powering of target board is done properly. Otherwise all looks as expected: once you short these wired on P20 it will try to program it all the time and if target is not 100% OK then you will get this type of error.

  • The debugger seems to be trying to program the external target board but it fails each time. It displays the following error in the build output window: ***JLink Error: Communication timed out: Requested 20 bytes, received 0 bytes ! Could not read hardware status!

    What would this suggest? Also, does the GND DETECT pin on P20 provide a GND connection too? Thanks.

  • No, you need to connect another GND PIN from nRF5 DK board to Ground on the target. See this and this. Also even if all ports and pins are connected correctly the programmer is picky about quality of wiring, be sure to use properly insulated reasonably short and if possible straight without loops wires.

Related