Kiibohd Controller
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

swdLoad.bash 1.0KB

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/bash
  2. # Loads firmware image using an SWD Flasher
  3. # Uses MCHCK ruby flasher toolchain
  4. # NOTE: Only tested with a buspirate on Linux
  5. # Arg 1: Path to firmware image
  6. # Arg 2: Address to flash to (byte address)
  7. # Must have two args
  8. if [ "$#" -ne 2 ]; then
  9. echo "Usage: `basename $0` <firmware binary> <starting address>"
  10. echo "Example: `basename $0` kiibohd_bootloader.bin 0"
  11. exit 1
  12. fi
  13. # First check to see if the flasher toolchain is available
  14. if [ ! -d "programmer" ]; then
  15. # Use git to download the toolchain
  16. git clone https://github.com/mchck/programmer.git
  17. fi
  18. # Make sure the toolchain is up to date
  19. cd programmer
  20. #git pull --rebase
  21. cd ..
  22. # Attempt to flash
  23. # Udev rules have been applied to name the buspirate as /dev/buspirate (instead of something like /dev/ttyUSB0)
  24. # By default only root can access serial devices on Linux
  25. #ruby programmer/flash.rb name=buspirate:dev=/dev/buspirate --mass-erase
  26. ruby programmer/flash.rb name=buspirate:dev=/dev/buspirate "$1" "$2"
  27. #ruby programmer/flash.rb name=buspirate:dev=/dev/buspirate --mass-erase "$1" "$2"