diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2017-08-14 11:44:06 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2017-09-20 12:55:28 -0400 |
commit | 5a85c1667a80cc2dda9861980c64d99f8da0163e (patch) | |
tree | d1e8a9e8b4ba59e5fd346259247f114620a0652d /scripts/flash-pru.sh | |
parent | 16d2ec3a905204dd804831611aff37a4b508e0fa (diff) | |
download | kutter-5a85c1667a80cc2dda9861980c64d99f8da0163e.tar.gz kutter-5a85c1667a80cc2dda9861980c64d99f8da0163e.tar.xz kutter-5a85c1667a80cc2dda9861980c64d99f8da0163e.zip |
pru: Update installation and flash scripts
Update the scripts used to install and "flash" the pru
micro-controller code. Also, add a "flash" script for the linux
micro-controller code. This makes it easier to install Klipper on a
Beaglebone board that uses a Replicape.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'scripts/flash-pru.sh')
-rwxr-xr-x | scripts/flash-pru.sh | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/scripts/flash-pru.sh b/scripts/flash-pru.sh index c0fee3e5..c508606c 100755 --- a/scripts/flash-pru.sh +++ b/scripts/flash-pru.sh @@ -13,18 +13,8 @@ cp out/pru0.elf /lib/firmware/am335x-pru0-fw cp out/pru1.elf /lib/firmware/am335x-pru1-fw sync -# Shutdown existing Klipper instance (if applicable). The goal is to -# put the GPIO pins in a safe state. -if [ -c /dev/rpmsg_pru30 ]; then - echo "Attempting to shutdown existing firmware..." - ( echo "FORCE_SHUTDOWN" > /dev/rpmsg_pru30 ) 2> /dev/null || ( echo "Firmware busy! Please shutdown Klipper and then retry." && exit 1 ) - sleep 1 - ( echo "FORCE_SHUTDOWN" > /dev/rpmsg_pru30 ) 2> /dev/null || ( echo "Firmware busy! Please shutdown Klipper and then retry." && exit 1 ) - sleep 1 +# Restart (if system install script present) +if [ -f /etc/init.d/klipper_pru ]; then + echo "Attempting PRU restart..." + service klipper_pru restart fi -set +e - -# Restart the PRU -echo "Restarting pru_rproc module" -rmmod -f pru_rproc -modprobe pru_rproc |