Skip to content

Instantly share code, notes, and snippets.

@pulsar256
Last active May 17, 2020 20:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pulsar256/4106eff3a02b1c3d340c1ab1753c6477 to your computer and use it in GitHub Desktop.
Save pulsar256/4106eff3a02b1c3d340c1ab1753c6477 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Flashes a LPC based boards over the serial line connected to the GPIO headers of a RPI.
# In addition to the TX/RX lines you will also need to connect the BOOT and RESET lines.
# This configuration uses GPIO6 for RESET and GPIO12 for BOOT. Pin numbering is using
# the wiring standard.
pin_reset=22
pin_boot=26
firmware=$HOME/klipper/out/klipper.bin
sudo systemctl stop klipper
# enter boot bootloader sequence
# configure reset and boot GPIOs as outputs
gpio mode $pin_reset OUT
gpio mode $pin_boot OUT
# hold reset and bootloader down
gpio write $pin_reset 0
gpio write $pin_boot 0
# go back to high-z and let skr pullups set the lines to high
gpio mode $pin_reset IN
gpio mode $pin_boot IN
lpc21isp -wipe -bin $firmware /dev/ttyS0 230400 12000
sudo systemctl start klipper
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment