summaryrefslogtreecommitdiffstats
path: root/firmware/Makefile
diff options
context:
space:
mode:
authorJenna Fox <a@creativepony.com>2012-09-26 01:09:14 +1000
committerJenna Fox <a@creativepony.com>2012-09-26 01:09:14 +1000
commit9c15f6e5caee526aa429112318df096ec7b46355 (patch)
treeaf34087b945f96a244137e875d52462bd6b4a817 /firmware/Makefile
parent7b20da73c9a0ed03d32c2f9e654367900cb1e06f (diff)
downloadmicronucleus-9c15f6e5caee526aa429112318df096ec7b46355.tar.gz
micronucleus-9c15f6e5caee526aa429112318df096ec7b46355.tar.bz2
micronucleus-9c15f6e5caee526aa429112318df096ec7b46355.zip
instructions in makefile on how to calculate BOOTLOADER_ADDRESS
Diffstat (limited to 'firmware/Makefile')
-rw-r--r--firmware/Makefile11
1 files changed, 7 insertions, 4 deletions
diff --git a/firmware/Makefile b/firmware/Makefile
index 0e38760..403786a 100644
--- a/firmware/Makefile
+++ b/firmware/Makefile
@@ -17,13 +17,16 @@
F_CPU = 16500000
DEVICE = attiny85
-# BOOTLOADER_ADDRESS is 1800 for 8k devices, 3800 for 16k and 7800 for 32k.
-# Can be on the start of any flash page for ATtiny85, but must be set low enough so there is space for the full boot loader
-# BOOTLOADER_ADDRESS is in units of 4 bytes seems like
-BOOTLOADER_ADDRESS = 1740
FUSEOPT = $(FUSEOPT_t85)
LOCKOPT = -U lock:w:0x2f:m
+# hexadecimal address for bootloader section to begin. To calculate the best value:
+# - make clean; make main.hex; ### output will list data: 2124 (or something like that)
+# - for the size of your device (8kb = 1024 * 8 = 8192) subtract above value 2124... = 6068
+# - How many pages in is that? 6068 / 64 (tiny85 page size in bytes) = 94.8125
+# - round that down to 94 - our new bootloader address is 94 * 64 = 6016, in hex = 1780
+BOOTLOADER_ADDRESS = 1780
+
PROGRAMMER = -c USBasp
# PROGRAMMER contains AVRDUDE options to address your programmer