Skip to content

Instantly share code, notes, and snippets.

@mstratman
Created Jan 18, 2022
Embed
What would you like to do?
#!/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