-
-
Save mstratman/6d1f567974ba306a145588434d0c49a8 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
input=$1 | |
if [ ! -f "$input" ]; then | |
echo "Usage: ./burn.sh path/input.hex" | |
exit | |
fi | |
output=${input%.hex}.bin | |
echo "Erasing eeprom" | |
ch341eeprom -v -s 24c32 -e | |
echo "Converting to $output" | |
srec_cat $input -Intel -o $output -binary | |
echo "Writing EEPROM" | |
ch341eeprom -v -s 24c32 -w $output | |
echo "Checking:" | |
ch341eeprom -v -s 24c32 -r /tmp/eeprom.bin | |
echo "--------look for problem here-------" | |
diff /tmp/eeprom.bin $output | |
echo "---------------------" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment