Skip to content

Commit

Permalink
add flash script for linux
Browse files Browse the repository at this point in the history
  • Loading branch information
breaker27 committed Mar 15, 2014
1 parent d863310 commit 6afc05f
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
20 changes: 20 additions & 0 deletions firmware/extra/flash_all.sh
@@ -0,0 +1,20 @@
#!/bin/sh

SHC_E2P=`ls -x *.e2p|head -n 1`
SHC_HEX=`ls -x *.hex|head -n 1`

# detect ATMega type by file name
SHC_PROC=m328p
if [ ${SHC_HEX} = "shc_SOME168DEVICE.hex" ] ; then
SHC_PROC=m168
fi

echo
echo "Firmware: ${SHC_HEX}"
echo "EEPROM: ${SHC_E2P}"
echo "ATMega: ${SHC_PROC}"
echo
echo "Do you want to flash fuses, eeprom and firmware now? (Abort with Ctrl+C)"

read line
avrdude -p ${SHC_PROC} -U flash:w:${SHC_HEX} -U eeprom:w:${SHC_E2P}:r -U lfuse:w:lfuse.bin:r -U hfuse:w:hfuse.bin:r -U efuse:w:efuse.bin:r
18 changes: 18 additions & 0 deletions firmware/extra/flash_firmware.sh
@@ -0,0 +1,18 @@
#!/bin/sh

SHC_HEX=`ls -x *.hex|head -n 1`

# detect ATMega type by file name
SHC_PROC=m328p
if [ ${SHC_HEX} = "shc_SOME168DEVICE.hex" ] ; then
SHC_PROC=m168
fi

echo
echo "Firmware: ${SHC_HEX}"
echo "ATMega: ${SHC_PROC}"
echo
echo "Do you want to flash firmware now? (Abort with Ctrl+C)"

read line
avrdude -p ${SHC_PROC} -U flash:w:${SHC_HEX}

0 comments on commit 6afc05f

Please sign in to comment.