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

nrf52: SWO purpose

Hello

In a schematic I saw the "SWO" connection appear on the Programming/Debug connector beside SWDIO and SWDCLK.

image description

What's it for? Of course it means "Single Wire Output", but would one need it for programming/debugging?

Thanks in advance

  • FormerMember
    0 FormerMember

    For programming a nRF5x device only SWDIO, SWDCLK, VDD, and GND is needed.

  • You don't need to connect up SWO for normal debugging, but many (most) ARM debuggers support it (including the onboard one). SWO can be used to output extra debugging data which can be useful. The DWT (Debug Watch Trace) unit and the ITM (Instrument Trace Macrocell) can output data via SWO. SWO is in some way ARM's solution for putting out custom debug information, the kind of info people often log over UART or more recently Segger RTT. So not many people use SWO even though it's very useful and is very inexpensive processor wise to send data out.

    This blog devzone.nordicsemi.com/.../ talks about some of the advanced things you can do although most of it requires the full 4 line TRACE not available on the 10 pin header. If you search for SWO in the search box you will find quite a few posts about how to use it. Few pieces of code normally do however.

Related