aboutsummaryrefslogtreecommitdiffstats
path: root/docs/Bootloaders.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/Bootloaders.md')
-rw-r--r--docs/Bootloaders.md44
1 files changed, 44 insertions, 0 deletions
diff --git a/docs/Bootloaders.md b/docs/Bootloaders.md
index 1f7aa24d..56a81095 100644
--- a/docs/Bootloaders.md
+++ b/docs/Bootloaders.md
@@ -185,6 +185,50 @@ To flash an application use something like:
bossac --port=/dev/ttyACM0 -b -U -e -w -v -R out/klipper.bin
```
+## SAMDC21 micro-controllers (Duet3D Toolboard 1LC)
+
+The SAMC21 is flashed via the ARM Serial Wire Debug (SWD) interface.
+This is commonly done with a dedicated SWD hardware dongle.
+Alternatively, one can use a
+[Raspberry Pi with OpenOCD](#running-openocd-on-the-raspberry-pi).
+
+When using OpenOCD with the SAMC21, extra steps must be taken to first
+put the chip into Cold Plugging mode if the board makes use of the
+SWD pins for other purposes. If using OpenOCD on a Rasberry Pi, this
+can be done by running the following commands before invoking OpenOCD.
+```
+SWCLK=25
+SWDIO=24
+SRST=18
+
+echo "Exporting SWCLK and SRST pins."
+echo $SWCLK > /sys/class/gpio/export
+echo $SRST > /sys/class/gpio/export
+echo "out" > /sys/class/gpio/gpio$SWCLK/direction
+echo "out" > /sys/class/gpio/gpio$SRST/direction
+
+echo "Setting SWCLK low and pulsing SRST."
+echo "0" > /sys/class/gpio/gpio$SWCLK/value
+echo "0" > /sys/class/gpio/gpio$SRST/value
+echo "1" > /sys/class/gpio/gpio$SRST/value
+
+echo "Unexporting SWCLK and SRST pins."
+echo $SWCLK > /sys/class/gpio/unexport
+echo $SRST > /sys/class/gpio/unexport
+```
+
+To flash a program with OpenOCD use the following chip config:
+```
+source [find target/at91samdXX.cfg]
+```
+Obtain a program; for instance, klipper can be built for this chip.
+Flash with OpenOCD commands similar to:
+```
+at91samd chip-erase
+at91samd bootloader 0
+program out/klipper.elf verify
+```
+
## SAMD21 micro-controllers (Arduino Zero)
The SAMD21 bootloader is flashed via the ARM Serial Wire Debug (SWD)