- Press 'Reset' on the Duet (RepRap Pro board)
- wait ~1 second
- Run ./g2_flash.sh
Last active
January 9, 2016 15:46
-
-
Save willprice/a55e9ec3498603fcfd9b to your computer and use it in GitHub Desktop.
Command to flash the Arduino Due GCode (CNC controller) software called G2 (a fork of TinyG) to an Arduino Due
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
PORT=/dev/ttyACM0 | |
BOSSAC="$HOME/.arduino15/packages/arduino/tools/bossac/1.6.1-arduino/bossac" | |
BINARY="$HOME/g2/TinyG2/bin/gShield/gShield.bin" | |
set_board_to_upload_mode() { | |
sudo stty -F "${PORT}" 1200 | |
} | |
upload_firmare() { | |
local firmware="$1"; shift; | |
sudo $BOSSAC --write \ | |
--erase \ | |
--verify \ | |
--info \ | |
--boot \ | |
--port="${PORT##/dev/}" \ | |
--force_usb_port true \ | |
"$firmware" | |
} | |
set_board_to_normal_mode() { | |
sudo stty -F "${PORT}" 9600 | |
} | |
main() { | |
set_board_to_upload_mode | |
upload_firmare "$BINARY" | |
set_board_to_normal_mode | |
} | |
main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment