diff options
| author | Gabriel Hart | 2021-04-14 14:10:14 -0500 |
|---|---|---|
| committer | Gabriel Hart | 2021-04-14 14:10:14 -0500 |
| commit | 9dddc98863af8987c671d978d2ce8bc7e67c2e89 (patch) | |
| tree | bbc9d3df42e9d8b366fefea45ad15700c001153e /bin | |
| parent | Merge TKs changes from 2021-01-25 (diff) | |
| parent | fixed missing ifdef for simple UI (diff) | |
| download | anduril-9dddc98863af8987c671d978d2ce8bc7e67c2e89.tar.gz anduril-9dddc98863af8987c671d978d2ce8bc7e67c2e89.tar.bz2 anduril-9dddc98863af8987c671d978d2ce8bc7e67c2e89.zip | |
Merge from main branch
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/build.sh | 11 | ||||
| -rwxr-xr-x | bin/flash-tiny1616.sh | 13 |
2 files changed, 20 insertions, 4 deletions
diff --git a/bin/build.sh b/bin/build.sh index 6c21e30..c733320 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -11,12 +11,17 @@ fi export ATTINY=$1 ; shift export PROGRAM=$1 ; shift + +# path to the Atmel ATtiny device family pack: (for attiny1616 support) +# http://packs.download.atmel.com/ +if [ -z "$ATTINY_DFP" ]; then export ATTINY_DFP=~/avr/attiny_dfp ; fi + export MCU=attiny$ATTINY -export DFP=~/avr/attiny_dfp export CC=avr-gcc export OBJCOPY=avr-objcopy -export CFLAGS="-Wall -g -Os -mmcu=$MCU -c -std=gnu99 -fgnu89-inline -fwhole-program -DATTINY=$ATTINY -I.. -I../.. -I../../.. -fshort-enums -B $DFP/gcc/dev/$MCU/ -I $DFP/include/" -export OFLAGS="-Wall -g -Os -mmcu=$MCU -B $DFP/gcc/dev/$MCU/ -I $DFP/include/" +export DFPFLAGS="-B $ATTINY_DFP/gcc/dev/$MCU/ -I $ATTINY_DFP/include/" +export CFLAGS="-Wall -g -Os -mmcu=$MCU -c -std=gnu99 -fgnu89-inline -fwhole-program -DATTINY=$ATTINY -I.. -I../.. -I../../.. -fshort-enums $DFPFLAGS" +export OFLAGS="-Wall -g -Os -mmcu=$MCU $DFPFLAGS" export LDFLAGS="-fgnu89-inline" export OBJCOPYFLAGS='--set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0 --no-change-warnings -O ihex' export OBJS=$PROGRAM.o diff --git a/bin/flash-tiny1616.sh b/bin/flash-tiny1616.sh index 31c8406..44d716c 100755 --- a/bin/flash-tiny1616.sh +++ b/bin/flash-tiny1616.sh @@ -1,3 +1,14 @@ #/bin/sh FIRMWARE=$1 -avrdude -c jtag2updi -P /dev/ttyUSB0 -p t1616 -u -Uflash:w:$FIRMWARE
\ No newline at end of file +if [ -z "$AVRDUDE_TTYUSB" ]; then AVRDUDE_TTYUSB=/dev/ttyUSB0 ; fi + +# In your shell config: +# from https://github.com/ElTangas/jtag2updi ... +# export AVRDUDE_CONF="-C$HOME/path/to/jtag2updi/avrdude.conf" +# export AVRDUDE_TTYUSB="/dev/ttyUSB2" + +avrdude $AVRDUDE_CONF \ + -c jtag2updi \ + -P $AVRDUDE_TTYUSB \ + -p t1616 \ + -u -Uflash:w:$FIRMWARE |
