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.
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.
