Mercurial > louis > kiibohd-controller
view LoadFile/winload.teensy @ 303:f9c406854bc2
Set DFU bootloader name
Fixes #22
Each (dfu) interface may have more than one a ltsetting each with their own index and name. According to the DFU_1.1 pdf section 4.2.3, "* Alternate settings can be used by an application to access additional memory segments. In this case,
it is suggested that each alternate setting employ a string descriptor to indicate the target memory
segment; e.g., 'EEPROM'." Whether or not we end up using multiple memory segments it is still good to have a descriptive name incase there are other dfu devices connected.
Edit: Fixed previous indentation
author | Rowan Decker <Smasher816@gmail.com> |
---|---|
date | Sun, 08 Mar 2015 16:59:34 -0700 |
parents | 71882cd1c362 |
children | 99f93dec8fea |
line wrap: on
line source
#!/bin/bash # Convenience script for loading firmware onto a teensy type device # By default, initiates teensy-load-cli SERIAL_PORT="" AUTO_SCREEN_SESSION="" PROG_NAME=$(basename $0) # Parse all the command line arguments while (( "$#" >= "1" )); do # Scan each argument key="$1" case $key in -a|--autoscreen) AUTO_SCREEN_SESSION="$2" shift ;; -f|--fastload) SERIAL_PORT="$2" shift ;; -h|--help) echo "Usage: $PROG_NAME [options...]" echo "" echo "Loads the most recent built firmware (@TARGET_BIN@) to the device." echo "Requires Cygwin." echo " (winload.teensy)" echo "" echo "Arguments:" echo " -f, --fastload SERIAL_PORT Send the reload command to the debug terminal." echo " e.g. /dev/ttyACM0" echo " NOTE: May not work due to non-functional terminal, or disable remote flashing" echo " -h, --help This message." exit 1 ;; *) echo "INVALID ARG: '$1'" exit 2 ;; esac # Shift to the next argument shift done # First check to see teensy-loader-cli has been compiled if [ ! -e teensy-loader-cli/teensy-loader-cli ]; then # Compile teensy-loader-cli mkdir -p teensy-loader-cli cd teensy-loader-cli cmake -G "Unix Makefiles" $(cygpath -u @CMAKE_SOURCE_DIR@/LoadFile) make || exit 3 cd - fi # If a SERIAL_PORT was specified set the uC into reflash mode # XXX May not be successful if uC is not in a good state (or does not allow remote flashing) if [[ "$SERIAL_PORT" != "" ]] && [[ -e "$SERIAL_PORT" ]]; then echo "NOTE: This may fail if the uC is in a bad state or does not support remote flashing" printf "reload\r" > $SERIAL_PORT sleep 1 fi # Loads the hex file onto the teensy teensy-loader-cli/teensy-loader-cli -mmcu=@MCU@ -w @TARGET_HEX@ EXIT_STATUS=$? exit $EXIT_STATUS