Skip to content

Instantly share code, notes, and snippets.

@raidoz
Created October 13, 2016 08:42
Show Gist options
  • Save raidoz/1f42438ef6654e37369be2c3f82c3db1 to your computer and use it in GitHub Desktop.
Save raidoz/1f42438ef6654e37369be2c3f82c3db1 to your computer and use it in GitHub Desktop.
Programm RFR2 controller with brown-out at 2.4V
#!/bin/bash
if [[ ($# -eq 2) ]]; then
echo "$0 $@"
else
echo "Specify IMAGE PROGRAMMER"
echo "$0 main.srec mote_0101_ABCD"
exit 1
fi
IMAGE=$1
PROGRAMMER=$2
# -OCDEN, +JTAG, +SPI, +WDTON, -EESAVE, 4K, +BOOTRST
HFUSE=0x88
# BOD 2.4V
EFUSE=0xF8
LOCK=0xFC
exec avrdude -c$PROGRAMMER -pm256rfr2 -U efuse:w:$EFUSE:m -U hfuse:w:$HFUSE:m -U flash:w:$IMAGE:a -U lock:w:$LOCK:m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment