aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorSelene ToyKeeper2021-04-02 14:34:10 -0600
committerSelene ToyKeeper2021-04-02 14:34:10 -0600
commit7713133fedd51212eee10c8ed855e512820ff5fb (patch)
treeaca9e6bf2fb078aa50ad71800afeace32be61daa /bin
parentupdated MODELS file with missing K9.3-nofet build target (diff)
parentre-numbered t1616 builds to reflect manufacturer better (diff)
downloadanduril-7713133fedd51212eee10c8ed855e512820ff5fb.tar.gz
anduril-7713133fedd51212eee10c8ed855e512820ff5fb.tar.bz2
anduril-7713133fedd51212eee10c8ed855e512820ff5fb.zip
merged gchart's Tiny1 series branch for t1616 support
Diffstat (limited to 'bin')
-rwxr-xr-xbin/build.sh10
-rwxr-xr-xbin/flash-tiny1616.sh14
2 files changed, 22 insertions, 2 deletions
diff --git a/bin/build.sh b/bin/build.sh
index 3992c38..c733320 100755
--- a/bin/build.sh
+++ b/bin/build.sh
@@ -11,11 +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 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"
-export OFLAGS="-Wall -g -Os -mmcu=$MCU"
+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
new file mode 100755
index 0000000..44d716c
--- /dev/null
+++ b/bin/flash-tiny1616.sh
@@ -0,0 +1,14 @@
+#/bin/sh
+FIRMWARE=$1
+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
If you find this content useful please consider a small donation via bitcoin: bitcoin:1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2?amount=0.001&message=Donation Scraping git contents via cgit is very resource intensive. The continued hosting of these git repositories is entirely financed by your bitcoin contributions. For donations of a least 1 mBTC you include your IP address in the message of your bitcoin donation. This will remove this message in the future for requests from your IP, which will significantly reduce token usage. In any case, any contributions to bitcoin address 1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2 are very welcome. Thanks in advance for you contribution to a self-sustaining ecosystem.