Using a USB cable for SWD interface

I've seen a few posts about this, but they are all old, and maybe don't apply to USB-C

We have a device that already uses USB-C for battery charging. We want to carry the SWDIO and CLK signals using the USB-C cable. We don't expect to be able to just plug this into a computer to flash. We will of course have a custom interface to connect this properly to the JLink or other programmer.

The question is, is it safe to do this? We don't want damage to either the computer or the nRF52832 if the user connects this to the computer. It would be common for users to charge the device with a computer, so 100% this will happen often. 

Anyone got recommendations on which pins to use? Anyone done and tested this?

  • Hi,

    Yes there is protection diodes connected to VDD and VSS for each GPIO pin. If the voltage on the GPIO pin exceed the absolute maximum rating, in that it goes lower than VSS - 0V3 or higher than VDD + 0V3 then the protection diode will start to lead, and eventually break if it's exposed for this for a long time. 

    Dawei said:
    I don't really understand the USB C spec that well. But I see one possible problem. I think it uses those pins to set the correct VBUS voltage, so maybe could accidentally apply more than 5V to the charging circuit. I guess a zener can take care of that.

    I'm not that experienced in the USB -C protocol, but I know that some of the pins are used to set the voltage and current. So you're probably into something here. 

    regards

    Jared 

Related