The Atmel SAM D09 (an ARM Cortex M0+ MCU) can enable normal pin functions on the pins that are normally used for programming (SWD). But in doing so I presume that debugging will become impossible after programming the device.

Is this correct, or may it be possible to share certain functions (like I2C/UART/SPI/digital input) without disturbing debugging?

Second, the D09 datasheet has this curious phrase: "Only the SWCLK pin is mapped to the normal PORT functions. A debugger cold-plugging or hot-plugging detection will automatically switch the SWDIO port to the SWDIO function".

So it seems I can at use at least one pin in a shared mode with SWD. But this phrase is rather ambiguous: which pin would that be, and what functions can be shared on the shareable pin?

What I am asking is specific for the ARM SWD protocol, and the case in point is cheap Atmel SAM D09/D10/D11 chips.


1 Answer 1


That will depend on the programmer you are using. I am actually working with the SAMD20 using the AVRISP mkll programmer from Atmel and you dont have to care about sharing those pins. The main function of the pin will keep working even if you have the programmer connected there. In fact, that is what ISP means (In system programming) If you are using the Xplain Pro Evaluation Kit, you can program the device using the USB wire and all programming pins will keep working in their main function.

  • \$\begingroup\$ So the programmed pin-function would be suspended (not working) while debugging, but at least debugging would work? Note that my focus isn't on programming the device, but on debugging it. \$\endgroup\$
    – user103185
    Commented Nov 9, 2015 at 11:57
  • \$\begingroup\$ To be honest, I never tried the debugging, but I am pretty sure that the main function on those pins will keep working during the debug. Try and let us know! \$\endgroup\$
    – cventu
    Commented Nov 9, 2015 at 13:07
  • 1
    \$\begingroup\$ I found more info in the datasheet. It seems SWCLK is needed to detect the debugger (the debugger pulls it low), the chip then switches SWDIO over to the debug function. When code assigns the SWCLK pin a function (whatever that may be), debugging is no longer possible, but programming is (after a reset). Summarizing: SWDIO can be used freely and using SWCLK will disable debugging. \$\endgroup\$
    – user103185
    Commented Dec 7, 2015 at 13:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.