From 083f7c88915db70e1c41997dc9dbd94249aca4e7 Mon Sep 17 00:00:00 2001 From: Zach Eveland Date: Wed, 14 Mar 2012 17:48:11 -0400 Subject: bugfix for Caterina not starting sketch if "verify upload" turned off in IDE. Previously, if avrdude skipped the upload step the read while write memory might never be reenabled. This would prevent the bootloader from ending and the sketch from starting - the bootloader just continued to run even after a successful upload. Now enable RWW when we receive the AVR109 "Exit bootloader" 'E' command. Had to disable lock bit changing support in the bootloader to free up flash for the change - will anyone miss it? --- bootloaders/caterina/Caterina.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'bootloaders/caterina/Caterina.c') diff --git a/bootloaders/caterina/Caterina.c b/bootloaders/caterina/Caterina.c index 0565b22..0cb9590 100755 --- a/bootloaders/caterina/Caterina.c +++ b/bootloaders/caterina/Caterina.c @@ -484,6 +484,10 @@ void CDC_Task(void) * subsequent requests */ Timeout = TIMEOUT_PERIOD - 500; + /* Re-enable RWW section - must be done here in case + * user has disabled verification on upload. */ + boot_rww_enable_safe(); + // Send confirmation byte back to the host WriteNextResponseByte('\r'); } @@ -592,6 +596,7 @@ void CDC_Task(void) } else if ((Command == 'B') || (Command == 'g')) { + // Keep resetting the timeout counter if we're receiving self-programming instructions Timeout = 0; // Delegate the block write/read to a separate function for clarity ReadWriteMemoryBlock(Command); -- cgit v1.2.3-18-g5258