Skip to content

Instantly share code, notes, and snippets.

@raidoz
Created October 13, 2016 08:44
Show Gist options
  • Save raidoz/9e9fe7cd01fe895505d5118540f7904b to your computer and use it in GitHub Desktop.
Save raidoz/9e9fe7cd01fe895505d5118540f7904b to your computer and use it in GitHub Desktop.
Programm RFR2 controller with brown-out at 1.8V
#!/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 1.8V
EFUSE=0xFE
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