diff options
Diffstat (limited to 'Bootloaders')
-rw-r--r-- | Bootloaders/CDC/makefile | 6 | ||||
-rw-r--r-- | Bootloaders/DFU/BootloaderDFU.c | 4 | ||||
-rw-r--r-- | Bootloaders/DFU/makefile | 6 |
3 files changed, 10 insertions, 6 deletions
diff --git a/Bootloaders/CDC/makefile b/Bootloaders/CDC/makefile index 3e43a168d..3b2e2db0b 100644 --- a/Bootloaders/CDC/makefile +++ b/Bootloaders/CDC/makefile @@ -86,11 +86,13 @@ F_CLOCK = $(F_CPU) # Starting byte address of the bootloader, as a byte address - computed via the formula -# BOOT_START = ((TOTAL_FLASH_BYTES - BOOTLOADER_SECTION_SIZE_BYTES) * 1024) +# BOOT_START = ((FLASH_SIZE_KB - BOOT_SECTION_SIZE_KB) * 1024) # # Note that the bootloader size and start address given in AVRStudio is in words and not # bytes, and so will need to be doubled to obtain the byte address needed by AVR-GCC. -BOOT_START = 0x1E000 +FLASH_SIZE_KB = 128 +BOOT_SECTION_SIZE_KB = 4 +BOOT_START = 0x$(shell echo "obase=16; ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024" | bc) # Output format. (can be srec, ihex, binary) diff --git a/Bootloaders/DFU/BootloaderDFU.c b/Bootloaders/DFU/BootloaderDFU.c index 2f5abba5c..41b3e37ba 100644 --- a/Bootloaders/DFU/BootloaderDFU.c +++ b/Bootloaders/DFU/BootloaderDFU.c @@ -38,9 +38,9 @@ /** Flag to indicate if the bootloader is currently running in secure mode, disallowing memory operations * other than erase. This is initially set to the value set by SECURE_MODE, and cleared by the bootloader - * once a memory erase has completed. + * once a memory erase has completed in a bootloader session. */ -bool IsSecure = SECURE_MODE; +bool IsSecure = SECURE_MODE; /** Flag to indicate if the bootloader should be running, or should exit and allow the application code to run * via a soft reset. When cleared, the bootloader will abort, the USB interface will shut down and the application diff --git a/Bootloaders/DFU/makefile b/Bootloaders/DFU/makefile index 061fb39b2..bcb908b1b 100644 --- a/Bootloaders/DFU/makefile +++ b/Bootloaders/DFU/makefile @@ -86,11 +86,13 @@ F_CLOCK = $(F_CPU) # Starting byte address of the bootloader, as a byte address - computed via the formula -# BOOT_START = ((TOTAL_FLASH_BYTES - BOOTLOADER_SECTION_SIZE_BYTES) * 1024) +# BOOT_START = ((FLASH_SIZE_KB - BOOT_SECTION_SIZE_KB) * 1024) # # Note that the bootloader size and start address given in AVRStudio is in words and not # bytes, and so will need to be doubled to obtain the byte address needed by AVR-GCC. -BOOT_START = 0x1E000 +FLASH_SIZE_KB = 128 +BOOT_SECTION_SIZE_KB = 4 +BOOT_START = 0x$(shell echo "obase=16; ($(FLASH_SIZE_KB) - $(BOOT_SECTION_SIZE_KB)) * 1024" | bc) # Output format. (can be srec, ihex, binary) |