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

(UART) Log Output Through Debug Out

Hi I have an external board featuring an nRF52832 connected to the nRF52DK via the Debug Out port on the DK and a 6 pin connector on the external board. I can program the external MCU just fine, but I cannot read debug output that I'm logging via UART. What do I need to do to get this to work?

  • For UART you need separate wires (typically just one for Tx is fine for beginning). On nRF5x DK boards there are certain PINs from nRF5x target on the board connected to ATMEL companion chip with SEGGER J-Link OB (or mbed) FW which forwards it over USB as emulated serial port so you can simply connect that PIN from your external board to the UART Tx PIN (it's P0.06 according to the documentation) on nRF52 DK and you should be fine. Just be sure that internal target on nRF52 DK is erased so it doesn't interfere with your external input...

  • So I'd be connecting the P0.06 pin of the external nRF52 to the P0.06 port on the DK? Is there a way to route this through one of the 6 pins of the needle connector directly, such as mapping it to the SWO (and then maybe connecting SWO to P0.06 on the DK)? I'd like to avoid having to solder things if possible;)

  • You don't have any PIN on your external board available on some debug header? That might look like a mistake now;) Never mind, there is a way to switch P0.21 from nRESET to standard GPIO or P0.18 from SWO to GPIO so if you have one of these connected on your 6-PIN header then reconfigure it in your FW, redirect UART Tx to proper number and then on nRF52 DK side wire proper link instead of JTAG/SWD (or P20 external debug header if you use that) to P0.06.

  • P0.18/SWO is connected to SWO on the needle connector and I configured the NRF_LOG_BACKEND_UART_TX_PIN to 18, so I think it is handled on the external board side. I tried to connect SWO on the P20 connector to P0.06 on the DK, but I still don't get any UART logs. What do you advise? When I look at the schema of the DK i see that SWO on P19 is labelled EXT_SWO and SWO on P20 is labelled SH_SWO and both are connected to the debug chip, but don't seem to be directly connected.

  • First of all you need to make sure that P0.18 is not used as SWO but as GPIO. See ENABLE_SWO define in SDK examples. Then you need to connect the wire DIRECTLY from your target to P0.06 on nRF52 DK. No, connecting it to SWO on P19 or P20 won't work because these go to SEGGER J-Link OB first and that won't rote it to UART.

Related