1
\$\begingroup\$

I have a dev board for an ATSAMD21G18 (Seeed Studio Xiao) schematic here

I just got an Atmel-ICE and started tinkering around with the SWD interface of the Xiao board (I'm new to embedded programming). The configured ports for SWD were on PA31 (SWDIO) and PA30 (SWCLK). After hooking it up to my PC via an Atmel-ICE within MPLAB X v6.0.0, I accidentally removed the "receive enable" functionality on PA31 via Harmony Configurator and pushed to the device. As such I can no longer transmit anything via my Atmel-ICE and MPLAB X IDE. For any operation from MPLAB (reading memory, programming device, etc.) I receive the following error:

Begin comm session
java.lang.RuntimeException: java.lang.RuntimeException: RDDI_DAP_OPERATION_FAILED

The closest info I've come across on here is this post where there is mention of "cold plugging" as a solution. Opening the SAMD21 datasheet I see there is mention of this in section 7.2.2 "Serial Wire Debug Interface Pinout". According to this, if I can arrive in a state that "a debugger cold-plugging or hot-plugging" PA30 and PA31 will switch to SWCLK and SWDIO respectively. Thats exactly what I'm hoping for.

Section 13.6.3.1 describes what Cold Plugging is.

Cold-Plugging is the detection of a debugger when the system is in reset. Cold-Plugging is detected when the CPU reset extension is requested, as described above.

The CPU reset extension process is in 13.6.2 and doesn't look like something I know how to do.

enter image description here

Can someone point me to a guide (ideally for newbies like myself) that shows me how I can perform this CPU Reset Extension operation via MPLAB X IDE or otherwise on Linux (Ubuntu)? Or more to the point, how to recover PA31 (SWDIO) and PA30 (SWCLK).

Or if you think I've incorrectly analyzed this situation and the error from the Atmel-ICE indicates something else. Please advise.

\$\endgroup\$
3
  • \$\begingroup\$ I think when using Atmel-ICE from MPLAB X, the reset line is not used i.e. no cold-plug is done. Afaik, there is no way of forcing MPLAB X into using the reset line. You could try installing Atmel Studio, and perform a full chip erase from there, which should reset the SWD pin settings to default. I think Atmel Studio will use the hardware reset, when performing full chip erase. \$\endgroup\$
    – Klas-Kenny
    Commented Feb 25, 2022 at 7:01
  • \$\begingroup\$ @Klas-Kenny Can you provide a link to Atmel Studio downloads or otherwise install options? From what I can read, it got merged into Microchip Studio which is only on Windows (I'm on Ubuntu). \$\endgroup\$
    – topher217
    Commented Feb 28, 2022 at 5:19
  • 1
    \$\begingroup\$ On Ubuntu, you could probably get openOCD working with the Atmel-ICE, and use that to do the erase. I'd guess that as well will utilize the hardware reset. See this guide on how to get openOCD setup with Atmel-ICE: omzlo.com/articles/… \$\endgroup\$
    – Klas-Kenny
    Commented Feb 28, 2022 at 5:39

0

Your Answer

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

Browse other questions tagged or ask your own question.