This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Swdio/swclk shared with normal GPIO

Hei there! First of all thanks for all the great work here!

My question is:

In my application, the final device will have 4 pogo pins. Two of them are for power, the other two for signal. These signal pins coul be connected at the same time to swdio/swclk for programming and to two normal gpio used later for I2C?

Thanks to everybody

  • The question is a bit hard to understand. I think you're asking whether you can connect two of your pogo pins both to the SWDIO/SWDCLK and also to two other pins on the device which are GPIOs at the same time and use them to first program the device, and later as IO.

    No. Not without some kind of external circuitry you couldn't. The SWDIO pin is also nRESET so as soon as you blipped that low the chip would reset. The SWDCLK pin is what turns on the debug interface so as soon as that changes from low to high, you'd enter debug mode and the signals on your I2C would also interpret as debug commands.

  • Thanks RK, you got the point! OK, I have now to find out a better solution. Thanks again

  • Has anyone tried doing this on a nRF52 832?

    From what i can see the SWD interface is only activated based on its state at a reset event.  So if the MCU starts normally (without SWD activated) it should ignore any signals on the SWD pins?

    Conversely GPIO is tri-state at reset so that should not effect programming using SWD?

  • Where do you see that? The SWD interface can be enabled at any point, also without resetting the device ("attach to running target"). In other words, you risk activating the debug interface if the SWD interface and GPIO's are connected and there is activity on the GPIO pins.

  • I have one question regarding this topic.

    is it possible to use the SWDIO and SWDCLK pins for programming just after power upin the first second for excample? After that the debug interface cant be started anymore. I dont want to use them as gpios or anything else. I just don't want the debug interface or reset to be started if there are some voltage levels at those pins...

    do you know what I mean? Thanks in advance!

Related