From 185738b801b13cd59de87b9c514923534f91b6a9 Mon Sep 17 00:00:00 2001 From: majekw Date: Sat, 26 Sep 2015 20:28:03 +0200 Subject: [PATCH 01/11] Use STK_SW_MINOR/STK_SW_MAJOR instead of hardcoded 0x81/0x82 values. --- optiboot/bootloaders/optiboot/optiboot.c | 4 ++-- optiboot/bootloaders/optiboot/stk500.h | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/optiboot/bootloaders/optiboot/optiboot.c b/optiboot/bootloaders/optiboot/optiboot.c index 9beab24..8a851af 100644 --- a/optiboot/bootloaders/optiboot/optiboot.c +++ b/optiboot/bootloaders/optiboot/optiboot.c @@ -528,9 +528,9 @@ int main(void) { * Send optiboot version as "SW version" * Note that the references to memory are optimized away. */ - if (which == 0x82) { + if (which == STK_SW_MINOR) { putch(optiboot_version & 0xFF); - } else if (which == 0x81) { + } else if (which == STK_SW_MAJOR) { putch(optiboot_version >> 8); } else { /* diff --git a/optiboot/bootloaders/optiboot/stk500.h b/optiboot/bootloaders/optiboot/stk500.h index c75908c..420706a 100644 --- a/optiboot/bootloaders/optiboot/stk500.h +++ b/optiboot/bootloaders/optiboot/stk500.h @@ -42,3 +42,5 @@ #define STK_READ_OSCCAL 0x76 // 'v' #define STK_READ_FUSE_EXT 0x77 // 'w' #define STK_READ_OSCCAL_EXT 0x78 // 'x' +#define STK_SW_MAJOR 0x81 // ' ' +#define STK_SW_MINOR 0x82 // ' ' From 0fc72a8d17b85c71812272ae96712d0a59f6f682 Mon Sep 17 00:00:00 2001 From: jaseg Date: Fri, 16 Oct 2015 19:19:11 +0200 Subject: [PATCH 02/11] Add support for ATMega16 --- optiboot/bootloaders/optiboot/Makefile | 7 +++++++ optiboot/bootloaders/optiboot/optiboot.c | 15 ++++++++++----- optiboot/bootloaders/optiboot/pin_defs.h | 6 +++--- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/optiboot/bootloaders/optiboot/Makefile b/optiboot/bootloaders/optiboot/Makefile index 4767055..a886411 100644 --- a/optiboot/bootloaders/optiboot/Makefile +++ b/optiboot/bootloaders/optiboot/Makefile @@ -286,6 +286,13 @@ atmega168_isp: LFUSE ?= F7 atmega168_isp: EFUSE ?= 04 atmega168_isp: isp +atmega16: TARGET = atmega16 +atmega16: MCU_TARGET = atmega16 +atmega16: CFLAGS += $(COMMON_OPTIONS) +atmega16: AVR_FREQ ?= 16000000L +atmega16: $(PROGRAM)_atmega16.hex +atmega16: $(PROGRAM)_atmega16.lst + atmega328: TARGET = atmega328 atmega328: MCU_TARGET = atmega328p atmega328: CFLAGS += $(COMMON_OPTIONS) diff --git a/optiboot/bootloaders/optiboot/optiboot.c b/optiboot/bootloaders/optiboot/optiboot.c index 9beab24..df807ab 100644 --- a/optiboot/bootloaders/optiboot/optiboot.c +++ b/optiboot/bootloaders/optiboot/optiboot.c @@ -464,7 +464,7 @@ int main(void) { // If not, uncomment the following instructions: // cli(); asm volatile ("clr __zero_reg__"); -#if defined(__AVR_ATmega8__) || defined (__AVR_ATmega32__) +#if defined(__AVR_ATmega8__) || defined (__AVR_ATmega32__) || defined (__AVR_ATmega16__) SP=RAMEND; // This is done by hardware reset #endif @@ -474,8 +474,13 @@ int main(void) { * can leave multiple reset flags set; we only want the bootloader to * run on an 'external reset only' status */ +#if !defined(__AVR_ATmega16__) ch = MCUSR; MCUSR = 0; +#else + ch = MCUCSR; + MCUCSR = 0; +#endif if (ch & (_BV(WDRF) | _BV(BORF) | _BV(PORF))) appStart(ch); @@ -485,7 +490,7 @@ int main(void) { #endif #ifndef SOFT_UART -#if defined(__AVR_ATmega8__) || defined (__AVR_ATmega32__) +#if defined(__AVR_ATmega8__) || defined (__AVR_ATmega32__) || defined (__AVR_ATmega16__) UCSRA = _BV(U2X); //Double speed mode USART UCSRB = _BV(RXEN) | _BV(TXEN); // enable Rx & Tx UCSRC = _BV(URSEL) | _BV(UCSZ1) | _BV(UCSZ0); // config USART; 8N1 @@ -711,7 +716,7 @@ uint8_t getch(void) { uint8_t ch; #ifdef LED_DATA_FLASH -#if defined(__AVR_ATmega8__) || defined (__AVR_ATmega32__) +#if defined(__AVR_ATmega8__) || defined (__AVR_ATmega32__) || defined (__AVR_ATmega16__) LED_PORT ^= _BV(LED); #else LED_PIN |= _BV(LED); @@ -762,7 +767,7 @@ uint8_t getch(void) { #endif #ifdef LED_DATA_FLASH -#if defined(__AVR_ATmega8__) || defined (__AVR_ATmega32__) +#if defined(__AVR_ATmega8__) || defined (__AVR_ATmega32__) || defined (__AVR_ATmega16__) LED_PORT ^= _BV(LED); #else LED_PIN |= _BV(LED); @@ -811,7 +816,7 @@ void flash_led(uint8_t count) { TCNT1 = -(F_CPU/(1024*16)); TIFR1 = _BV(TOV1); while(!(TIFR1 & _BV(TOV1))); -#if defined(__AVR_ATmega8__) || defined (__AVR_ATmega32__) +#if defined(__AVR_ATmega8__) || defined (__AVR_ATmega32__) || defined (__AVR_ATmega16__) LED_PORT ^= _BV(LED); #else LED_PIN |= _BV(LED); diff --git a/optiboot/bootloaders/optiboot/pin_defs.h b/optiboot/bootloaders/optiboot/pin_defs.h index f4eabcb..6570671 100644 --- a/optiboot/bootloaders/optiboot/pin_defs.h +++ b/optiboot/bootloaders/optiboot/pin_defs.h @@ -71,7 +71,7 @@ # define UART_UDR UDR3 #endif -#if defined(__AVR_ATmega8__) || defined(__AVR_ATmega32__) +#if defined(__AVR_ATmega8__) || defined (__AVR_ATmega32__) || defined (__AVR_ATmega16__) //Name conversion R.Wiersma #define UCSR0A UCSRA #define UDR0 UDR @@ -81,7 +81,7 @@ #define TIFR1 TIFR #define WDTCSR WDTCR #endif -#if defined(__AVR_ATmega32__) +#if defined (__AVR_ATmega32__) || defined (__AVR_ATmega16__) #define WDCE WDTOE #endif @@ -106,7 +106,7 @@ /*------------------------------------------------------------------------ */ /* Sanguino support (and other 40pin DIP cpus) */ -#if defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__) || defined(__AVR_ATmega32__) +#if defined(__AVR_ATmega644P__) || defined(__AVR_ATmega1284P__) || defined(__AVR_ATmega32__) || defined (__AVR_ATmega16__) /*------------------------------------------------------------------------ */ /* Onboard LED is connected to pin PB0 on Sanguino */ #if !defined(LED) From b246a1394ef5658ad0875b96f586f51addde0c02 Mon Sep 17 00:00:00 2001 From: Sven Wegener Date: Sun, 1 Nov 2015 17:37:29 +0100 Subject: [PATCH 03/11] makeall: reorder targets to put generic targets last Signed-off-by: Sven Wegener --- optiboot/bootloaders/optiboot/makeall | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/optiboot/bootloaders/optiboot/makeall b/optiboot/bootloaders/optiboot/makeall index 2fe7b73..9288d48 100755 --- a/optiboot/bootloaders/optiboot/makeall +++ b/optiboot/bootloaders/optiboot/makeall @@ -18,15 +18,15 @@ make atmega32 make atmega88 make atmega168p +# +# Atmel development board targets +make xplained168pb +make xplained328p +make xplained328pb + # # The "big three" standard bootloaders. # These need to be built AFTER the platforms, or they'll get renamed make atmega8 make atmega168 make atmega328 - -# -# Atmel development board targets -make xplained168pb -make xplained328p -make xplained328pb From 85dccd8e27dc22eadbdddcbaa3d025456597769f Mon Sep 17 00:00:00 2001 From: fra87 Date: Mon, 28 Dec 2015 21:53:25 +0100 Subject: [PATCH 04/11] Modified the test_reset.ino example. In this new version, the program gives more meaningful strings about the reset source (no more "Unknown" when more sources are triggered). Moreover the program will not wait for some time before triggering a WDT reset, and clearly asks the user to press a button to reset using that peripheral Finally, since this program should only run once, the majority of the program is moved to the setup function rather than the loop --- optiboot/examples/test_reset/test_reset.ino | 69 +++++++++++---------- 1 file changed, 35 insertions(+), 34 deletions(-) diff --git a/optiboot/examples/test_reset/test_reset.ino b/optiboot/examples/test_reset/test_reset.ino index 9f1af05..f0db737 100644 --- a/optiboot/examples/test_reset/test_reset.ino +++ b/optiboot/examples/test_reset/test_reset.ino @@ -36,47 +36,48 @@ void resetFlagsInit(void) void setup() { Serial.begin(9600); // Initialize serial port -} - -void loop() { + Serial.println("Reset flag test"); - while (Serial.read() < 0) - ; // wait for some type-in - + Serial.print("Have reset flag value 0x"); Serial.print(resetFlags, HEX); + /* * check for the usual bits. Note that the symnbols defined in wdt.h are * bit numbers, so they have to be shifted before comparison. */ - switch (resetFlags) { - case 1< Date: Sat, 6 Feb 2016 01:28:55 -0800 Subject: [PATCH 05/11] Fix some fuse and lockbit value errors, add Atmel Xplained Mini boards --- optiboot/boards-1.6.txt | 97 ++++++++++++++++++++++++++++++++++++++--- optiboot/boards.txt | 86 ++++++++++++++++++++++++++++++++++++ 2 files changed, 177 insertions(+), 6 deletions(-) diff --git a/optiboot/boards-1.6.txt b/optiboot/boards-1.6.txt index c572e68..44dbe13 100644 --- a/optiboot/boards-1.6.txt +++ b/optiboot/boards-1.6.txt @@ -20,7 +20,7 @@ optiboot28.upload.speed=115200 optiboot28.bootloader.tool=arduino:avrdude optiboot28.bootloader.low_fuses=0xF7 -optiboot28.bootloader.unlock_bits=0x0F +optiboot28.bootloader.unlock_bits=0x3F optiboot28.bootloader.lock_bits=0x2F optiboot28.build.f_cpu=16000000L @@ -107,7 +107,6 @@ optiboot28.menu.cpu.atmega8.upload.maximum_data_size=1024 optiboot28.menu.cpu.atmega8.bootloader.high_fuses=0xCC optiboot28.menu.cpu.atmega8.bootloader.low_fuses=0xBF -optiboot28.menu.cpu.8MHz.bootloader.low_fuses=0xE2 # optiboot28.menu.cpu.atmega8.bootloader.extended_fuses=0x00 optiboot28.menu.cpu.atmega8.bootloader.file=optiboot/optiboot_atmega8.hex @@ -139,8 +138,8 @@ optiboot32.upload.speed=115200 optiboot32.bootloader.tool=arduino:avrdude optiboot32.bootloader.low_fuses=0xF7 -optiboot32.bootloader.unlock_bits=0x2F -optiboot32.bootloader.lock_bits=0x0F +optiboot32.bootloader.unlock_bits=0x3F +optiboot32.bootloader.lock_bits=0x2F optiboot32.build.f_cpu=16000000L # @@ -269,8 +268,8 @@ optiboot1284.build.variant=arduino:standard optiboot1284.upload.maximum_size=130048 optiboot1284.upload.maximum_data_size=16384 -# Select full swing crystal oscillator (7F rather than FF) -optiboot1284.bootloader.low_fuses=0x7F +# Select full swing crystal oscillator (F7 rather than FF) +optiboot1284.bootloader.low_fuses=0xF7 optiboot1284.bootloader.high_fuses=0xDE optiboot1284.bootloader.extended_fuses=0x05 optiboot1284.bootloader.file=optiboot/optiboot_atmega1284p.hex @@ -345,3 +344,89 @@ optiboott84.upload.maximum_size=7600 optiboott84.upload.maximum_data_size=512 optiboott84.build.mcu=attiny84 + +############################################################## + +optibootxmini168b.name=Optiboot Xplained Mini 168pb + +optibootxmini168b.upload.tool=arduino:avrdude +optibootxmini168b.upload.protocol=arduino +optibootxmini168b.upload.speed=57600 + +optibootxmini168b.bootloader.tool=arduino:avrdude +optibootxmini168b.bootloader.unlock_bits=0x3F +optibootxmini168b.bootloader.lock_bits=0x2F + +optibootxmini168b.build.f_cpu=16000000L + +optibootxmini168b.build.board=AVR_UNO +optibootxmini168b.build.core=arduino:arduino +optibootxmini168b.build.variant=arduino:standard + +optibootxmini168b.upload.maximum_size=15872 +optibootxmini168b.upload.maximum_data_size=1024 + +optibootxmini168b.bootloader.low_fuses=0xBF +optibootxmini168b.bootloader.high_fuses=0xCE +optibootxmini168b.bootloader.extended_fuses=0xFF +optibootxmini168b.bootloader.file=optiboot/optiboot_xplained168b.hex + +optibootxmini168b.build.mcu=atmega168 + +############################# + + +optibootxmini328pb.name=Optiboot Xplained Mini 328pb + +optibootxmini328pb.upload.tool=arduino:avrdude +optibootxmini328pb.upload.protocol=arduino +optibootxmini328pb.upload.speed=57600 + +optibootxmini328pb.bootloader.tool=arduino:avrdude +optibootxmini328pb.bootloader.unlock_bits=0x3F +optibootxmini328pb.bootloader.lock_bits=0x2F + +optibootxmini328pb.build.f_cpu=16000000L + +optibootxmini328pb.build.board=AVR_UNO +optibootxmini328pb.build.core=arduino:arduino +optibootxmini328pb.build.variant=arduino:standard + +optibootxmini328pb.upload.maximum_size=32128 +optibootxmini328pb.upload.maximum_data_size=1024 + +optibootxmini328pb.bootloader.low_fuses=0xBF +optibootxmini328pb.bootloader.high_fuses=0xCE +optibootxmini328pb.bootloader.extended_fuses=0xFF +optibootxmini328pb.bootloader.file=optiboot/optiboot_xplained328pb.hex + +optibootxmini328pb.build.mcu=atmega328p + +############################# + + +optibootxmini328p.name=Optiboot Xplained Mini 328p + +optibootxmini328p.upload.tool=arduino:avrdude +optibootxmini328p.upload.protocol=arduino +optibootxmini328p.upload.speed=57600 + +optibootxmini328p.bootloader.tool=arduino:avrdude +optibootxmini328p.bootloader.unlock_bits=0x3F +optibootxmini328p.bootloader.lock_bits=0x2F + +optibootxmini328p.build.f_cpu=16000000L + +optibootxmini328p.build.board=AVR_UNO +optibootxmini328p.build.core=arduino:arduino +optibootxmini328p.build.variant=arduino:standard + +optibootxmini328p.upload.maximum_size=32128 +optibootxmini328p.upload.maximum_data_size=1024 + +optibootxmini328p.bootloader.low_fuses=0xBF +optibootxmini328p.bootloader.high_fuses=0xCE +optibootxmini328p.bootloader.extended_fuses=0xFF +optibootxmini328p.bootloader.file=optiboot/optiboot_xplained328p.hex + +optibootxmini328p.build.mcu=atmega328p diff --git a/optiboot/boards.txt b/optiboot/boards.txt index 94a6131..a23b0ae 100644 --- a/optiboot/boards.txt +++ b/optiboot/boards.txt @@ -245,3 +245,89 @@ atmega1284o.build.mcu=atmega1284p atmega1284o.build.f_cpu=16000000L atmega1284o.build.core=arduino:arduino atmega1284o.build.variant=arduino:standard + +############################################################## + +optibootxmini168b.name=Optiboot Xplained Mini 168pb + +optibootxmini168b.upload.tool=arduino:avrdude +optibootxmini168b.upload.protocol=arduino +optibootxmini168b.upload.speed=57600 + +optibootxmini168b.bootloader.tool=arduino:avrdude +optibootxmini168b.bootloader.unlock_bits=0x3F +optibootxmini168b.bootloader.lock_bits=0x2F + +optibootxmini168b.build.f_cpu=16000000L + +optibootxmini168b.build.board=AVR_UNO +optibootxmini168b.build.core=arduino:arduino +optibootxmini168b.build.variant=arduino:standard + +optibootxmini168b.upload.maximum_size=15872 +optibootxmini168b.upload.maximum_data_size=1024 + +optibootxmini168b.bootloader.low_fuses=0xBF +optibootxmini168b.bootloader.high_fuses=0xCE +optibootxmini168b.bootloader.extended_fuses=0xFF +optibootxmini168b.bootloader.file=optiboot/optiboot_xplained168b.hex + +optibootxmini168b.build.mcu=atmega168 + +############################# + + +optibootxmini328pb.name=Optiboot Xplained Mini 328pb + +optibootxmini328pb.upload.tool=arduino:avrdude +optibootxmini328pb.upload.protocol=arduino +optibootxmini328pb.upload.speed=57600 + +optibootxmini328pb.bootloader.tool=arduino:avrdude +optibootxmini328pb.bootloader.unlock_bits=0x3F +optibootxmini328pb.bootloader.lock_bits=0x2F + +optibootxmini328pb.build.f_cpu=16000000L + +optibootxmini328pb.build.board=AVR_UNO +optibootxmini328pb.build.core=arduino:arduino +optibootxmini328pb.build.variant=arduino:standard + +optibootxmini328pb.upload.maximum_size=32128 +optibootxmini328pb.upload.maximum_data_size=1024 + +optibootxmini328pb.bootloader.low_fuses=0xBF +optibootxmini328pb.bootloader.high_fuses=0xCE +optibootxmini328pb.bootloader.extended_fuses=0xFF +optibootxmini328pb.bootloader.file=optiboot/optiboot_xplained328pb.hex + +optibootxmini328pb.build.mcu=atmega328p + +############################# + + +optibootxmini328p.name=Optiboot Xplained Mini 328p + +optibootxmini328p.upload.tool=arduino:avrdude +optibootxmini328p.upload.protocol=arduino +optibootxmini328p.upload.speed=57600 + +optibootxmini328p.bootloader.tool=arduino:avrdude +optibootxmini328p.bootloader.unlock_bits=0x3F +optibootxmini328p.bootloader.lock_bits=0x2F + +optibootxmini328p.build.f_cpu=16000000L + +optibootxmini328p.build.board=AVR_UNO +optibootxmini328p.build.core=arduino:arduino +optibootxmini328p.build.variant=arduino:standard + +optibootxmini328p.upload.maximum_size=32128 +optibootxmini328p.upload.maximum_data_size=1024 + +optibootxmini328p.bootloader.low_fuses=0xBF +optibootxmini328p.bootloader.high_fuses=0xCE +optibootxmini328p.bootloader.extended_fuses=0xFF +optibootxmini328p.bootloader.file=optiboot/optiboot_xplained328p.hex + +optibootxmini328p.build.mcu=atmega328p From 814e2a89bdf54e806c13640bfdead2033bcfad72 Mon Sep 17 00:00:00 2001 From: WestfW Date: Sat, 6 Feb 2016 01:36:55 -0800 Subject: [PATCH 06/11] Fix some typos, improve some comments --- optiboot/bootloaders/optiboot/Makefile.atmel | 16 +++++++++++++--- optiboot/release.sh | 8 +++++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/optiboot/bootloaders/optiboot/Makefile.atmel b/optiboot/bootloaders/optiboot/Makefile.atmel index 2b3a120..d14b6c9 100644 --- a/optiboot/bootloaders/optiboot/Makefile.atmel +++ b/optiboot/bootloaders/optiboot/Makefile.atmel @@ -1,6 +1,16 @@ -# Diecimila, Duemilanove with m168, and NG use identical bootloaders -# Call it "atmega168" for generality and clarity, keep "diecimila" for -# backward compatibility of makefile +# +# Support for the Atmel Xplained mini eval boards that are mostly +# compatible with Arduino. (168pb, 328p, and 328pb chips.) +# +# Currently these all masquerade as 168 or 328p, because the IDE +# does not yet have compiler support for the -pb variants. +# +# These boards have an mEDBG debug chip that: +# 1) means that optiboot can only be programmed via Atmel Studio +# 2) prevents optiboot from working at 115200bps. +# 3) provides 16MHz (at 5V) via Xin on the chip. +# +# # xplained168pb: TARGET = $@ xplained168pb: CHIP = atmega168 diff --git a/optiboot/release.sh b/optiboot/release.sh index aaf5b79..3bbe933 100644 --- a/optiboot/release.sh +++ b/optiboot/release.sh @@ -1,5 +1,7 @@ #%/bin/bash - +# +# Use like: "sh release.sh " +# # Build a "release" .zip file for Optiboot bootloader # Run from the build directory @@ -28,14 +30,14 @@ mkdir -p $TOP/libraries/ # mkdir -p $TOP/system/ # -# Copy files from whereever into the release director +# Copy files from whereever into the release directory cp ../../boards-1.6.txt $TOP/boards.txt #cp -R ../../examples $TOP/libraries/ #cp -R ../../variants $TOP/ #cp -R ../../system $TOP/ # -# Create platform.tx, because it contains the "group" name for the boards menu +# Create platform.txt, because it contains the "group" name for the boards menu echo name=Optiboot $1 > $TOP/platform.txt echo version=$1 >> $TOP/platform.txt From 219d90e4e78e3960ddcc1888f76a5110f5e8cb26 Mon Sep 17 00:00:00 2001 From: Nebula83 Date: Wed, 27 Jul 2016 21:51:56 +0200 Subject: [PATCH 07/11] Update pin_defs.h Added __AVR_ATmega328__ to the list of supported targets --- optiboot/bootloaders/optiboot/pin_defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/optiboot/bootloaders/optiboot/pin_defs.h b/optiboot/bootloaders/optiboot/pin_defs.h index 6570671..6a45631 100644 --- a/optiboot/bootloaders/optiboot/pin_defs.h +++ b/optiboot/bootloaders/optiboot/pin_defs.h @@ -12,7 +12,7 @@ */ /*------------------------------------------------------------------------ */ -#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega168P__) || defined(__AVR_ATmega328P__) || defined(__AVR_ATmega88) || defined(__AVR_ATmega8__) || defined(__AVR_ATmega88__) +#if defined(__AVR_ATmega168__) || defined(__AVR_ATmega168P__) || defined(__AVR_ATmega328__) || defined(__AVR_ATmega328P__) || defined(__AVR_ATmega88) || defined(__AVR_ATmega8__) || defined(__AVR_ATmega88__) /*------------------------------------------------------------------------ */ /* Onboard LED is connected to pin PB5 in Arduino NG, Diecimila, and Duemilanove From 7a0b60db08ebc49686ee552048c37e814cc4bacc Mon Sep 17 00:00:00 2001 From: Christopher Date: Wed, 14 Sep 2016 14:46:44 -0500 Subject: [PATCH 08/11] Solution to #187 Tested on Arduino IDE 1.6.11. --- optiboot/examples/test_reset/test_reset.ino | 1 + 1 file changed, 1 insertion(+) diff --git a/optiboot/examples/test_reset/test_reset.ino b/optiboot/examples/test_reset/test_reset.ino index f0db737..69f002b 100644 --- a/optiboot/examples/test_reset/test_reset.ino +++ b/optiboot/examples/test_reset/test_reset.ino @@ -23,6 +23,7 @@ uint8_t resetFlags __attribute__ ((section(".noinit"))); * to the variable. Again, avr-gcc provides special code sections for this. */ void resetFlagsInit(void) __attribute__ ((naked)) + __attribute__ ((used)) __attribute__ ((section (".init0"))); void resetFlagsInit(void) { From 1e277d9b79943a5d85aa33c1a99d652652b4899d Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Fri, 23 Sep 2016 12:03:19 +0200 Subject: [PATCH 09/11] Fix warning when LED_START_FLASHES is 0 flash_led() would be declared but not defined, which causes a warning for static functions. --- optiboot/bootloaders/optiboot/optiboot.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/optiboot/bootloaders/optiboot/optiboot.c b/optiboot/bootloaders/optiboot/optiboot.c index df807ab..08aa906 100644 --- a/optiboot/bootloaders/optiboot/optiboot.c +++ b/optiboot/bootloaders/optiboot/optiboot.c @@ -359,7 +359,9 @@ void __attribute__((noinline)) verifySpace(); void __attribute__((noinline)) watchdogConfig(uint8_t x); static inline void getNch(uint8_t); +#if LED_START_FLASHES > 0 static inline void flash_led(uint8_t); +#endif static inline void watchdogReset(); static inline void writebuffer(int8_t memtype, uint8_t *mybuff, uint16_t address, pagelen_t len); From 0eb5e3710a961754d978a5f86a8d3fbe1e588751 Mon Sep 17 00:00:00 2001 From: WestfW Date: Sun, 25 Sep 2016 23:39:55 -0700 Subject: [PATCH 10/11] Update "install" instructions --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/README.md b/README.md index 4bc3c3b..a8c74e3 100644 --- a/README.md +++ b/README.md @@ -16,12 +16,29 @@ Optiboot is now installed by default on the Arduino Uno. It can be installed on ## Additional Documentation More detailed documentation is being added (slowly) to the [repository wiki](https://github.com/Optiboot/optiboot/wiki). +## Notes on IDE Version compatability +Optiboot in "compatible", it a loose sense, will all versions of the Arduino IDE. It was originally written at about the same time as v1.0, and has some "quirks" that date back to that timeframe. Most significantly, install procedures and locations change between releases, and the ability to compile optiboot using only the tools installed with the IDE broke in the v1.5 timeframe. + ## To install into the Arduino software ## +You do NOT need to "install" Optiboot if you are trying to update an installed platform that already uses some form of Optiboot. In that case, you should probably just find and replace the existing .hex files from the platform support directories. Using the optiboot "install" procedure does not install any cores or variants, so it is only useful for cpus that are already supported by the standard Arduino core. (or, if all you want to do is install bootloaders.) + +The following instructions are based on using the Arduino "Board Manager", present in IDE versions 1.6.5 and later. + + 1. Find the desired Optiboot release on the [Optiboot Rlease page] (https://github.com/Optiboot/optiboot/releases). + 2. Use the "Copy Link" feature of your browswer copy the URL of the associated **.json** file. + 3. Paste this url into the "Additional Boards Manager URLs" field in the Arduino IDE "Preferences" pane. (Separate it from other URLs that might be present with a comma.) + 4. After closing the preferences pain, the **Tools/Boards/Boards Manager** menu should include an entry for that version of Optiboot. Select that entry and click the **Install** button. + +For addition installation information, see the [Optiboot AddingOptibootChipsToIde Wiki page] (https://github.com/Optiboot/optiboot/wiki/AddingOptibootChipsToIde) + + + ## To burn Optiboot onto an Arduino board ## 1. Select the appropriate Optiboot board type (or non-Optiboot if you want to change back) From 89f16443c2ef8e6075dc542e7d9b865c30e6715d Mon Sep 17 00:00:00 2001 From: Snafu Date: Fri, 14 Oct 2016 03:11:56 +0200 Subject: [PATCH 11/11] Fixed UART 3 check If UART 3 is selected it should be checked if UDR3 is defined and not if UDR1 is defined. --- optiboot/bootloaders/optiboot/pin_defs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/optiboot/bootloaders/optiboot/pin_defs.h b/optiboot/bootloaders/optiboot/pin_defs.h index 6570671..a352e06 100644 --- a/optiboot/bootloaders/optiboot/pin_defs.h +++ b/optiboot/bootloaders/optiboot/pin_defs.h @@ -61,7 +61,7 @@ # define UART_SRL UBRR2L # define UART_UDR UDR2 #elif UART == 3 -#if !defined(UDR1) +#if !defined(UDR3) #error UART == 3, but no UART3 on device #endif # define UART_SRA UCSR3A