Using nrf52840-DK as a programmer for external board

I have a custom board using an nrf52840 chip that I wish to program using the nrf52840-DK board. I have connected the custom board to the DK on P20, using the SWD_CLK, SWD_IO, SWO, and RESET pins (I'm aware RESET isn't needed, but I have it so...). I have also connected VDD and GND from P1 to my board, and GND from P1 to SWD_SEL on P20. This doesn't work though, the programmer always programs the on-board nrf52840.

There appear to be at least 4 different pinouts for P20 that I've seen on different revisions of the nrf52840-DK board so it's not clear how it's supposed to be connected.

My board has the following pins on P20 so if someone could explain which pins are needed, that would be good (please don't just link to diagrams of different boards - I'm specifically referring to this particular pinout):

  1. VDD nRF
  2. VDD nRF
  3. SWD SEL
  4. SWD IO
  5. SWD CLK
  6. SWO
  7. RESET
  8. (no label)
  9. VIN 3-5V
  10. VDD nRF_HV
  11. VDD nRF_HV
  12. VIO REF
  13. (no label)

(I did see a link to this post, but this is NOT the same pinout I have on my DK - https://devzone.nordicsemi.com/f/nordic-q-a/51179/debug-out-port-p20-on-nrf52840-dk-debugging-custom-board/204972#204972 )

If it's not possible to do this with my board, I have considered removing the nrf52840 from the DK board - would this force the programmer to program the external board? If not, is there some other hardware change/soldering that can be used to disable the on-board nrf52840 so the programmer will only ever program an external board?

Parents
  • I'll just answer this myself so it's here for anyone to find. If you have the above header, then:

    • VDD on P1 -> SWD SEL on P20
    • VDD on P1 -> target board VDD
    • GND on P1 -> target board GND
    • VDD nRF on P20 -> VDD on target board (or VDD on P1)
    • SWD IO on P20 -> SWDIO on target board
    • SWD CLK on P20 -> SWDCLK on target board
    • SWO on P20 -> SWO on target board (not sure this is necessary, but it hasn't caused any issues)
    • RESET on P20 -> RESET on target board (optional - I did this so I could reset the target board easily)

    This worked for me immediately.

Reply
  • I'll just answer this myself so it's here for anyone to find. If you have the above header, then:

    • VDD on P1 -> SWD SEL on P20
    • VDD on P1 -> target board VDD
    • GND on P1 -> target board GND
    • VDD nRF on P20 -> VDD on target board (or VDD on P1)
    • SWD IO on P20 -> SWDIO on target board
    • SWD CLK on P20 -> SWDCLK on target board
    • SWO on P20 -> SWO on target board (not sure this is necessary, but it hasn't caused any issues)
    • RESET on P20 -> RESET on target board (optional - I did this so I could reset the target board easily)

    This worked for me immediately.

Children
No Data
Related