@@ -185,6 +185,50 @@ To flash an application use something like:
185
185
bossac --port=/dev/ttyACM0 -b -U -e -w -v -R out/klipper.bin
186
186
```
187
187
188
+ ## SAMDC21 micro-controllers (Duet3D Toolboard 1LC)
189
+
190
+ The SAMC21 is flashed via the ARM Serial Wire Debug (SWD) interface.
191
+ This is commonly done with a dedicated SWD hardware dongle.
192
+ Alternatively, one can use a
193
+ [ Raspberry Pi with OpenOCD] ( #running-openocd-on-the-raspberry-pi ) .
194
+
195
+ When using OpenOCD with the SAMC21, extra steps must be taken to first
196
+ put the chip into Cold Plugging mode if the board makes use of the
197
+ SWD pins for other purposes. If using OpenOCD on a Rasberry Pi, this
198
+ can be done by running the following commands before invoking OpenOCD.
199
+ ```
200
+ SWCLK=25
201
+ SWDIO=24
202
+ SRST=18
203
+
204
+ echo "Exporting SWCLK and SRST pins."
205
+ echo $SWCLK > /sys/class/gpio/export
206
+ echo $SRST > /sys/class/gpio/export
207
+ echo "out" > /sys/class/gpio/gpio$SWCLK/direction
208
+ echo "out" > /sys/class/gpio/gpio$SRST/direction
209
+
210
+ echo "Setting SWCLK low and pulsing SRST."
211
+ echo "0" > /sys/class/gpio/gpio$SWCLK/value
212
+ echo "0" > /sys/class/gpio/gpio$SRST/value
213
+ echo "1" > /sys/class/gpio/gpio$SRST/value
214
+
215
+ echo "Unexporting SWCLK and SRST pins."
216
+ echo $SWCLK > /sys/class/gpio/unexport
217
+ echo $SRST > /sys/class/gpio/unexport
218
+ ```
219
+
220
+ To flash a program with OpenOCD use the following chip config:
221
+ ```
222
+ source [find target/at91samdXX.cfg]
223
+ ```
224
+ Obtain a program; for instance, klipper can be built for this chip.
225
+ Flash with OpenOCD commands similar to:
226
+ ```
227
+ at91samd chip-erase
228
+ at91samd bootloader 0
229
+ program out/klipper.elf verify
230
+ ```
231
+
188
232
## SAMD21 micro-controllers (Arduino Zero)
189
233
190
234
The SAMD21 bootloader is flashed via the ARM Serial Wire Debug (SWD)
0 commit comments