Log output from Debug Out using SWDIO pin

Hi community,

I have an external board with a nRF52810 which is connected to the nRF52DK via the Debug Out port on the DK and a 4 pin connector on the external board (Vref, SWDCLK, SWDIO, and Grd). I am able to program the external nordic chip, but I want to also verify if the code is working. I thought I'd be able to send an input through SWDIO pin for the dev board to pick up - for example to toggle one of the led's on the dev board, when a button on the external board in pressed. Unfortunately nothing is being printed when I try to read an input on that pin. What is the way to go about this? 

Or am I approaching this wrong? Do I instead need to create headers for UART on the external board?

As, I'm trying to use Bluetooth communication on the external board, I need to verify different things: if data is being transferred correctly, connection is secured etc.

Please let me know if any additional information is required.

Thanks,

Roshan

  • Hi Roshan,

    I do not know which SDK you use (?), but both SDKs provided by nordic include support for logging both via Segger RTT and UART. See logger documentation for nRF Connect SDK and nRF5 SDK for details.

    If you log via Segger RTT, then yes, that means via the SWDIO pins, and you can use the Debug Out port on a DK connected to your board. Remember to connect the EXT_VTG and EXT_GND_DETECT pins so that the onboard debuger on the DK knows that it should debug the external device. If you log via UART, you need a way to get that to your PC (typicaly a form of USB-UART bridge). Technically these options work very differently, but both get the job done. You normally need access to the SWD pins anyway in order to do production programming, so this is an option that will typically let you do logging without any HW changes even if the HW design is set in stone.

    I suggest you play with an SDK example that do logging the way you want first, so you learn how it works. Then, try to make it work with your custom board and a DK as debugger.

    Einar

  • Hi Einar,

    Thanks for the reply. I had no idea about the Segger RTT, and it's just right for me as the hardware design is set in stone.
    The SDK that is being used is - nRF5_SDK_17.1.0_ddde560

    I don't understand what you mean by "both" SDKs....aren't there many different versions? Or are you talking about something else?

    I Iooked into the SDK under examples for logging through SWD and there's nothing there, am I missing something?

    Thanks,
    Roshan

  • Hi Roshan,

    roaibrain said:
    I don't understand what you mean by "both" SDKs....aren't there many different versions? Or are you talking about something else?

    I was referring to the two SDK families we provide (the older nRF5 SDK and the newer nRF Connect SDK). I understand you are using the nRF5 SDK version 17.1.0. As you are using the nRF5 SDK, the relevant documentation for logging via the logger module is here

    roaibrain said:
    I Iooked into the SDK under examples for logging through SWD and there's nothing there, am I missing something?

    SWD is Serial Wire Debug, which is the debug interface on the nRF device you are using, which is sued for programming, debugging and also logging via RTT (See Debug).

    Einar

Related