Your Name 5 years ago
parent
commit
f90dbb9179

+ 2 - 1
Install_tools/install_pi.sh

@@ -1,6 +1,6 @@
 #!/bin/bash
 #!/bin/bash
 sudo apt-get update
 sudo apt-get update
-sudo apt-get install -y build-essential bison flex automake libelf-dev libusb-1.0-0-dev libusb-dev libftdi-dev libftdi1
+sudo apt-get install -y build-essential bison flex automake libelf-dev libusb-1.0-0-dev libusb-dev libftdi-dev libftdi1 zip unzip
 wget http://download.savannah.gnu.org/releases/avrdude/avrdude-6.1.tar.gz
 wget http://download.savannah.gnu.org/releases/avrdude/avrdude-6.1.tar.gz
 tar xvfz avrdude-6.1.tar.gz
 tar xvfz avrdude-6.1.tar.gz
 cd avrdude-6.1
 cd avrdude-6.1
@@ -32,3 +32,4 @@ EOF
 sudo cp ~/avrdude_gpio.conf /usr/local/etc/avrdude.conf
 sudo cp ~/avrdude_gpio.conf /usr/local/etc/avrdude.conf
 
 
 echo ""
 echo ""
+sudo avrdude -c linuxgpio -p atmega328p -v

+ 2 - 0
Install_tools/m328p.sh

@@ -0,0 +1,2 @@
+#!/bin/bash
+sudo avrdude -c linuxgpio -p m328p -v -e -U flash:w:optiboot_atmega328.hex -U lock:w:0x0F:m

+ 0 - 0
optiboot/bootloaders/optiboot/optiboot_atmega328.hex → Install_tools/optiboot_atmega328.hex


+ 1 - 2
optiboot/bootloaders/optiboot/README.TXT

@@ -84,8 +84,7 @@ The older makefiles default to using a USB programmer, but you can use a
 serial programmer like ArduinoISP by changing the appropriate variables
 serial programmer like ArduinoISP by changing the appropriate variables
 when you invoke make:
 when you invoke make:
 
 
-   make ISPTOOL=stk500v1 ISPPORT=/dev/tty.usbserial-A20e1eAN  \
-        ISPSPEED=-b19200 atmega328_isp
+   make ISPTOOL=stk500v1 ISPSPEED=-b19200 atmega328_isp
 
 
 The "atmega8_isp" target does not currently work, because the mega8
 The "atmega8_isp" target does not currently work, because the mega8
 doesn't have the "extended" fuse that the generic ISP target wants to
 doesn't have the "extended" fuse that the generic ISP target wants to

+ 0 - 57
optiboot/bootloaders/optiboot/optiboot_atmega1280.hex

@@ -1,57 +0,0 @@
-:020000021000EC
-:10FC000012E0A0E0B2E0ECEAFEEF01E00BBF02C0C0
-:10FC100007900D92AC39B107D9F701C021C1112469
-:10FC200084B7882369F0982F9A70923049F081FF49
-:10FC300002C097EF94BF282E80E0FDD00C94000006
-:10FC400085E08093810082E08093C00088E180930A
-:10FC5000C10086E08093C20080E18093C4008EE002
-:10FC6000EAD0279A86E020E33CEF91E030938500CC
-:10FC70002093840096BBB09BFECF1F9AA89540911D
-:10FC8000C00047FD02C0815089F7FF24F39455E07E
-:10FC9000E52E61E1D62EC3D08134C1F4C0D0C82F87
-:10FCA000D0D0C23809F43AC0C13869F488E00CC039
-:10FCB000843709F482C0853709F0A2C0C2D08EE132
-:10FCC000A7D087E9A5D083E0A3D09FC0823411F4E8
-:10FCD00084E103C0853419F485E0BBD096C0853536
-:10FCE00079F49DD0082F9BD0182F87FF03C08BB7C6
-:10FCF000816002C08BB78E7F8BBF000F111F84C045
-:10FD0000863581F48CD08D3459F489D0CBB787D027
-:10FD1000C170880FC82BCBBF81E09BD080E0D4CFCF
-:10FD200083E0FBCF843609F0C3CF79D0C82FD0E071
-:10FD3000DC2FCC2774D0C82B72D0C82E5E01812C4A
-:10FD400032E0932E6CD0F40181934F01F1E0AF1AB1
-:10FD5000B108C1F776D085E4C81212C0DE5F480151
-:10FD6000A12C92E0B92EAC16BD0609F44EC0F501E7
-:10FD700061915F01C4018CD0FFEF8F1A9F0AF3CF0E
-:10FD800083E0F80187BFE89507B600FCFDCFA0E04F
-:10FD9000B2E0F8018D919D910C01F7BEE895112418
-:10FDA000229732962097B1F7F801E7BEE89507B69B
-:10FDB00000FCFDCFD7BEE89528C031D0C82FD0E0D9
-:10FDC000DC2FCC272CD05E01A82A29D0982E39D040
-:10FDD000E801F5E49F120BC0CE0152D019D081E0AA
-:10FDE000A81AB1082196A114B104B1F70EC0FE0102
-:10FDF0008791EF010DD0E1E0AE1AB108C1F705C05F
-:10FE0000813511F488E017D01CD080E101D043CFB8
-:10FE10009091C00095FFFCCF8093C600089580911B
-:10FE2000C00087FFFCCF8091C00084FD01C0A89571
-:10FE30008091C6000895E0E6F0E098E19083808329
-:10FE40000895EDDF803219F088E0F5DFFFCF84E11F
-:10FE5000DFCFCF93C82FE3DFC150E9F7CF91F1CFC8
-:10FE6000FC010A0167BFE895112407B600FCFDCF2D
-:10FE7000667029F0452B19F481E187BFE895089554
-:10FE8000F999FECF92BD81BDF89A992780B5089562
-:10FE9000262FF999FECF1FBA92BD81BD20BD0FB6A6
-:0CFEA000F894FA9AF99A0FBE01960895A2
-:10FEAC0056657273696F6E3D382E30004F50544951
-:10FEBC00424F4F545F435553544F4D5645523D306E
-:10FECC00004465766963653D61746D6567613132C7
-:10FEDC00383000465F4350553D313630303030308D
-:10FEEC00304C00424947424F4F543D3100427569F6
-:10FEFC006C743A53657020323020323031383A30DD
-:10FF0C00313A31383A343300554152543D30004285
-:10FF1C004155445F524154453D313135323030000A
-:10FF2C004C45443D4237004C45445F535441525478
-:0CFF3C005F464C41534845533D330000E4
-:02FFFE000008F9
-:040000031000FC00ED
-:00000001FF

+ 0 - 797
optiboot/bootloaders/optiboot/optiboot_atmega1280.lst

@@ -1,797 +0,0 @@
-
-optiboot_atmega1280.elf:     file format elf32-avr
-
-Sections:
-Idx Name          Size      VMA       LMA       File off  Algn
-  0 .data         0000009c  00800200  0001feac  00000340  2**0
-                  CONTENTS, ALLOC, LOAD, DATA
-  1 .text         000002ac  0001fc00  0001fc00  00000094  2**1
-                  CONTENTS, ALLOC, LOAD, READONLY, CODE
-  2 .version      00000002  0001fffe  0001fffe  000003dc  2**0
-                  CONTENTS, ALLOC, LOAD, READONLY, DATA
-  3 .comment      0000002f  00000000  00000000  000003de  2**0
-                  CONTENTS, READONLY
-  4 .debug_aranges 00000030  00000000  00000000  0000040d  2**0
-                  CONTENTS, READONLY, DEBUGGING
-  5 .debug_info   000007b5  00000000  00000000  0000043d  2**0
-                  CONTENTS, READONLY, DEBUGGING
-  6 .debug_abbrev 000002c5  00000000  00000000  00000bf2  2**0
-                  CONTENTS, READONLY, DEBUGGING
-  7 .debug_line   000003c0  00000000  00000000  00000eb7  2**0
-                  CONTENTS, READONLY, DEBUGGING
-  8 .debug_frame  0000009c  00000000  00000000  00001278  2**2
-                  CONTENTS, READONLY, DEBUGGING
-  9 .debug_str    0000028c  00000000  00000000  00001314  2**0
-                  CONTENTS, READONLY, DEBUGGING
- 10 .debug_loc    00000449  00000000  00000000  000015a0  2**0
-                  CONTENTS, READONLY, DEBUGGING
- 11 .debug_ranges 00000080  00000000  00000000  000019e9  2**0
-                  CONTENTS, READONLY, DEBUGGING
-
-Disassembly of section .text:
-
-0001fc00 <__ctors_end>:
-   1fc00:	12 e0       	ldi	r17, 0x02	; 2
-   1fc02:	a0 e0       	ldi	r26, 0x00	; 0
-   1fc04:	b2 e0       	ldi	r27, 0x02	; 2
-   1fc06:	ec ea       	ldi	r30, 0xAC	; 172
-   1fc08:	fe ef       	ldi	r31, 0xFE	; 254
-   1fc0a:	01 e0       	ldi	r16, 0x01	; 1
-   1fc0c:	0b bf       	out	0x3b, r16	; 59
-   1fc0e:	02 c0       	rjmp	.+4      	; 0x1fc14 <__ctors_end+0x14>
-   1fc10:	07 90       	elpm	r0, Z+
-   1fc12:	0d 92       	st	X+, r0
-   1fc14:	ac 39       	cpi	r26, 0x9C	; 156
-   1fc16:	b1 07       	cpc	r27, r17
-   1fc18:	d9 f7       	brne	.-10     	; 0x1fc10 <__ctors_end+0x10>
-
-0001fc1a <pre_main>:
-/* everything that needs to run VERY early */
-void pre_main(void) {
-  // Allow convenient way of calling do_spm function - jump table,
-  //   so entry to this function will always be here, indepedent of compilation,
-  //   features etc
-  asm volatile (
-   1fc1a:	01 c0       	rjmp	.+2      	; 0x1fc1e <main>
-   1fc1c:	21 c1       	rjmp	.+578    	; 0x1fe60 <do_spm>
-
-0001fc1e <main>:
-  //  SP points to RAMEND
-  //  r1 contains zero
-  //
-  // If not, uncomment the following instructions:
-  // cli();
-  asm volatile ("clr __zero_reg__");
-   1fc1e:	11 24       	eor	r1, r1
-#if defined(__AVR_ATmega8515__) || defined(__AVR_ATmega8535__) ||	\
-    defined(__AVR_ATmega16__)   || defined(__AVR_ATmega162__) ||	\
-    defined (__AVR_ATmega128__)
-  ch = MCUCSR;
-#else
-  ch = MCUSR;
-   1fc20:	84 b7       	in	r24, 0x34	; 52
-#endif
-  // Skip all logic and run bootloader if MCUSR is cleared (application request)
-  if (ch != 0) {
-   1fc22:	88 23       	and	r24, r24
-   1fc24:	69 f0       	breq	.+26     	; 0x1fc40 <main+0x22>
-       *  2. we clear WDRF if it's set with EXTRF to avoid loops
-       * One problematic scenario: broken application code sets watchdog timer 
-       * without clearing MCUSR before and triggers it quickly. But it's
-       * recoverable by power-on with pushed reset button.
-       */
-      if ((ch & (_BV(WDRF) | _BV(EXTRF))) != _BV(EXTRF)) { 
-   1fc26:	98 2f       	mov	r25, r24
-   1fc28:	9a 70       	andi	r25, 0x0A	; 10
-   1fc2a:	92 30       	cpi	r25, 0x02	; 2
-   1fc2c:	49 f0       	breq	.+18     	; 0x1fc40 <main+0x22>
-	  if (ch & _BV(EXTRF)) {
-   1fc2e:	81 ff       	sbrs	r24, 1
-   1fc30:	02 c0       	rjmp	.+4      	; 0x1fc36 <main+0x18>
-    defined(__AVR_ATmega16__)   || defined(__AVR_ATmega162__) ||	\
-    defined(__AVR_ATmega128__)
-               // Fix missing definitions in avr-libc
-	      MCUCSR = ~(_BV(WDRF));
-#else
-	      MCUSR = ~(_BV(WDRF));
-   1fc32:	97 ef       	ldi	r25, 0xF7	; 247
-   1fc34:	94 bf       	out	0x34, r25	; 52
-	  /* 
-	   * save the reset flags in the designated register
-	   * This can be saved in a main program by putting code in .init0 (which
-	   * executes before normal c init code) to save R2 to a global variable.
-	   */
-	  __asm__ __volatile__ ("mov r2, %0\n" :: "r" (ch));
-   1fc36:	28 2e       	mov	r2, r24
-
-	  // switch off watchdog
-	  watchdogConfig(WATCHDOG_OFF);
-   1fc38:	80 e0       	ldi	r24, 0x00	; 0
-   1fc3a:	fd d0       	rcall	.+506    	; 0x1fe36 <watchdogConfig>
-	  // Note that appstart_vec is defined so that this works with either
-	  // real or virtual boot partitions.
-	   __asm__ __volatile__ (
-   1fc3c:	0c 94 00 00 	jmp	0	; 0x0 <__tmp_reg__>
-      }
-  }
-
-#if LED_START_FLASHES > 0
-  // Set up Timer 1 for timeout counter
-  TCCR1B = _BV(CS12) | _BV(CS10); // div 1024
-   1fc40:	85 e0       	ldi	r24, 0x05	; 5
-   1fc42:	80 93 81 00 	sts	0x0081, r24	; 0x800081 <__TEXT_REGION_LENGTH__+0x7e0081>
-  LINBTR = (1 << LDISR) | (8 << LBT0); 
-  LINCR = _BV(LENA) | _BV(LCMD2) | _BV(LCMD1) | _BV(LCMD0); 
-  LINDAT=0;
-    #else
-      #ifndef SINGLESPEED
-  UART_SRA = _BV(U2X0); //Double speed mode USART0
-   1fc46:	82 e0       	ldi	r24, 0x02	; 2
-   1fc48:	80 93 c0 00 	sts	0x00C0, r24	; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7e00c0>
-      #endif
-  UART_SRB = _BV(RXEN0) | _BV(TXEN0);
-   1fc4c:	88 e1       	ldi	r24, 0x18	; 24
-   1fc4e:	80 93 c1 00 	sts	0x00C1, r24	; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7e00c1>
-  UART_SRC = _BV(UCSZ00) | _BV(UCSZ01);
-   1fc52:	86 e0       	ldi	r24, 0x06	; 6
-   1fc54:	80 93 c2 00 	sts	0x00C2, r24	; 0x8000c2 <__TEXT_REGION_LENGTH__+0x7e00c2>
-  UART_SRL = (uint8_t)BAUD_SETTING;
-   1fc58:	80 e1       	ldi	r24, 0x10	; 16
-   1fc5a:	80 93 c4 00 	sts	0x00C4, r24	; 0x8000c4 <__TEXT_REGION_LENGTH__+0x7e00c4>
-    #endif // LIN_UART
-  #endif // mega8/etc
-#endif // soft_uart
-
-  // Set up watchdog to trigger after 1s
-  watchdogConfig(WATCHDOG_1S);
-   1fc5e:	8e e0       	ldi	r24, 0x0E	; 14
-   1fc60:	ea d0       	rcall	.+468    	; 0x1fe36 <watchdogConfig>
-
-#if (LED_START_FLASHES > 0) || defined(LED_DATA_FLASH) || defined(LED_START_ON)
-  /* Set LED pin as output */
-  LED_DDR |= _BV(LED);
-   1fc62:	27 9a       	sbi	0x04, 7	; 4
-   1fc64:	86 e0       	ldi	r24, 0x06	; 6
-}
-
-#if LED_START_FLASHES > 0
-void flash_led(uint8_t count) {
-  do {
-    TCNT1 = -(F_CPU/(1024*16));
-   1fc66:	20 e3       	ldi	r18, 0x30	; 48
-   1fc68:	3c ef       	ldi	r19, 0xFC	; 252
-    TIFR1 = _BV(TOV1);
-   1fc6a:	91 e0       	ldi	r25, 0x01	; 1
-}
-
-#if LED_START_FLASHES > 0
-void flash_led(uint8_t count) {
-  do {
-    TCNT1 = -(F_CPU/(1024*16));
-   1fc6c:	30 93 85 00 	sts	0x0085, r19	; 0x800085 <__TEXT_REGION_LENGTH__+0x7e0085>
-   1fc70:	20 93 84 00 	sts	0x0084, r18	; 0x800084 <__TEXT_REGION_LENGTH__+0x7e0084>
-    TIFR1 = _BV(TOV1);
-   1fc74:	96 bb       	out	0x16, r25	; 22
-    while(!(TIFR1 & _BV(TOV1)));
-   1fc76:	b0 9b       	sbis	0x16, 0	; 22
-   1fc78:	fe cf       	rjmp	.-4      	; 0x1fc76 <main+0x58>
-    defined(__AVR_ATmega8535__) || defined(__AVR_ATmega16__)   ||	\
-    defined(__AVR_ATmega162__)  || defined(__AVR_ATmega32__)   ||	\
-    defined(__AVR_ATmega64__)   || defined(__AVR_ATmega128__)
-    LED_PORT ^= _BV(LED);
-#else
-    LED_PIN |= _BV(LED);
-   1fc7a:	1f 9a       	sbi	0x03, 7	; 3
-}
-#endif
-
-// Watchdog functions. These are only safe with interrupts turned off.
-void watchdogReset() {
-  __asm__ __volatile__ (
-   1fc7c:	a8 95       	wdr
-     *  by the UART hardware, avrdude sends several attempts in rather
-     *  quick succession, some of which will be lost and cause us to
-     *  get out of sync.  So if we see any data; stop blinking.
-     */
-#ifndef LIN_UART
-    if (UART_SRA & _BV(RXC0))
-   1fc7e:	40 91 c0 00 	lds	r20, 0x00C0	; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7e00c0>
-   1fc82:	47 fd       	sbrc	r20, 7
-   1fc84:	02 c0       	rjmp	.+4      	; 0x1fc8a <main+0x6c>
-   1fc86:	81 50       	subi	r24, 0x01	; 1
-#else
-// This doesn't seem to work?
-//    if ((UART_PIN & (1<<UART_RX_BIT)) == 0)
-//	break;  // detect start bit on soft uart too.
-#endif
-  } while (--count);
-   1fc88:	89 f7       	brne	.-30     	; 0x1fc6c <main+0x4e>
-
-	    /*
-	     * Copy data from the buffer into the flash write buffer.
-	     */
-	    do {
-		__boot_page_fill_short((uint16_t)(void*)addrPtr, *(mybuff.wptr++));
-   1fc8a:	ff 24       	eor	r15, r15
-   1fc8c:	f3 94       	inc	r15
-	    } while (len -= 2);
-
-	    /*
-	     * Actually Write the buffer to flash (and wait for it to finish.)
-	     */
-	    __boot_page_write_short(address.word);
-   1fc8e:	55 e0       	ldi	r21, 0x05	; 5
-   1fc90:	e5 2e       	mov	r14, r21
-	    boot_spm_busy_wait();
-#if defined(RWWSRE)
-	    // Reenable read access to flash
-	    __boot_rww_enable_short();
-   1fc92:	61 e1       	ldi	r22, 0x11	; 17
-#endif
-
-  /* Forever loop: exits by causing WDT reset */
-  for (;;) {
-    /* get character from UART */
-    ch = getch();
-   1fc94:	d6 2e       	mov	r13, r22
-
-    if(ch == STK_GET_PARAMETER) {
-   1fc96:	c3 d0       	rcall	.+390    	; 0x1fe1e <getch>
-      unsigned char which = getch();
-   1fc98:	81 34       	cpi	r24, 0x41	; 65
-   1fc9a:	c1 f4       	brne	.+48     	; 0x1fccc <main+0xae>
-   1fc9c:	c0 d0       	rcall	.+384    	; 0x1fe1e <getch>
-      verifySpace();
-   1fc9e:	c8 2f       	mov	r28, r24
-   1fca0:	d0 d0       	rcall	.+416    	; 0x1fe42 <verifySpace>
-      /*
-       * Send optiboot version as "SW version"
-       * Note that the references to memory are optimized away.
-       */
-      if (which == STK_SW_MINOR) {
-   1fca2:	c2 38       	cpi	r28, 0x82	; 130
-   1fca4:	09 f4       	brne	.+2      	; 0x1fca8 <main+0x8a>
-   1fca6:	3a c0       	rjmp	.+116    	; 0x1fd1c <main+0xfe>
-	  putch(optiboot_version & 0xFF);
-      } else if (which == STK_SW_MAJOR) {
-   1fca8:	c1 38       	cpi	r28, 0x81	; 129
-   1fcaa:	69 f4       	brne	.+26     	; 0x1fcc6 <main+0xa8>
-	  putch(optiboot_version >> 8);
-   1fcac:	88 e0       	ldi	r24, 0x08	; 8
-   1fcae:	0c c0       	rjmp	.+24     	; 0x1fcc8 <main+0xaa>
-      writebuffer(desttype, buff, address, savelength);
-
-
-    }
-    /* Read memory block mode, length is big endian.  */
-    else if(ch == STK_READ_PAGE) {
-   1fcb0:	84 37       	cpi	r24, 0x74	; 116
-   1fcb2:	09 f4       	brne	.+2      	; 0x1fcb6 <main+0x98>
-
-      read_mem(desttype, address, length);
-    }
-
-    /* Get device signature bytes  */
-    else if(ch == STK_READ_SIGN) {
-   1fcb4:	82 c0       	rjmp	.+260    	; 0x1fdba <main+0x19c>
-   1fcb6:	85 37       	cpi	r24, 0x75	; 117
-      // READ SIGN - return what Avrdude wants to hear
-      verifySpace();
-   1fcb8:	09 f0       	breq	.+2      	; 0x1fcbc <main+0x9e>
-      putch(SIGNATURE_0);
-   1fcba:	a2 c0       	rjmp	.+324    	; 0x1fe00 <main+0x1e2>
-   1fcbc:	c2 d0       	rcall	.+388    	; 0x1fe42 <verifySpace>
-   1fcbe:	8e e1       	ldi	r24, 0x1E	; 30
-      putch(SIGNATURE_1);
-   1fcc0:	a7 d0       	rcall	.+334    	; 0x1fe10 <putch>
-   1fcc2:	87 e9       	ldi	r24, 0x97	; 151
-   1fcc4:	a5 d0       	rcall	.+330    	; 0x1fe10 <putch>
-      } else {
-	/*
-	 * GET PARAMETER returns a generic 0x03 reply for
-         * other parameters - enough to keep Avrdude happy
-	 */
-	putch(0x03);
-   1fcc6:	83 e0       	ldi	r24, 0x03	; 3
-   1fcc8:	a3 d0       	rcall	.+326    	; 0x1fe10 <putch>
-   1fcca:	9f c0       	rjmp	.+318    	; 0x1fe0a <main+0x1ec>
-      }
-    }
-    else if(ch == STK_SET_DEVICE) {
-   1fccc:	82 34       	cpi	r24, 0x42	; 66
-   1fcce:	11 f4       	brne	.+4      	; 0x1fcd4 <main+0xb6>
-      // SET DEVICE is ignored
-      getNch(20);
-   1fcd0:	84 e1       	ldi	r24, 0x14	; 20
-    }
-    else if(ch == STK_SET_DEVICE_EXT) {
-   1fcd2:	03 c0       	rjmp	.+6      	; 0x1fcda <main+0xbc>
-      // SET DEVICE EXT is ignored
-      getNch(5);
-   1fcd4:	85 34       	cpi	r24, 0x45	; 69
-   1fcd6:	19 f4       	brne	.+6      	; 0x1fcde <main+0xc0>
-   1fcd8:	85 e0       	ldi	r24, 0x05	; 5
-   1fcda:	bb d0       	rcall	.+374    	; 0x1fe52 <getNch>
-    }
-    else if(ch == STK_LOAD_ADDRESS) {
-   1fcdc:	96 c0       	rjmp	.+300    	; 0x1fe0a <main+0x1ec>
-   1fcde:	85 35       	cpi	r24, 0x55	; 85
-      // LOAD ADDRESS
-      address.bytes[0] = getch();
-   1fce0:	79 f4       	brne	.+30     	; 0x1fd00 <main+0xe2>
-   1fce2:	9d d0       	rcall	.+314    	; 0x1fe1e <getch>
-   1fce4:	08 2f       	mov	r16, r24
-      address.bytes[1] = getch();
-   1fce6:	9b d0       	rcall	.+310    	; 0x1fe1e <getch>
-   1fce8:	18 2f       	mov	r17, r24
-   1fcea:	87 ff       	sbrs	r24, 7
-#ifdef RAMPZ
-      // Transfer top bit to LSB in RAMPZ
-      if (address.bytes[1] & 0x80) {
-   1fcec:	03 c0       	rjmp	.+6      	; 0x1fcf4 <main+0xd6>
-        RAMPZ |= 0x01;
-   1fcee:	8b b7       	in	r24, 0x3b	; 59
-   1fcf0:	81 60       	ori	r24, 0x01	; 1
-      }
-      else {
-        RAMPZ &= 0xFE;
-   1fcf2:	02 c0       	rjmp	.+4      	; 0x1fcf8 <main+0xda>
-   1fcf4:	8b b7       	in	r24, 0x3b	; 59
-      }
-#endif
-      address.word *= 2; // Convert from word address to byte address
-   1fcf6:	8e 7f       	andi	r24, 0xFE	; 254
-   1fcf8:	8b bf       	out	0x3b, r24	; 59
-   1fcfa:	00 0f       	add	r16, r16
-      verifySpace();
-    }
-    else if(ch == STK_UNIVERSAL) {
-   1fcfc:	11 1f       	adc	r17, r17
-#ifdef RAMPZ
-      // LOAD_EXTENDED_ADDRESS is needed in STK_UNIVERSAL for addressing more than 128kB
-      if ( AVR_OP_LOAD_EXT_ADDR == getch() ) {
-   1fcfe:	84 c0       	rjmp	.+264    	; 0x1fe08 <main+0x1ea>
-   1fd00:	86 35       	cpi	r24, 0x56	; 86
-   1fd02:	81 f4       	brne	.+32     	; 0x1fd24 <main+0x106>
-   1fd04:	8c d0       	rcall	.+280    	; 0x1fe1e <getch>
-        // get address
-        getch();  // get '0'
-   1fd06:	8d 34       	cpi	r24, 0x4D	; 77
-   1fd08:	59 f4       	brne	.+22     	; 0x1fd20 <main+0x102>
-        RAMPZ = (RAMPZ & 0x01) | ((getch() << 1) & 0xff);  // get address and put it in RAMPZ
-   1fd0a:	89 d0       	rcall	.+274    	; 0x1fe1e <getch>
-   1fd0c:	cb b7       	in	r28, 0x3b	; 59
-   1fd0e:	87 d0       	rcall	.+270    	; 0x1fe1e <getch>
-   1fd10:	c1 70       	andi	r28, 0x01	; 1
-   1fd12:	88 0f       	add	r24, r24
-   1fd14:	c8 2b       	or	r28, r24
-        getNch(1); // get last '0'
-   1fd16:	cb bf       	out	0x3b, r28	; 59
-   1fd18:	81 e0       	ldi	r24, 0x01	; 1
-        // response
-        putch(0x00);
-   1fd1a:	9b d0       	rcall	.+310    	; 0x1fe52 <getNch>
-   1fd1c:	80 e0       	ldi	r24, 0x00	; 0
-      }
-      else {
-        // everything else is ignored
-        getNch(3);
-   1fd1e:	d4 cf       	rjmp	.-88     	; 0x1fcc8 <main+0xaa>
-   1fd20:	83 e0       	ldi	r24, 0x03	; 3
-      getNch(4);
-      putch(0x00);
-#endif
-    }
-    /* Write memory, length is big endian and is in bytes */
-    else if(ch == STK_PROG_PAGE) {
-   1fd22:	fb cf       	rjmp	.-10     	; 0x1fd1a <main+0xfc>
-   1fd24:	84 36       	cpi	r24, 0x64	; 100
-      // PROGRAM PAGE - we support flash programming only, not EEPROM
-      uint8_t desttype;
-      uint8_t *bufPtr;
-      pagelen_t savelength;
-
-      GETLENGTH(length);
-   1fd26:	09 f0       	breq	.+2      	; 0x1fd2a <main+0x10c>
-   1fd28:	c3 cf       	rjmp	.-122    	; 0x1fcb0 <main+0x92>
-   1fd2a:	79 d0       	rcall	.+242    	; 0x1fe1e <getch>
-   1fd2c:	c8 2f       	mov	r28, r24
-   1fd2e:	d0 e0       	ldi	r29, 0x00	; 0
-   1fd30:	dc 2f       	mov	r29, r28
-   1fd32:	cc 27       	eor	r28, r28
-   1fd34:	74 d0       	rcall	.+232    	; 0x1fe1e <getch>
-      savelength = length;
-      desttype = getch();
-   1fd36:	c8 2b       	or	r28, r24
-   1fd38:	72 d0       	rcall	.+228    	; 0x1fe1e <getch>
-   1fd3a:	c8 2e       	mov	r12, r24
-      // PROGRAM PAGE - we support flash programming only, not EEPROM
-      uint8_t desttype;
-      uint8_t *bufPtr;
-      pagelen_t savelength;
-
-      GETLENGTH(length);
-   1fd3c:	5e 01       	movw	r10, r28
-      savelength = length;
-      desttype = getch();
-   1fd3e:	81 2c       	mov	r8, r1
-   1fd40:	32 e0       	ldi	r19, 0x02	; 2
-   1fd42:	93 2e       	mov	r9, r19
-
-      // read a page worth of contents
-      bufPtr = buff.bptr;
-      do *bufPtr++ = getch();
-   1fd44:	6c d0       	rcall	.+216    	; 0x1fe1e <getch>
-   1fd46:	f4 01       	movw	r30, r8
-   1fd48:	81 93       	st	Z+, r24
-   1fd4a:	4f 01       	movw	r8, r30
-   1fd4c:	f1 e0       	ldi	r31, 0x01	; 1
-      while (--length);
-   1fd4e:	af 1a       	sub	r10, r31
-   1fd50:	b1 08       	sbc	r11, r1
-   1fd52:	c1 f7       	brne	.-16     	; 0x1fd44 <main+0x126>
-
-      // Read command terminator, start reply
-      verifySpace();
-   1fd54:	76 d0       	rcall	.+236    	; 0x1fe42 <verifySpace>
-   1fd56:	85 e4       	ldi	r24, 0x45	; 69
- * void writebuffer(memtype, buffer, address, length)
- */
-static inline void writebuffer(int8_t memtype, addr16_t mybuff,
-			       addr16_t address, pagelen_t len)
-{
-    switch (memtype) {
-   1fd58:	c8 12       	cpse	r12, r24
-   1fd5a:	12 c0       	rjmp	.+36     	; 0x1fd80 <main+0x162>
-   1fd5c:	de 5f       	subi	r29, 0xFE	; 254
-   1fd5e:	48 01       	movw	r8, r16
-   1fd60:	a1 2c       	mov	r10, r1
-   1fd62:	92 e0       	ldi	r25, 0x02	; 2
-   1fd64:	b9 2e       	mov	r11, r25
-   1fd66:	ac 16       	cp	r10, r28
-    case 'E': // EEPROM
-#if defined(SUPPORT_EEPROM) || defined(BIGBOOT)
-        while(len--) {
-   1fd68:	bd 06       	cpc	r11, r29
-   1fd6a:	09 f4       	brne	.+2      	; 0x1fd6e <main+0x150>
-   1fd6c:	4e c0       	rjmp	.+156    	; 0x1fe0a <main+0x1ec>
-   1fd6e:	f5 01       	movw	r30, r10
-	    eeprom_write_byte((address.bptr++), *(mybuff.bptr++));
-   1fd70:	61 91       	ld	r22, Z+
-   1fd72:	5f 01       	movw	r10, r30
-   1fd74:	c4 01       	movw	r24, r8
-   1fd76:	8c d0       	rcall	.+280    	; 0x1fe90 <eeprom_write_byte>
-   1fd78:	ff ef       	ldi	r31, 0xFF	; 255
-   1fd7a:	8f 1a       	sub	r8, r31
-   1fd7c:	9f 0a       	sbc	r9, r31
-   1fd7e:	f3 cf       	rjmp	.-26     	; 0x1fd66 <main+0x148>
-   1fd80:	83 e0       	ldi	r24, 0x03	; 3
-   1fd82:	f8 01       	movw	r30, r16
-	     * and we needed the space back.
-	     */
-#ifdef FOURPAGEERASE
-	    if ((address.bytes[0] & ((SPM_PAGESIZE<<2)-1))==0) {
-#endif
-	    __boot_page_erase_short(address.word);
-   1fd84:	87 bf       	out	0x37, r24	; 55
-   1fd86:	e8 95       	spm
-   1fd88:	07 b6       	in	r0, 0x37	; 55
-   1fd8a:	00 fc       	sbrc	r0, 0
-	    boot_spm_busy_wait();
-   1fd8c:	fd cf       	rjmp	.-6      	; 0x1fd88 <main+0x16a>
-   1fd8e:	a0 e0       	ldi	r26, 0x00	; 0
-   1fd90:	b2 e0       	ldi	r27, 0x02	; 2
-   1fd92:	f8 01       	movw	r30, r16
-   1fd94:	8d 91       	ld	r24, X+
-
-	    /*
-	     * Copy data from the buffer into the flash write buffer.
-	     */
-	    do {
-		__boot_page_fill_short((uint16_t)(void*)addrPtr, *(mybuff.wptr++));
-   1fd96:	9d 91       	ld	r25, X+
-   1fd98:	0c 01       	movw	r0, r24
-   1fd9a:	f7 be       	out	0x37, r15	; 55
-   1fd9c:	e8 95       	spm
-   1fd9e:	11 24       	eor	r1, r1
-		addrPtr += 2;
-	    } while (len -= 2);
-   1fda0:	22 97       	sbiw	r28, 0x02	; 2
-   1fda2:	32 96       	adiw	r30, 0x02	; 2
-   1fda4:	20 97       	sbiw	r28, 0x00	; 0
-
-	    /*
-	     * Actually Write the buffer to flash (and wait for it to finish.)
-	     */
-	    __boot_page_write_short(address.word);
-   1fda6:	b1 f7       	brne	.-20     	; 0x1fd94 <main+0x176>
-   1fda8:	f8 01       	movw	r30, r16
-   1fdaa:	e7 be       	out	0x37, r14	; 55
-	    boot_spm_busy_wait();
-   1fdac:	e8 95       	spm
-#if defined(RWWSRE)
-	    // Reenable read access to flash
-	    __boot_rww_enable_short();
-   1fdae:	07 b6       	in	r0, 0x37	; 55
-   1fdb0:	00 fc       	sbrc	r0, 0
-   1fdb2:	fd cf       	rjmp	.-6      	; 0x1fdae <main+0x190>
-
-    }
-    /* Read memory block mode, length is big endian.  */
-    else if(ch == STK_READ_PAGE) {
-      uint8_t desttype;
-      GETLENGTH(length);
-   1fdb4:	d7 be       	out	0x37, r13	; 55
-   1fdb6:	e8 95       	spm
-   1fdb8:	28 c0       	rjmp	.+80     	; 0x1fe0a <main+0x1ec>
-   1fdba:	31 d0       	rcall	.+98     	; 0x1fe1e <getch>
-   1fdbc:	c8 2f       	mov	r28, r24
-   1fdbe:	d0 e0       	ldi	r29, 0x00	; 0
-   1fdc0:	dc 2f       	mov	r29, r28
-   1fdc2:	cc 27       	eor	r28, r28
-   1fdc4:	2c d0       	rcall	.+88     	; 0x1fe1e <getch>
-
-      desttype = getch();
-   1fdc6:	5e 01       	movw	r10, r28
-   1fdc8:	a8 2a       	or	r10, r24
-   1fdca:	29 d0       	rcall	.+82     	; 0x1fe1e <getch>
-
-      verifySpace();
-   1fdcc:	98 2e       	mov	r9, r24
-   1fdce:	39 d0       	rcall	.+114    	; 0x1fe42 <verifySpace>
-   1fdd0:	e8 01       	movw	r28, r16
-
-static inline void read_mem(uint8_t memtype, addr16_t address, pagelen_t length)
-{
-    uint8_t ch;
-
-    switch (memtype) {
-   1fdd2:	f5 e4       	ldi	r31, 0x45	; 69
-
-#if defined(SUPPORT_EEPROM) || defined(BIGBOOT)
-    case 'E': // EEPROM
-	do {
-	    putch(eeprom_read_byte((address.bptr++)));
-   1fdd4:	9f 12       	cpse	r9, r31
-   1fdd6:	0b c0       	rjmp	.+22     	; 0x1fdee <main+0x1d0>
-   1fdd8:	ce 01       	movw	r24, r28
-   1fdda:	52 d0       	rcall	.+164    	; 0x1fe80 <eeprom_read_byte>
-	} while (--length);
-   1fddc:	19 d0       	rcall	.+50     	; 0x1fe10 <putch>
-   1fdde:	81 e0       	ldi	r24, 0x01	; 1
-   1fde0:	a8 1a       	sub	r10, r24
-   1fde2:	b1 08       	sbc	r11, r1
-   1fde4:	21 96       	adiw	r28, 0x01	; 1
-   1fde6:	a1 14       	cp	r10, r1
-   1fde8:	b1 04       	cpc	r11, r1
-   1fdea:	b1 f7       	brne	.-20     	; 0x1fdd8 <main+0x1ba>
-	    // Since RAMPZ should already be set, we need to use EPLM directly.
-	    // Also, we can use the autoincrement version of lpm to update "address"
-	    //      do putch(pgm_read_byte_near(address++));
-	    //      while (--length);
-	    // read a Flash and increment the address (may increment RAMPZ)
-	    __asm__ ("elpm %0,Z+\n" : "=r" (ch), "=z" (address.bptr): "1" (address));
-   1fdec:	0e c0       	rjmp	.+28     	; 0x1fe0a <main+0x1ec>
-   1fdee:	fe 01       	movw	r30, r28
-   1fdf0:	87 91       	elpm	r24, Z+
-#else
-	    // read a Flash byte and increment the address
-	    __asm__ ("lpm %0,Z+\n" : "=r" (ch), "=z" (address.bptr): "1" (address));
-#endif
-	    putch(ch);
-   1fdf2:	ef 01       	movw	r28, r30
-   1fdf4:	0d d0       	rcall	.+26     	; 0x1fe10 <putch>
-	} while (--length);
-   1fdf6:	e1 e0       	ldi	r30, 0x01	; 1
-   1fdf8:	ae 1a       	sub	r10, r30
-   1fdfa:	b1 08       	sbc	r11, r1
-   1fdfc:	c1 f7       	brne	.-16     	; 0x1fdee <main+0x1d0>
-   1fdfe:	05 c0       	rjmp	.+10     	; 0x1fe0a <main+0x1ec>
-      verifySpace();
-      putch(SIGNATURE_0);
-      putch(SIGNATURE_1);
-      putch(SIGNATURE_2);
-    }
-    else if (ch == STK_LEAVE_PROGMODE) { /* 'Q' */
-   1fe00:	81 35       	cpi	r24, 0x51	; 81
-   1fe02:	11 f4       	brne	.+4      	; 0x1fe08 <main+0x1ea>
-      // Adaboot no-wait mod
-      watchdogConfig(WATCHDOG_16MS);
-   1fe04:	88 e0       	ldi	r24, 0x08	; 8
-   1fe06:	17 d0       	rcall	.+46     	; 0x1fe36 <watchdogConfig>
-   1fe08:	1c d0       	rcall	.+56     	; 0x1fe42 <verifySpace>
-      verifySpace();
-    }
-    else {
-      // This covers the response to commands like STK_ENTER_PROGMODE
-      verifySpace();
-   1fe0a:	80 e1       	ldi	r24, 0x10	; 16
-   1fe0c:	01 d0       	rcall	.+2      	; 0x1fe10 <putch>
-    }
-    putch(STK_OK);
-   1fe0e:	43 cf       	rjmp	.-378    	; 0x1fc96 <main+0x78>
-
-0001fe10 <putch>:
-   1fe10:	90 91 c0 00 	lds	r25, 0x00C0	; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7e00c0>
-  }
-   1fe14:	95 ff       	sbrs	r25, 5
-}
-
-void putch(char ch) {
-#ifndef SOFT_UART
-  #ifndef LIN_UART
-    while (!(UART_SRA & _BV(UDRE0))) {  /* Spin */ }
-   1fe16:	fc cf       	rjmp	.-8      	; 0x1fe10 <putch>
-  #else
-    while (!(LINSIR & _BV(LTXOK)))   {  /* Spin */ }
-  #endif
-
-  UART_UDR = ch;
-   1fe18:	80 93 c6 00 	sts	0x00C6, r24	; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7e00c6>
-   1fe1c:	08 95       	ret
-
-0001fe1e <getch>:
-    :
-      "r25"
-);
-#else
-#ifndef LIN_UART
-  while(!(UART_SRA & _BV(RXC0)))  {  /* Spin */ }
-   1fe1e:	80 91 c0 00 	lds	r24, 0x00C0	; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7e00c0>
-   1fe22:	87 ff       	sbrs	r24, 7
-   1fe24:	fc cf       	rjmp	.-8      	; 0x1fe1e <getch>
-  if (!(UART_SRA & _BV(FE0))) {
-   1fe26:	80 91 c0 00 	lds	r24, 0x00C0	; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7e00c0>
-   1fe2a:	84 fd       	sbrc	r24, 4
-   1fe2c:	01 c0       	rjmp	.+2      	; 0x1fe30 <getch+0x12>
-}
-#endif
-
-// Watchdog functions. These are only safe with interrupts turned off.
-void watchdogReset() {
-  __asm__ __volatile__ (
-   1fe2e:	a8 95       	wdr
-       * don't care that an invalid char is returned...)
-       */
-    watchdogReset();
-  }
-
-  ch = UART_UDR;
-   1fe30:	80 91 c6 00 	lds	r24, 0x00C6	; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7e00c6>
-  LED_PIN |= _BV(LED);
-#endif
-#endif
-
-  return ch;
-}
-   1fe34:	08 95       	ret
-
-0001fe36 <watchdogConfig>:
-}
-
-void watchdogConfig(uint8_t x) {
-#ifdef WDCE //does it have a Watchdog Change Enable?
- #ifdef WDTCSR
-  WDTCSR = _BV(WDCE) | _BV(WDE);
-   1fe36:	e0 e6       	ldi	r30, 0x60	; 96
-   1fe38:	f0 e0       	ldi	r31, 0x00	; 0
-   1fe3a:	98 e1       	ldi	r25, 0x18	; 24
-   1fe3c:	90 83       	st	Z, r25
-#else //then it must be one of those newfangled ones that use CCP
-  CCP=0xD8; //so write this magic number to CCP
-#endif 
-
-#ifdef WDTCSR
-  WDTCSR = x;
-   1fe3e:	80 83       	st	Z, r24
-   1fe40:	08 95       	ret
-
-0001fe42 <verifySpace>:
-  do getch(); while (--count);
-  verifySpace();
-}
-
-void verifySpace() {
-  if (getch() != CRC_EOP) {
-   1fe42:	ed df       	rcall	.-38     	; 0x1fe1e <getch>
-   1fe44:	80 32       	cpi	r24, 0x20	; 32
-   1fe46:	19 f0       	breq	.+6      	; 0x1fe4e <verifySpace+0xc>
-    watchdogConfig(WATCHDOG_16MS);    // shorten WD timeout
-   1fe48:	88 e0       	ldi	r24, 0x08	; 8
-   1fe4a:	f5 df       	rcall	.-22     	; 0x1fe36 <watchdogConfig>
-   1fe4c:	ff cf       	rjmp	.-2      	; 0x1fe4c <verifySpace+0xa>
-    while (1)			      // and busy-loop so that WD causes
-      ;				      //  a reset and app start.
-  }
-  putch(STK_INSYNC);
-   1fe4e:	84 e1       	ldi	r24, 0x14	; 20
-   1fe50:	df cf       	rjmp	.-66     	; 0x1fe10 <putch>
-
-0001fe52 <getNch>:
-    ::[count] "M" (UART_B_VALUE)
-  );
-}
-#endif
-
-void getNch(uint8_t count) {
-   1fe52:	cf 93       	push	r28
-   1fe54:	c8 2f       	mov	r28, r24
-  do getch(); while (--count);
-   1fe56:	e3 df       	rcall	.-58     	; 0x1fe1e <getch>
-   1fe58:	c1 50       	subi	r28, 0x01	; 1
-   1fe5a:	e9 f7       	brne	.-6      	; 0x1fe56 <getNch+0x4>
-  verifySpace();
-}
-   1fe5c:	cf 91       	pop	r28
-}
-#endif
-
-void getNch(uint8_t count) {
-  do getch(); while (--count);
-  verifySpace();
-   1fe5e:	f1 cf       	rjmp	.-30     	; 0x1fe42 <verifySpace>
-
-0001fe60 <do_spm>:
-   1fe60:	fc 01       	movw	r30, r24
- *   data=0 in WRITE
- */
-static void do_spm(uint16_t address, uint8_t command, uint16_t data)  __attribute__ ((used));
-static void do_spm(uint16_t address, uint8_t command, uint16_t data) {
-    // Do spm stuff
-    asm volatile (
-   1fe62:	0a 01       	movw	r0, r20
-   1fe64:	67 bf       	out	0x37, r22	; 55
-   1fe66:	e8 95       	spm
-   1fe68:	11 24       	eor	r1, r1
-   1fe6a:	07 b6       	in	r0, 0x37	; 55
-    );
-
-    // wait for spm to complete
-    //   it doesn't have much sense for __BOOT_PAGE_FILL,
-    //   but it doesn't hurt and saves some bytes on 'if'
-    boot_spm_busy_wait();
-   1fe6c:	00 fc       	sbrc	r0, 0
-   1fe6e:	fd cf       	rjmp	.-6      	; 0x1fe6a <do_spm+0xa>
-   1fe70:	66 70       	andi	r22, 0x06	; 6
-#if defined(RWWSRE)
-    // this 'if' condition should be: (command == __BOOT_PAGE_WRITE || command == __BOOT_PAGE_ERASE)...
-    // but it's tweaked a little assuming that in every command we are interested in here, there
-    // must be also SELFPRGEN set. If we skip checking this bit, we save here 4B
-    if ((command & (_BV(PGWRT)|_BV(PGERS))) && (data == 0) ) {
-   1fe72:	29 f0       	breq	.+10     	; 0x1fe7e <do_spm+0x1e>
-   1fe74:	45 2b       	or	r20, r21
-   1fe76:	19 f4       	brne	.+6      	; 0x1fe7e <do_spm+0x1e>
-   1fe78:	81 e1       	ldi	r24, 0x11	; 17
-      // Reenable read access to flash
-      __boot_rww_enable_short();
-   1fe7a:	87 bf       	out	0x37, r24	; 55
-   1fe7c:	e8 95       	spm
-   1fe7e:	08 95       	ret
-
-0001fe80 <eeprom_read_byte>:
-   1fe80:	f9 99       	sbic	0x1f, 1	; 31
-   1fe82:	fe cf       	rjmp	.-4      	; 0x1fe80 <eeprom_read_byte>
-   1fe84:	92 bd       	out	0x22, r25	; 34
-   1fe86:	81 bd       	out	0x21, r24	; 33
-   1fe88:	f8 9a       	sbi	0x1f, 0	; 31
-   1fe8a:	99 27       	eor	r25, r25
-   1fe8c:	80 b5       	in	r24, 0x20	; 32
-   1fe8e:	08 95       	ret
-
-0001fe90 <eeprom_write_byte>:
-   1fe90:	26 2f       	mov	r18, r22
-
-0001fe92 <eeprom_write_r18>:
-   1fe92:	f9 99       	sbic	0x1f, 1	; 31
-   1fe94:	fe cf       	rjmp	.-4      	; 0x1fe92 <eeprom_write_r18>
-   1fe96:	1f ba       	out	0x1f, r1	; 31
-   1fe98:	92 bd       	out	0x22, r25	; 34
-   1fe9a:	81 bd       	out	0x21, r24	; 33
-   1fe9c:	20 bd       	out	0x20, r18	; 32
-   1fe9e:	0f b6       	in	r0, 0x3f	; 63
-   1fea0:	f8 94       	cli
-   1fea2:	fa 9a       	sbi	0x1f, 2	; 31
-   1fea4:	f9 9a       	sbi	0x1f, 1	; 31
-   1fea6:	0f be       	out	0x3f, r0	; 63
-   1fea8:	01 96       	adiw	r24, 0x01	; 1
-   1feaa:	08 95       	ret

+ 0 - 640
optiboot/bootloaders/optiboot/optiboot_atmega328.lst

@@ -1,640 +0,0 @@
-
-optiboot_atmega328.elf:     file format elf32-avr
-
-Sections:
-Idx Name          Size      VMA       LMA       File off  Algn
-  0 .data         00000000  00800100  00007fdc  00000270  2**0
-                  CONTENTS, ALLOC, LOAD, DATA
-  1 .text         000001dc  00007e00  00007e00  00000094  2**1
-                  CONTENTS, ALLOC, LOAD, READONLY, CODE
-  2 .version      00000002  00007ffe  00007ffe  00000270  2**0
-                  CONTENTS, ALLOC, LOAD, READONLY, DATA
-  3 .comment      0000002f  00000000  00000000  00000272  2**0
-                  CONTENTS, READONLY
-  4 .debug_aranges 00000030  00000000  00000000  000002a1  2**0
-                  CONTENTS, READONLY, DEBUGGING
-  5 .debug_info   000005fd  00000000  00000000  000002d1  2**0
-                  CONTENTS, READONLY, DEBUGGING
-  6 .debug_abbrev 000002c1  00000000  00000000  000008ce  2**0
-                  CONTENTS, READONLY, DEBUGGING
-  7 .debug_line   00000334  00000000  00000000  00000b8f  2**0
-                  CONTENTS, READONLY, DEBUGGING
-  8 .debug_frame  0000009c  00000000  00000000  00000ec4  2**2
-                  CONTENTS, READONLY, DEBUGGING
-  9 .debug_str    00000200  00000000  00000000  00000f60  2**0
-                  CONTENTS, READONLY, DEBUGGING
- 10 .debug_loc    00000359  00000000  00000000  00001160  2**0
-                  CONTENTS, READONLY, DEBUGGING
- 11 .debug_ranges 00000068  00000000  00000000  000014b9  2**0
-                  CONTENTS, READONLY, DEBUGGING
-
-Disassembly of section .text:
-
-00007e00 <pre_main>:
-/* everything that needs to run VERY early */
-void pre_main(void) {
-  // Allow convenient way of calling do_spm function - jump table,
-  //   so entry to this function will always be here, indepedent of compilation,
-  //   features etc
-  asm volatile (
-    7e00:	01 c0       	rjmp	.+2      	; 0x7e04 <main>
-    7e02:	dc c0       	rjmp	.+440    	; 0x7fbc <do_spm>
-
-00007e04 <main>:
-  //  SP points to RAMEND
-  //  r1 contains zero
-  //
-  // If not, uncomment the following instructions:
-  // cli();
-  asm volatile ("clr __zero_reg__");
-    7e04:	11 24       	eor	r1, r1
-#if defined(__AVR_ATmega8515__) || defined(__AVR_ATmega8535__) ||	\
-    defined(__AVR_ATmega16__)   || defined(__AVR_ATmega162__) ||	\
-    defined (__AVR_ATmega128__)
-  ch = MCUCSR;
-#else
-  ch = MCUSR;
-    7e06:	84 b7       	in	r24, 0x34	; 52
-#endif
-  // Skip all logic and run bootloader if MCUSR is cleared (application request)
-  if (ch != 0) {
-    7e08:	88 23       	and	r24, r24
-    7e0a:	61 f0       	breq	.+24     	; 0x7e24 <main+0x20>
-       *  2. we clear WDRF if it's set with EXTRF to avoid loops
-       * One problematic scenario: broken application code sets watchdog timer 
-       * without clearing MCUSR before and triggers it quickly. But it's
-       * recoverable by power-on with pushed reset button.
-       */
-      if ((ch & (_BV(WDRF) | _BV(EXTRF))) != _BV(EXTRF)) { 
-    7e0c:	98 2f       	mov	r25, r24
-    7e0e:	9a 70       	andi	r25, 0x0A	; 10
-    7e10:	92 30       	cpi	r25, 0x02	; 2
-    7e12:	41 f0       	breq	.+16     	; 0x7e24 <main+0x20>
-	  if (ch & _BV(EXTRF)) {
-    7e14:	81 ff       	sbrs	r24, 1
-    7e16:	02 c0       	rjmp	.+4      	; 0x7e1c <main+0x18>
-    defined(__AVR_ATmega16__)   || defined(__AVR_ATmega162__) ||	\
-    defined(__AVR_ATmega128__)
-               // Fix missing definitions in avr-libc
-	      MCUCSR = ~(_BV(WDRF));
-#else
-	      MCUSR = ~(_BV(WDRF));
-    7e18:	97 ef       	ldi	r25, 0xF7	; 247
-    7e1a:	94 bf       	out	0x34, r25	; 52
-	  /* 
-	   * save the reset flags in the designated register
-	   * This can be saved in a main program by putting code in .init0 (which
-	   * executes before normal c init code) to save R2 to a global variable.
-	   */
-	  __asm__ __volatile__ ("mov r2, %0\n" :: "r" (ch));
-    7e1c:	28 2e       	mov	r2, r24
-
-	  // switch off watchdog
-	  watchdogConfig(WATCHDOG_OFF);
-    7e1e:	80 e0       	ldi	r24, 0x00	; 0
-    7e20:	b8 d0       	rcall	.+368    	; 0x7f92 <watchdogConfig>
-	  // Note that appstart_vec is defined so that this works with either
-	  // real or virtual boot partitions.
-	   __asm__ __volatile__ (
-    7e22:	ee c0       	rjmp	.+476    	; 0x8000 <optiboot_version+0x2>
-      }
-  }
-
-#if LED_START_FLASHES > 0
-  // Set up Timer 1 for timeout counter
-  TCCR1B = _BV(CS12) | _BV(CS10); // div 1024
-    7e24:	85 e0       	ldi	r24, 0x05	; 5
-    7e26:	80 93 81 00 	sts	0x0081, r24	; 0x800081 <__TEXT_REGION_LENGTH__+0x7e0081>
-  LINBTR = (1 << LDISR) | (8 << LBT0); 
-  LINCR = _BV(LENA) | _BV(LCMD2) | _BV(LCMD1) | _BV(LCMD0); 
-  LINDAT=0;
-    #else
-      #ifndef SINGLESPEED
-  UART_SRA = _BV(U2X0); //Double speed mode USART0
-    7e2a:	82 e0       	ldi	r24, 0x02	; 2
-    7e2c:	80 93 c0 00 	sts	0x00C0, r24	; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7e00c0>
-      #endif
-  UART_SRB = _BV(RXEN0) | _BV(TXEN0);
-    7e30:	88 e1       	ldi	r24, 0x18	; 24
-    7e32:	80 93 c1 00 	sts	0x00C1, r24	; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7e00c1>
-  UART_SRC = _BV(UCSZ00) | _BV(UCSZ01);
-    7e36:	86 e0       	ldi	r24, 0x06	; 6
-    7e38:	80 93 c2 00 	sts	0x00C2, r24	; 0x8000c2 <__TEXT_REGION_LENGTH__+0x7e00c2>
-  UART_SRL = (uint8_t)BAUD_SETTING;
-    7e3c:	80 e1       	ldi	r24, 0x10	; 16
-    7e3e:	80 93 c4 00 	sts	0x00C4, r24	; 0x8000c4 <__TEXT_REGION_LENGTH__+0x7e00c4>
-    #endif // LIN_UART
-  #endif // mega8/etc
-#endif // soft_uart
-
-  // Set up watchdog to trigger after 1s
-  watchdogConfig(WATCHDOG_1S);
-    7e42:	8e e0       	ldi	r24, 0x0E	; 14
-    7e44:	a6 d0       	rcall	.+332    	; 0x7f92 <watchdogConfig>
-
-#if (LED_START_FLASHES > 0) || defined(LED_DATA_FLASH) || defined(LED_START_ON)
-  /* Set LED pin as output */
-  LED_DDR |= _BV(LED);
-    7e46:	25 9a       	sbi	0x04, 5	; 4
-    7e48:	86 e0       	ldi	r24, 0x06	; 6
-}
-
-#if LED_START_FLASHES > 0
-void flash_led(uint8_t count) {
-  do {
-    TCNT1 = -(F_CPU/(1024*16));
-    7e4a:	20 e3       	ldi	r18, 0x30	; 48
-    7e4c:	3c ef       	ldi	r19, 0xFC	; 252
-    TIFR1 = _BV(TOV1);
-    7e4e:	91 e0       	ldi	r25, 0x01	; 1
-}
-
-#if LED_START_FLASHES > 0
-void flash_led(uint8_t count) {
-  do {
-    TCNT1 = -(F_CPU/(1024*16));
-    7e50:	30 93 85 00 	sts	0x0085, r19	; 0x800085 <__TEXT_REGION_LENGTH__+0x7e0085>
-    7e54:	20 93 84 00 	sts	0x0084, r18	; 0x800084 <__TEXT_REGION_LENGTH__+0x7e0084>
-    TIFR1 = _BV(TOV1);
-    7e58:	96 bb       	out	0x16, r25	; 22
-    while(!(TIFR1 & _BV(TOV1)));
-    7e5a:	b0 9b       	sbis	0x16, 0	; 22
-    7e5c:	fe cf       	rjmp	.-4      	; 0x7e5a <main+0x56>
-    defined(__AVR_ATmega8535__) || defined(__AVR_ATmega16__)   ||	\
-    defined(__AVR_ATmega162__)  || defined(__AVR_ATmega32__)   ||	\
-    defined(__AVR_ATmega64__)   || defined(__AVR_ATmega128__)
-    LED_PORT ^= _BV(LED);
-#else
-    LED_PIN |= _BV(LED);
-    7e5e:	1d 9a       	sbi	0x03, 5	; 3
-}
-#endif
-
-// Watchdog functions. These are only safe with interrupts turned off.
-void watchdogReset() {
-  __asm__ __volatile__ (
-    7e60:	a8 95       	wdr
-     *  by the UART hardware, avrdude sends several attempts in rather
-     *  quick succession, some of which will be lost and cause us to
-     *  get out of sync.  So if we see any data; stop blinking.
-     */
-#ifndef LIN_UART
-    if (UART_SRA & _BV(RXC0))
-    7e62:	40 91 c0 00 	lds	r20, 0x00C0	; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7e00c0>
-    7e66:	47 fd       	sbrc	r20, 7
-    7e68:	02 c0       	rjmp	.+4      	; 0x7e6e <main+0x6a>
-    7e6a:	81 50       	subi	r24, 0x01	; 1
-#else
-// This doesn't seem to work?
-//    if ((UART_PIN & (1<<UART_RX_BIT)) == 0)
-//	break;  // detect start bit on soft uart too.
-#endif
-  } while (--count);
-    7e6c:	89 f7       	brne	.-30     	; 0x7e50 <main+0x4c>
-
-	    /*
-	     * Copy data from the buffer into the flash write buffer.
-	     */
-	    do {
-		__boot_page_fill_short((uint16_t)(void*)addrPtr, *(mybuff.wptr++));
-    7e6e:	ee 24       	eor	r14, r14
-    7e70:	e3 94       	inc	r14
-	    } while (len -= 2);
-
-	    /*
-	     * Actually Write the buffer to flash (and wait for it to finish.)
-	     */
-	    __boot_page_write_short(address.word);
-    7e72:	95 e0       	ldi	r25, 0x05	; 5
-    7e74:	d9 2e       	mov	r13, r25
-	    boot_spm_busy_wait();
-#if defined(RWWSRE)
-	    // Reenable read access to flash
-	    __boot_rww_enable_short();
-    7e76:	21 e1       	ldi	r18, 0x11	; 17
-#endif
-
-  /* Forever loop: exits by causing WDT reset */
-  for (;;) {
-    /* get character from UART */
-    ch = getch();
-    7e78:	c2 2e       	mov	r12, r18
-
-    if(ch == STK_GET_PARAMETER) {
-    7e7a:	7f d0       	rcall	.+254    	; 0x7f7a <getch>
-      unsigned char which = getch();
-    7e7c:	81 34       	cpi	r24, 0x41	; 65
-    7e7e:	61 f4       	brne	.+24     	; 0x7e98 <main+0x94>
-    7e80:	7c d0       	rcall	.+248    	; 0x7f7a <getch>
-      verifySpace();
-    7e82:	18 2f       	mov	r17, r24
-    7e84:	8c d0       	rcall	.+280    	; 0x7f9e <verifySpace>
-      /*
-       * Send optiboot version as "SW version"
-       * Note that the references to memory are optimized away.
-       */
-      if (which == STK_SW_MINOR) {
-    7e86:	12 38       	cpi	r17, 0x82	; 130
-    7e88:	e9 f0       	breq	.+58     	; 0x7ec4 <main+0xc0>
-	  putch(optiboot_version & 0xFF);
-      } else if (which == STK_SW_MAJOR) {
-    7e8a:	11 38       	cpi	r17, 0x81	; 129
-	  putch(optiboot_version >> 8);
-    7e8c:	11 f4       	brne	.+4      	; 0x7e92 <main+0x8e>
-    7e8e:	88 e0       	ldi	r24, 0x08	; 8
-      } else {
-	/*
-	 * GET PARAMETER returns a generic 0x03 reply for
-         * other parameters - enough to keep Avrdude happy
-	 */
-	putch(0x03);
-    7e90:	01 c0       	rjmp	.+2      	; 0x7e94 <main+0x90>
-    7e92:	83 e0       	ldi	r24, 0x03	; 3
-    7e94:	6b d0       	rcall	.+214    	; 0x7f6c <putch>
-    7e96:	67 c0       	rjmp	.+206    	; 0x7f66 <main+0x162>
-      }
-    }
-    else if(ch == STK_SET_DEVICE) {
-    7e98:	82 34       	cpi	r24, 0x42	; 66
-      // SET DEVICE is ignored
-      getNch(20);
-    7e9a:	11 f4       	brne	.+4      	; 0x7ea0 <main+0x9c>
-    7e9c:	84 e1       	ldi	r24, 0x14	; 20
-    }
-    else if(ch == STK_SET_DEVICE_EXT) {
-    7e9e:	03 c0       	rjmp	.+6      	; 0x7ea6 <main+0xa2>
-      // SET DEVICE EXT is ignored
-      getNch(5);
-    7ea0:	85 34       	cpi	r24, 0x45	; 69
-    7ea2:	19 f4       	brne	.+6      	; 0x7eaa <main+0xa6>
-    7ea4:	85 e0       	ldi	r24, 0x05	; 5
-    }
-    else if(ch == STK_LOAD_ADDRESS) {
-    7ea6:	83 d0       	rcall	.+262    	; 0x7fae <getNch>
-    7ea8:	5e c0       	rjmp	.+188    	; 0x7f66 <main+0x162>
-      // LOAD ADDRESS
-      address.bytes[0] = getch();
-    7eaa:	85 35       	cpi	r24, 0x55	; 85
-    7eac:	39 f4       	brne	.+14     	; 0x7ebc <main+0xb8>
-    7eae:	65 d0       	rcall	.+202    	; 0x7f7a <getch>
-      address.bytes[1] = getch();
-    7eb0:	c8 2f       	mov	r28, r24
-    7eb2:	63 d0       	rcall	.+198    	; 0x7f7a <getch>
-      }
-      else {
-        RAMPZ &= 0xFE;
-      }
-#endif
-      address.word *= 2; // Convert from word address to byte address
-    7eb4:	d8 2f       	mov	r29, r24
-    7eb6:	cc 0f       	add	r28, r28
-    7eb8:	dd 1f       	adc	r29, r29
-      verifySpace();
-    }
-    else if(ch == STK_UNIVERSAL) {
-    7eba:	54 c0       	rjmp	.+168    	; 0x7f64 <main+0x160>
-        getNch(3);
-        putch(0x00);
-      }
-#else
-      // UNIVERSAL command is ignored
-      getNch(4);
-    7ebc:	86 35       	cpi	r24, 0x56	; 86
-    7ebe:	21 f4       	brne	.+8      	; 0x7ec8 <main+0xc4>
-      putch(0x00);
-    7ec0:	84 e0       	ldi	r24, 0x04	; 4
-    7ec2:	75 d0       	rcall	.+234    	; 0x7fae <getNch>
-#endif
-    }
-    /* Write memory, length is big endian and is in bytes */
-    else if(ch == STK_PROG_PAGE) {
-    7ec4:	80 e0       	ldi	r24, 0x00	; 0
-    7ec6:	e6 cf       	rjmp	.-52     	; 0x7e94 <main+0x90>
-      // PROGRAM PAGE - we support flash programming only, not EEPROM
-      uint8_t desttype;
-      uint8_t *bufPtr;
-      pagelen_t savelength;
-
-      GETLENGTH(length);
-    7ec8:	84 36       	cpi	r24, 0x64	; 100
-    7eca:	09 f0       	breq	.+2      	; 0x7ece <main+0xca>
-    7ecc:	2e c0       	rjmp	.+92     	; 0x7f2a <main+0x126>
-    7ece:	55 d0       	rcall	.+170    	; 0x7f7a <getch>
-      savelength = length;
-      desttype = getch();
-    7ed0:	54 d0       	rcall	.+168    	; 0x7f7a <getch>
-    7ed2:	f8 2e       	mov	r15, r24
-    7ed4:	52 d0       	rcall	.+164    	; 0x7f7a <getch>
-    7ed6:	b8 2e       	mov	r11, r24
-    7ed8:	00 e0       	ldi	r16, 0x00	; 0
-
-      // read a page worth of contents
-      bufPtr = buff.bptr;
-      do *bufPtr++ = getch();
-    7eda:	11 e0       	ldi	r17, 0x01	; 1
-    7edc:	4e d0       	rcall	.+156    	; 0x7f7a <getch>
-    7ede:	f8 01       	movw	r30, r16
-    7ee0:	81 93       	st	Z+, r24
-    7ee2:	8f 01       	movw	r16, r30
-      while (--length);
-    7ee4:	fe 12       	cpse	r15, r30
-    7ee6:	fa cf       	rjmp	.-12     	; 0x7edc <main+0xd8>
-
-      // Read command terminator, start reply
-      verifySpace();
-    7ee8:	5a d0       	rcall	.+180    	; 0x7f9e <verifySpace>
-    7eea:	f5 e4       	ldi	r31, 0x45	; 69
- * void writebuffer(memtype, buffer, address, length)
- */
-static inline void writebuffer(int8_t memtype, addr16_t mybuff,
-			       addr16_t address, pagelen_t len)
-{
-    switch (memtype) {
-    7eec:	bf 12       	cpse	r11, r31
-    7eee:	01 c0       	rjmp	.+2      	; 0x7ef2 <main+0xee>
-    7ef0:	ff cf       	rjmp	.-2      	; 0x7ef0 <main+0xec>
-    7ef2:	83 e0       	ldi	r24, 0x03	; 3
-	     * and we needed the space back.
-	     */
-#ifdef FOURPAGEERASE
-	    if ((address.bytes[0] & ((SPM_PAGESIZE<<2)-1))==0) {
-#endif
-	    __boot_page_erase_short(address.word);
-    7ef4:	fe 01       	movw	r30, r28
-    7ef6:	87 bf       	out	0x37, r24	; 55
-    7ef8:	e8 95       	spm
-    7efa:	07 b6       	in	r0, 0x37	; 55
-	    boot_spm_busy_wait();
-    7efc:	00 fc       	sbrc	r0, 0
-    7efe:	fd cf       	rjmp	.-6      	; 0x7efa <main+0xf6>
-    7f00:	a0 e0       	ldi	r26, 0x00	; 0
-    7f02:	b1 e0       	ldi	r27, 0x01	; 1
-    7f04:	fe 01       	movw	r30, r28
-    7f06:	8d 91       	ld	r24, X+
-
-	    /*
-	     * Copy data from the buffer into the flash write buffer.
-	     */
-	    do {
-		__boot_page_fill_short((uint16_t)(void*)addrPtr, *(mybuff.wptr++));
-    7f08:	9d 91       	ld	r25, X+
-    7f0a:	0c 01       	movw	r0, r24
-    7f0c:	e7 be       	out	0x37, r14	; 55
-    7f0e:	e8 95       	spm
-    7f10:	11 24       	eor	r1, r1
-    7f12:	32 96       	adiw	r30, 0x02	; 2
-		addrPtr += 2;
-	    } while (len -= 2);
-    7f14:	fa 12       	cpse	r15, r26
-
-	    /*
-	     * Actually Write the buffer to flash (and wait for it to finish.)
-	     */
-	    __boot_page_write_short(address.word);
-    7f16:	f7 cf       	rjmp	.-18     	; 0x7f06 <main+0x102>
-    7f18:	fe 01       	movw	r30, r28
-	    boot_spm_busy_wait();
-    7f1a:	d7 be       	out	0x37, r13	; 55
-    7f1c:	e8 95       	spm
-#if defined(RWWSRE)
-	    // Reenable read access to flash
-	    __boot_rww_enable_short();
-    7f1e:	07 b6       	in	r0, 0x37	; 55
-    7f20:	00 fc       	sbrc	r0, 0
-    7f22:	fd cf       	rjmp	.-6      	; 0x7f1e <main+0x11a>
-      writebuffer(desttype, buff, address, savelength);
-
-
-    }
-    /* Read memory block mode, length is big endian.  */
-    else if(ch == STK_READ_PAGE) {
-    7f24:	c7 be       	out	0x37, r12	; 55
-    7f26:	e8 95       	spm
-      uint8_t desttype;
-      GETLENGTH(length);
-    7f28:	1e c0       	rjmp	.+60     	; 0x7f66 <main+0x162>
-    7f2a:	84 37       	cpi	r24, 0x74	; 116
-    7f2c:	71 f4       	brne	.+28     	; 0x7f4a <main+0x146>
-
-      desttype = getch();
-    7f2e:	25 d0       	rcall	.+74     	; 0x7f7a <getch>
-
-      verifySpace();
-    7f30:	24 d0       	rcall	.+72     	; 0x7f7a <getch>
-    7f32:	f8 2e       	mov	r15, r24
-    7f34:	22 d0       	rcall	.+68     	; 0x7f7a <getch>
-	    //      while (--length);
-	    // read a Flash and increment the address (may increment RAMPZ)
-	    __asm__ ("elpm %0,Z+\n" : "=r" (ch), "=z" (address.bptr): "1" (address));
-#else
-	    // read a Flash byte and increment the address
-	    __asm__ ("lpm %0,Z+\n" : "=r" (ch), "=z" (address.bptr): "1" (address));
-    7f36:	33 d0       	rcall	.+102    	; 0x7f9e <verifySpace>
-    7f38:	8e 01       	movw	r16, r28
-#endif
-	    putch(ch);
-    7f3a:	f8 01       	movw	r30, r16
-	} while (--length);
-    7f3c:	85 91       	lpm	r24, Z+
-    7f3e:	8f 01       	movw	r16, r30
-    7f40:	15 d0       	rcall	.+42     	; 0x7f6c <putch>
-    7f42:	fa 94       	dec	r15
-
-      read_mem(desttype, address, length);
-    }
-
-    /* Get device signature bytes  */
-    else if(ch == STK_READ_SIGN) {
-    7f44:	f1 10       	cpse	r15, r1
-    7f46:	f9 cf       	rjmp	.-14     	; 0x7f3a <main+0x136>
-      // READ SIGN - return what Avrdude wants to hear
-      verifySpace();
-    7f48:	0e c0       	rjmp	.+28     	; 0x7f66 <main+0x162>
-    7f4a:	85 37       	cpi	r24, 0x75	; 117
-      putch(SIGNATURE_0);
-    7f4c:	39 f4       	brne	.+14     	; 0x7f5c <main+0x158>
-    7f4e:	27 d0       	rcall	.+78     	; 0x7f9e <verifySpace>
-    7f50:	8e e1       	ldi	r24, 0x1E	; 30
-      putch(SIGNATURE_1);
-    7f52:	0c d0       	rcall	.+24     	; 0x7f6c <putch>
-    7f54:	85 e9       	ldi	r24, 0x95	; 149
-    7f56:	0a d0       	rcall	.+20     	; 0x7f6c <putch>
-      putch(SIGNATURE_2);
-    7f58:	8f e0       	ldi	r24, 0x0F	; 15
-    7f5a:	9c cf       	rjmp	.-200    	; 0x7e94 <main+0x90>
-    }
-    else if (ch == STK_LEAVE_PROGMODE) { /* 'Q' */
-    7f5c:	81 35       	cpi	r24, 0x51	; 81
-    7f5e:	11 f4       	brne	.+4      	; 0x7f64 <main+0x160>
-      // Adaboot no-wait mod
-      watchdogConfig(WATCHDOG_16MS);
-    7f60:	88 e0       	ldi	r24, 0x08	; 8
-    7f62:	17 d0       	rcall	.+46     	; 0x7f92 <watchdogConfig>
-    7f64:	1c d0       	rcall	.+56     	; 0x7f9e <verifySpace>
-      verifySpace();
-    }
-    else {
-      // This covers the response to commands like STK_ENTER_PROGMODE
-      verifySpace();
-    7f66:	80 e1       	ldi	r24, 0x10	; 16
-    7f68:	01 d0       	rcall	.+2      	; 0x7f6c <putch>
-    }
-    putch(STK_OK);
-    7f6a:	87 cf       	rjmp	.-242    	; 0x7e7a <main+0x76>
-
-00007f6c <putch>:
-    7f6c:	90 91 c0 00 	lds	r25, 0x00C0	; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7e00c0>
-  }
-    7f70:	95 ff       	sbrs	r25, 5
-}
-
-void putch(char ch) {
-#ifndef SOFT_UART
-  #ifndef LIN_UART
-    while (!(UART_SRA & _BV(UDRE0))) {  /* Spin */ }
-    7f72:	fc cf       	rjmp	.-8      	; 0x7f6c <putch>
-  #else
-    while (!(LINSIR & _BV(LTXOK)))   {  /* Spin */ }
-  #endif
-
-  UART_UDR = ch;
-    7f74:	80 93 c6 00 	sts	0x00C6, r24	; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7e00c6>
-    7f78:	08 95       	ret
-
-00007f7a <getch>:
-    :
-      "r25"
-);
-#else
-#ifndef LIN_UART
-  while(!(UART_SRA & _BV(RXC0)))  {  /* Spin */ }
-    7f7a:	80 91 c0 00 	lds	r24, 0x00C0	; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7e00c0>
-    7f7e:	87 ff       	sbrs	r24, 7
-    7f80:	fc cf       	rjmp	.-8      	; 0x7f7a <getch>
-  if (!(UART_SRA & _BV(FE0))) {
-    7f82:	80 91 c0 00 	lds	r24, 0x00C0	; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7e00c0>
-    7f86:	84 fd       	sbrc	r24, 4
-    7f88:	01 c0       	rjmp	.+2      	; 0x7f8c <getch+0x12>
-}
-#endif
-
-// Watchdog functions. These are only safe with interrupts turned off.
-void watchdogReset() {
-  __asm__ __volatile__ (
-    7f8a:	a8 95       	wdr
-       * don't care that an invalid char is returned...)
-       */
-    watchdogReset();
-  }
-
-  ch = UART_UDR;
-    7f8c:	80 91 c6 00 	lds	r24, 0x00C6	; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7e00c6>
-  LED_PIN |= _BV(LED);
-#endif
-#endif
-
-  return ch;
-}
-    7f90:	08 95       	ret
-
-00007f92 <watchdogConfig>:
-}
-
-void watchdogConfig(uint8_t x) {
-#ifdef WDCE //does it have a Watchdog Change Enable?
- #ifdef WDTCSR
-  WDTCSR = _BV(WDCE) | _BV(WDE);
-    7f92:	e0 e6       	ldi	r30, 0x60	; 96
-    7f94:	f0 e0       	ldi	r31, 0x00	; 0
-    7f96:	98 e1       	ldi	r25, 0x18	; 24
-    7f98:	90 83       	st	Z, r25
-#else //then it must be one of those newfangled ones that use CCP
-  CCP=0xD8; //so write this magic number to CCP
-#endif 
-
-#ifdef WDTCSR
-  WDTCSR = x;
-    7f9a:	80 83       	st	Z, r24
-    7f9c:	08 95       	ret
-
-00007f9e <verifySpace>:
-  do getch(); while (--count);
-  verifySpace();
-}
-
-void verifySpace() {
-  if (getch() != CRC_EOP) {
-    7f9e:	ed df       	rcall	.-38     	; 0x7f7a <getch>
-    7fa0:	80 32       	cpi	r24, 0x20	; 32
-    7fa2:	19 f0       	breq	.+6      	; 0x7faa <verifySpace+0xc>
-    watchdogConfig(WATCHDOG_16MS);    // shorten WD timeout
-    7fa4:	88 e0       	ldi	r24, 0x08	; 8
-    7fa6:	f5 df       	rcall	.-22     	; 0x7f92 <watchdogConfig>
-    7fa8:	ff cf       	rjmp	.-2      	; 0x7fa8 <verifySpace+0xa>
-    while (1)			      // and busy-loop so that WD causes
-      ;				      //  a reset and app start.
-  }
-  putch(STK_INSYNC);
-    7faa:	84 e1       	ldi	r24, 0x14	; 20
-    7fac:	df cf       	rjmp	.-66     	; 0x7f6c <putch>
-
-00007fae <getNch>:
-    ::[count] "M" (UART_B_VALUE)
-  );
-}
-#endif
-
-void getNch(uint8_t count) {
-    7fae:	cf 93       	push	r28
-    7fb0:	c8 2f       	mov	r28, r24
-  do getch(); while (--count);
-    7fb2:	e3 df       	rcall	.-58     	; 0x7f7a <getch>
-    7fb4:	c1 50       	subi	r28, 0x01	; 1
-    7fb6:	e9 f7       	brne	.-6      	; 0x7fb2 <getNch+0x4>
-  verifySpace();
-}
-    7fb8:	cf 91       	pop	r28
-}
-#endif
-
-void getNch(uint8_t count) {
-  do getch(); while (--count);
-  verifySpace();
-    7fba:	f1 cf       	rjmp	.-30     	; 0x7f9e <verifySpace>
-
-00007fbc <do_spm>:
-    7fbc:	fc 01       	movw	r30, r24
- *   data=0 in WRITE
- */
-static void do_spm(uint16_t address, uint8_t command, uint16_t data)  __attribute__ ((used));
-static void do_spm(uint16_t address, uint8_t command, uint16_t data) {
-    // Do spm stuff
-    asm volatile (
-    7fbe:	0a 01       	movw	r0, r20
-    7fc0:	67 bf       	out	0x37, r22	; 55
-    7fc2:	e8 95       	spm
-    7fc4:	11 24       	eor	r1, r1
-    7fc6:	07 b6       	in	r0, 0x37	; 55
-    );
-
-    // wait for spm to complete
-    //   it doesn't have much sense for __BOOT_PAGE_FILL,
-    //   but it doesn't hurt and saves some bytes on 'if'
-    boot_spm_busy_wait();
-    7fc8:	00 fc       	sbrc	r0, 0
-    7fca:	fd cf       	rjmp	.-6      	; 0x7fc6 <do_spm+0xa>
-    7fcc:	66 70       	andi	r22, 0x06	; 6
-#if defined(RWWSRE)
-    // this 'if' condition should be: (command == __BOOT_PAGE_WRITE || command == __BOOT_PAGE_ERASE)...
-    // but it's tweaked a little assuming that in every command we are interested in here, there
-    // must be also SELFPRGEN set. If we skip checking this bit, we save here 4B
-    if ((command & (_BV(PGWRT)|_BV(PGERS))) && (data == 0) ) {
-    7fce:	29 f0       	breq	.+10     	; 0x7fda <do_spm+0x1e>
-    7fd0:	45 2b       	or	r20, r21
-    7fd2:	19 f4       	brne	.+6      	; 0x7fda <do_spm+0x1e>
-    7fd4:	81 e1       	ldi	r24, 0x11	; 17
-      // Reenable read access to flash
-      __boot_rww_enable_short();
-    7fd6:	87 bf       	out	0x37, r24	; 55
-    7fd8:	e8 95       	spm
-    7fda:	08 95       	ret

+ 0 - 53
optiboot/bootloaders/optiboot/optiboot_atmega644p.hex

@@ -1,53 +0,0 @@
-:10FC000011E0A0E0B1E0ECE7FEEF02C005900D923C
-:10FC1000AC39B107D9F701C00BC1112484B78823CF
-:10FC200061F0982F9A70923041F081FF02C097EFF7
-:10FC300094BF282E80E0E7D0E3C185E08093810067
-:10FC400082E08093C00088E18093C10086E08093C9
-:10FC5000C20080E18093C4008EE0D5D0209A86E077
-:10FC600020E33CEF91E0309385002093840096BB25
-:10FC7000B09BFECF189AA8954091C00047FD02C0E6
-:10FC8000815089F7FF24F39455E0E52E61E1D62EEB
-:10FC9000AED0813461F4ABD0C82FBBD0C238E9F00C
-:10FCA000C13811F488E001C083E09AD096C0823454
-:10FCB00011F484E103C0853419F485E0B2D08DC01D
-:10FCC000853539F494D0082F92D0182F000F111FCA
-:10FCD00083C0863521F484E0A4D080E0E6CF84366A
-:10FCE00009F048C084D0C82FD0E0DC2FCC277FD0CB
-:10FCF000C82B7DD0C82E5E01812C9924939477D097
-:10FD0000F40181934F01F1E0AF1AB108C1F781D03E
-:10FD100085E4C81212C0D3954801A12CBB24B3942A
-:10FD2000AC16BD0609F459C0F50161915F01C4012B
-:10FD300097D0FFEF8F1A9F0AF3CF83E0F80187BFB8
-:10FD4000E89507B600FCFDCFA0E0B1E0F8018D9189
-:10FD50009D910C01F7BEE8951124229732962097C9
-:10FD6000B1F7F801E7BEE89507B600FCFDCFD7BEB6
-:10FD7000E89533C0843719F53AD0C82FD0E0DC2F8E
-:10FD8000CC2735D05E01A82A32D0982E42D0E80187
-:10FD9000F5E49F120BC0CE015BD022D081E0A81AFF
-:10FDA000B1082196A114B104B1F717C0FE018591E5
-:10FDB000EF0116D0E1E0AE1AB108C1F70EC08537E9
-:10FDC00039F427D08EE10CD086E90AD08AE06DCFD5
-:10FDD000813511F488E017D01CD080E101D058CFD4
-:10FDE0009091C00095FFFCCF8093C600089580914C
-:10FDF000C00087FFFCCF8091C00084FD01C0A895A2
-:10FE00008091C6000895E0E6F0E098E19083808359
-:10FE10000895EDDF803219F088E0F5DFFFCF84E14F
-:10FE2000DFCFCF93C82FE3DFC150E9F7CF91F1CFF8
-:10FE3000FC010A0167BFE895112407B600FCFDCF5D
-:10FE4000667029F0452B19F481E187BFE895089584
-:10FE5000F999FECF92BD81BDF89A992780B5089592
-:10FE6000262FF999FECF1FBA92BD81BD20BD0FB6D6
-:0CFE7000F894FA9AF99A0FBE01960895D2
-:10FE7C0056657273696F6E3D382E30004F50544981
-:10FE8C00424F4F545F435553544F4D5645523D309E
-:10FE9C00004465766963653D61746D6567613634F0
-:10FEAC00347000465F4350553D3136303030303081
-:10FEBC00304C00424947424F4F543D310042756926
-:10FECC006C743A53657020323020323031383A300D
-:10FEDC00313A31383A353000554152543D300042B8
-:10FEEC004155445F524154453D313135323030003B
-:10FEFC004C45443D4230004C45445F5354415254B0
-:0CFF0C005F464C41534845533D33000014
-:02FFFE000008F9
-:040000030000FC00FD
-:00000001FF

+ 0 - 747
optiboot/bootloaders/optiboot/optiboot_atmega644p.lst

@@ -1,747 +0,0 @@
-
-optiboot_atmega644p.elf:     file format elf32-avr
-
-Sections:
-Idx Name          Size      VMA       LMA       File off  Algn
-  0 .data         0000009c  00800100  0000fe7c  00000310  2**0
-                  CONTENTS, ALLOC, LOAD, DATA
-  1 .text         0000027c  0000fc00  0000fc00  00000094  2**1
-                  CONTENTS, ALLOC, LOAD, READONLY, CODE
-  2 .version      00000002  0000fffe  0000fffe  000003ac  2**0
-                  CONTENTS, ALLOC, LOAD, READONLY, DATA
-  3 .comment      0000002f  00000000  00000000  000003ae  2**0
-                  CONTENTS, READONLY
-  4 .debug_aranges 00000030  00000000  00000000  000003dd  2**0
-                  CONTENTS, READONLY, DEBUGGING
-  5 .debug_info   000007a8  00000000  00000000  0000040d  2**0
-                  CONTENTS, READONLY, DEBUGGING
-  6 .debug_abbrev 000002c5  00000000  00000000  00000bb5  2**0
-                  CONTENTS, READONLY, DEBUGGING
-  7 .debug_line   0000039a  00000000  00000000  00000e7a  2**0
-                  CONTENTS, READONLY, DEBUGGING
-  8 .debug_frame  0000009c  00000000  00000000  00001214  2**2
-                  CONTENTS, READONLY, DEBUGGING
-  9 .debug_str    0000028b  00000000  00000000  000012b0  2**0
-                  CONTENTS, READONLY, DEBUGGING
- 10 .debug_loc    00000449  00000000  00000000  0000153b  2**0
-                  CONTENTS, READONLY, DEBUGGING
- 11 .debug_ranges 00000068  00000000  00000000  00001984  2**0
-                  CONTENTS, READONLY, DEBUGGING
-
-Disassembly of section .text:
-
-0000fc00 <__ctors_end>:
-    fc00:	11 e0       	ldi	r17, 0x01	; 1
-    fc02:	a0 e0       	ldi	r26, 0x00	; 0
-    fc04:	b1 e0       	ldi	r27, 0x01	; 1
-    fc06:	ec e7       	ldi	r30, 0x7C	; 124
-    fc08:	fe ef       	ldi	r31, 0xFE	; 254
-    fc0a:	02 c0       	rjmp	.+4      	; 0xfc10 <__ctors_end+0x10>
-    fc0c:	05 90       	lpm	r0, Z+
-    fc0e:	0d 92       	st	X+, r0
-    fc10:	ac 39       	cpi	r26, 0x9C	; 156
-    fc12:	b1 07       	cpc	r27, r17
-    fc14:	d9 f7       	brne	.-10     	; 0xfc0c <__ctors_end+0xc>
-
-0000fc16 <pre_main>:
-/* everything that needs to run VERY early */
-void pre_main(void) {
-  // Allow convenient way of calling do_spm function - jump table,
-  //   so entry to this function will always be here, indepedent of compilation,
-  //   features etc
-  asm volatile (
-    fc16:	01 c0       	rjmp	.+2      	; 0xfc1a <main>
-    fc18:	0b c1       	rjmp	.+534    	; 0xfe30 <do_spm>
-
-0000fc1a <main>:
-  //  SP points to RAMEND
-  //  r1 contains zero
-  //
-  // If not, uncomment the following instructions:
-  // cli();
-  asm volatile ("clr __zero_reg__");
-    fc1a:	11 24       	eor	r1, r1
-#if defined(__AVR_ATmega8515__) || defined(__AVR_ATmega8535__) ||	\
-    defined(__AVR_ATmega16__)   || defined(__AVR_ATmega162__) ||	\
-    defined (__AVR_ATmega128__)
-  ch = MCUCSR;
-#else
-  ch = MCUSR;
-    fc1c:	84 b7       	in	r24, 0x34	; 52
-#endif
-  // Skip all logic and run bootloader if MCUSR is cleared (application request)
-  if (ch != 0) {
-    fc1e:	88 23       	and	r24, r24
-    fc20:	61 f0       	breq	.+24     	; 0xfc3a <main+0x20>
-       *  2. we clear WDRF if it's set with EXTRF to avoid loops
-       * One problematic scenario: broken application code sets watchdog timer 
-       * without clearing MCUSR before and triggers it quickly. But it's
-       * recoverable by power-on with pushed reset button.
-       */
-      if ((ch & (_BV(WDRF) | _BV(EXTRF))) != _BV(EXTRF)) { 
-    fc22:	98 2f       	mov	r25, r24
-    fc24:	9a 70       	andi	r25, 0x0A	; 10
-    fc26:	92 30       	cpi	r25, 0x02	; 2
-    fc28:	41 f0       	breq	.+16     	; 0xfc3a <main+0x20>
-	  if (ch & _BV(EXTRF)) {
-    fc2a:	81 ff       	sbrs	r24, 1
-    fc2c:	02 c0       	rjmp	.+4      	; 0xfc32 <main+0x18>
-    defined(__AVR_ATmega16__)   || defined(__AVR_ATmega162__) ||	\
-    defined(__AVR_ATmega128__)
-               // Fix missing definitions in avr-libc
-	      MCUCSR = ~(_BV(WDRF));
-#else
-	      MCUSR = ~(_BV(WDRF));
-    fc2e:	97 ef       	ldi	r25, 0xF7	; 247
-    fc30:	94 bf       	out	0x34, r25	; 52
-	  /* 
-	   * save the reset flags in the designated register
-	   * This can be saved in a main program by putting code in .init0 (which
-	   * executes before normal c init code) to save R2 to a global variable.
-	   */
-	  __asm__ __volatile__ ("mov r2, %0\n" :: "r" (ch));
-    fc32:	28 2e       	mov	r2, r24
-
-	  // switch off watchdog
-	  watchdogConfig(WATCHDOG_OFF);
-    fc34:	80 e0       	ldi	r24, 0x00	; 0
-    fc36:	e7 d0       	rcall	.+462    	; 0xfe06 <watchdogConfig>
-	  // Note that appstart_vec is defined so that this works with either
-	  // real or virtual boot partitions.
-	   __asm__ __volatile__ (
-    fc38:	e3 c1       	rjmp	.+966    	; 0x10000 <__EEPROM_REGION_LENGTH__>
-      }
-  }
-
-#if LED_START_FLASHES > 0
-  // Set up Timer 1 for timeout counter
-  TCCR1B = _BV(CS12) | _BV(CS10); // div 1024
-    fc3a:	85 e0       	ldi	r24, 0x05	; 5
-    fc3c:	80 93 81 00 	sts	0x0081, r24	; 0x800081 <__TEXT_REGION_LENGTH__+0x7e0081>
-  LINBTR = (1 << LDISR) | (8 << LBT0); 
-  LINCR = _BV(LENA) | _BV(LCMD2) | _BV(LCMD1) | _BV(LCMD0); 
-  LINDAT=0;
-    #else
-      #ifndef SINGLESPEED
-  UART_SRA = _BV(U2X0); //Double speed mode USART0
-    fc40:	82 e0       	ldi	r24, 0x02	; 2
-    fc42:	80 93 c0 00 	sts	0x00C0, r24	; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7e00c0>
-      #endif
-  UART_SRB = _BV(RXEN0) | _BV(TXEN0);
-    fc46:	88 e1       	ldi	r24, 0x18	; 24
-    fc48:	80 93 c1 00 	sts	0x00C1, r24	; 0x8000c1 <__TEXT_REGION_LENGTH__+0x7e00c1>
-  UART_SRC = _BV(UCSZ00) | _BV(UCSZ01);
-    fc4c:	86 e0       	ldi	r24, 0x06	; 6
-    fc4e:	80 93 c2 00 	sts	0x00C2, r24	; 0x8000c2 <__TEXT_REGION_LENGTH__+0x7e00c2>
-  UART_SRL = (uint8_t)BAUD_SETTING;
-    fc52:	80 e1       	ldi	r24, 0x10	; 16
-    fc54:	80 93 c4 00 	sts	0x00C4, r24	; 0x8000c4 <__TEXT_REGION_LENGTH__+0x7e00c4>
-    #endif // LIN_UART
-  #endif // mega8/etc
-#endif // soft_uart
-
-  // Set up watchdog to trigger after 1s
-  watchdogConfig(WATCHDOG_1S);
-    fc58:	8e e0       	ldi	r24, 0x0E	; 14
-    fc5a:	d5 d0       	rcall	.+426    	; 0xfe06 <watchdogConfig>
-
-#if (LED_START_FLASHES > 0) || defined(LED_DATA_FLASH) || defined(LED_START_ON)
-  /* Set LED pin as output */
-  LED_DDR |= _BV(LED);
-    fc5c:	20 9a       	sbi	0x04, 0	; 4
-    fc5e:	86 e0       	ldi	r24, 0x06	; 6
-}
-
-#if LED_START_FLASHES > 0
-void flash_led(uint8_t count) {
-  do {
-    TCNT1 = -(F_CPU/(1024*16));
-    fc60:	20 e3       	ldi	r18, 0x30	; 48
-    fc62:	3c ef       	ldi	r19, 0xFC	; 252
-    TIFR1 = _BV(TOV1);
-    fc64:	91 e0       	ldi	r25, 0x01	; 1
-}
-
-#if LED_START_FLASHES > 0
-void flash_led(uint8_t count) {
-  do {
-    TCNT1 = -(F_CPU/(1024*16));
-    fc66:	30 93 85 00 	sts	0x0085, r19	; 0x800085 <__TEXT_REGION_LENGTH__+0x7e0085>
-    fc6a:	20 93 84 00 	sts	0x0084, r18	; 0x800084 <__TEXT_REGION_LENGTH__+0x7e0084>
-    TIFR1 = _BV(TOV1);
-    fc6e:	96 bb       	out	0x16, r25	; 22
-    while(!(TIFR1 & _BV(TOV1)));
-    fc70:	b0 9b       	sbis	0x16, 0	; 22
-    fc72:	fe cf       	rjmp	.-4      	; 0xfc70 <main+0x56>
-    defined(__AVR_ATmega8535__) || defined(__AVR_ATmega16__)   ||	\
-    defined(__AVR_ATmega162__)  || defined(__AVR_ATmega32__)   ||	\
-    defined(__AVR_ATmega64__)   || defined(__AVR_ATmega128__)
-    LED_PORT ^= _BV(LED);
-#else
-    LED_PIN |= _BV(LED);
-    fc74:	18 9a       	sbi	0x03, 0	; 3
-}
-#endif
-
-// Watchdog functions. These are only safe with interrupts turned off.
-void watchdogReset() {
-  __asm__ __volatile__ (
-    fc76:	a8 95       	wdr
-     *  by the UART hardware, avrdude sends several attempts in rather
-     *  quick succession, some of which will be lost and cause us to
-     *  get out of sync.  So if we see any data; stop blinking.
-     */
-#ifndef LIN_UART
-    if (UART_SRA & _BV(RXC0))
-    fc78:	40 91 c0 00 	lds	r20, 0x00C0	; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7e00c0>
-    fc7c:	47 fd       	sbrc	r20, 7
-    fc7e:	02 c0       	rjmp	.+4      	; 0xfc84 <main+0x6a>
-    fc80:	81 50       	subi	r24, 0x01	; 1
-#else
-// This doesn't seem to work?
-//    if ((UART_PIN & (1<<UART_RX_BIT)) == 0)
-//	break;  // detect start bit on soft uart too.
-#endif
-  } while (--count);
-    fc82:	89 f7       	brne	.-30     	; 0xfc66 <main+0x4c>
-
-	    /*
-	     * Copy data from the buffer into the flash write buffer.
-	     */
-	    do {
-		__boot_page_fill_short((uint16_t)(void*)addrPtr, *(mybuff.wptr++));
-    fc84:	ff 24       	eor	r15, r15
-    fc86:	f3 94       	inc	r15
-	    } while (len -= 2);
-
-	    /*
-	     * Actually Write the buffer to flash (and wait for it to finish.)
-	     */
-	    __boot_page_write_short(address.word);
-    fc88:	55 e0       	ldi	r21, 0x05	; 5
-    fc8a:	e5 2e       	mov	r14, r21
-	    boot_spm_busy_wait();
-#if defined(RWWSRE)
-	    // Reenable read access to flash
-	    __boot_rww_enable_short();
-    fc8c:	61 e1       	ldi	r22, 0x11	; 17
-#endif
-
-  /* Forever loop: exits by causing WDT reset */
-  for (;;) {
-    /* get character from UART */
-    ch = getch();
-    fc8e:	d6 2e       	mov	r13, r22
-
-    if(ch == STK_GET_PARAMETER) {
-    fc90:	ae d0       	rcall	.+348    	; 0xfdee <getch>
-      unsigned char which = getch();
-    fc92:	81 34       	cpi	r24, 0x41	; 65
-    fc94:	61 f4       	brne	.+24     	; 0xfcae <main+0x94>
-    fc96:	ab d0       	rcall	.+342    	; 0xfdee <getch>
-      verifySpace();
-    fc98:	c8 2f       	mov	r28, r24
-    fc9a:	bb d0       	rcall	.+374    	; 0xfe12 <verifySpace>
-      /*
-       * Send optiboot version as "SW version"
-       * Note that the references to memory are optimized away.
-       */
-      if (which == STK_SW_MINOR) {
-    fc9c:	c2 38       	cpi	r28, 0x82	; 130
-    fc9e:	e9 f0       	breq	.+58     	; 0xfcda <main+0xc0>
-	  putch(optiboot_version & 0xFF);
-      } else if (which == STK_SW_MAJOR) {
-    fca0:	c1 38       	cpi	r28, 0x81	; 129
-	  putch(optiboot_version >> 8);
-    fca2:	11 f4       	brne	.+4      	; 0xfca8 <main+0x8e>
-    fca4:	88 e0       	ldi	r24, 0x08	; 8
-      } else {
-	/*
-	 * GET PARAMETER returns a generic 0x03 reply for
-         * other parameters - enough to keep Avrdude happy
-	 */
-	putch(0x03);
-    fca6:	01 c0       	rjmp	.+2      	; 0xfcaa <main+0x90>
-    fca8:	83 e0       	ldi	r24, 0x03	; 3
-    fcaa:	9a d0       	rcall	.+308    	; 0xfde0 <putch>
-    fcac:	96 c0       	rjmp	.+300    	; 0xfdda <main+0x1c0>
-      }
-    }
-    else if(ch == STK_SET_DEVICE) {
-    fcae:	82 34       	cpi	r24, 0x42	; 66
-      // SET DEVICE is ignored
-      getNch(20);
-    fcb0:	11 f4       	brne	.+4      	; 0xfcb6 <main+0x9c>
-    fcb2:	84 e1       	ldi	r24, 0x14	; 20
-    }
-    else if(ch == STK_SET_DEVICE_EXT) {
-    fcb4:	03 c0       	rjmp	.+6      	; 0xfcbc <main+0xa2>
-      // SET DEVICE EXT is ignored
-      getNch(5);
-    fcb6:	85 34       	cpi	r24, 0x45	; 69
-    fcb8:	19 f4       	brne	.+6      	; 0xfcc0 <main+0xa6>
-    fcba:	85 e0       	ldi	r24, 0x05	; 5
-    }
-    else if(ch == STK_LOAD_ADDRESS) {
-    fcbc:	b2 d0       	rcall	.+356    	; 0xfe22 <getNch>
-    fcbe:	8d c0       	rjmp	.+282    	; 0xfdda <main+0x1c0>
-      // LOAD ADDRESS
-      address.bytes[0] = getch();
-    fcc0:	85 35       	cpi	r24, 0x55	; 85
-    fcc2:	39 f4       	brne	.+14     	; 0xfcd2 <main+0xb8>
-    fcc4:	94 d0       	rcall	.+296    	; 0xfdee <getch>
-      address.bytes[1] = getch();
-    fcc6:	08 2f       	mov	r16, r24
-    fcc8:	92 d0       	rcall	.+292    	; 0xfdee <getch>
-      }
-      else {
-        RAMPZ &= 0xFE;
-      }
-#endif
-      address.word *= 2; // Convert from word address to byte address
-    fcca:	18 2f       	mov	r17, r24
-    fccc:	00 0f       	add	r16, r16
-    fcce:	11 1f       	adc	r17, r17
-      verifySpace();
-    }
-    else if(ch == STK_UNIVERSAL) {
-    fcd0:	83 c0       	rjmp	.+262    	; 0xfdd8 <main+0x1be>
-        getNch(3);
-        putch(0x00);
-      }
-#else
-      // UNIVERSAL command is ignored
-      getNch(4);
-    fcd2:	86 35       	cpi	r24, 0x56	; 86
-    fcd4:	21 f4       	brne	.+8      	; 0xfcde <main+0xc4>
-    fcd6:	84 e0       	ldi	r24, 0x04	; 4
-      putch(0x00);
-    fcd8:	a4 d0       	rcall	.+328    	; 0xfe22 <getNch>
-#endif
-    }
-    /* Write memory, length is big endian and is in bytes */
-    else if(ch == STK_PROG_PAGE) {
-    fcda:	80 e0       	ldi	r24, 0x00	; 0
-    fcdc:	e6 cf       	rjmp	.-52     	; 0xfcaa <main+0x90>
-      // PROGRAM PAGE - we support flash programming only, not EEPROM
-      uint8_t desttype;
-      uint8_t *bufPtr;
-      pagelen_t savelength;
-
-      GETLENGTH(length);
-    fcde:	84 36       	cpi	r24, 0x64	; 100
-    fce0:	09 f0       	breq	.+2      	; 0xfce4 <main+0xca>
-    fce2:	48 c0       	rjmp	.+144    	; 0xfd74 <main+0x15a>
-    fce4:	84 d0       	rcall	.+264    	; 0xfdee <getch>
-    fce6:	c8 2f       	mov	r28, r24
-    fce8:	d0 e0       	ldi	r29, 0x00	; 0
-    fcea:	dc 2f       	mov	r29, r28
-    fcec:	cc 27       	eor	r28, r28
-      savelength = length;
-      desttype = getch();
-    fcee:	7f d0       	rcall	.+254    	; 0xfdee <getch>
-    fcf0:	c8 2b       	or	r28, r24
-      // PROGRAM PAGE - we support flash programming only, not EEPROM
-      uint8_t desttype;
-      uint8_t *bufPtr;
-      pagelen_t savelength;
-
-      GETLENGTH(length);
-    fcf2:	7d d0       	rcall	.+250    	; 0xfdee <getch>
-      savelength = length;
-      desttype = getch();
-    fcf4:	c8 2e       	mov	r12, r24
-    fcf6:	5e 01       	movw	r10, r28
-    fcf8:	81 2c       	mov	r8, r1
-
-      // read a page worth of contents
-      bufPtr = buff.bptr;
-      do *bufPtr++ = getch();
-    fcfa:	99 24       	eor	r9, r9
-    fcfc:	93 94       	inc	r9
-    fcfe:	77 d0       	rcall	.+238    	; 0xfdee <getch>
-    fd00:	f4 01       	movw	r30, r8
-    fd02:	81 93       	st	Z+, r24
-      while (--length);
-    fd04:	4f 01       	movw	r8, r30
-    fd06:	f1 e0       	ldi	r31, 0x01	; 1
-    fd08:	af 1a       	sub	r10, r31
-    fd0a:	b1 08       	sbc	r11, r1
-
-      // Read command terminator, start reply
-      verifySpace();
-    fd0c:	c1 f7       	brne	.-16     	; 0xfcfe <main+0xe4>
-    fd0e:	81 d0       	rcall	.+258    	; 0xfe12 <verifySpace>
- * void writebuffer(memtype, buffer, address, length)
- */
-static inline void writebuffer(int8_t memtype, addr16_t mybuff,
-			       addr16_t address, pagelen_t len)
-{
-    switch (memtype) {
-    fd10:	85 e4       	ldi	r24, 0x45	; 69
-    fd12:	c8 12       	cpse	r12, r24
-    fd14:	12 c0       	rjmp	.+36     	; 0xfd3a <main+0x120>
-    fd16:	d3 95       	inc	r29
-    fd18:	48 01       	movw	r8, r16
-    fd1a:	a1 2c       	mov	r10, r1
-    fd1c:	bb 24       	eor	r11, r11
-    case 'E': // EEPROM
-#if defined(SUPPORT_EEPROM) || defined(BIGBOOT)
-        while(len--) {
-    fd1e:	b3 94       	inc	r11
-    fd20:	ac 16       	cp	r10, r28
-    fd22:	bd 06       	cpc	r11, r29
-    fd24:	09 f4       	brne	.+2      	; 0xfd28 <main+0x10e>
-	    eeprom_write_byte((address.bptr++), *(mybuff.bptr++));
-    fd26:	59 c0       	rjmp	.+178    	; 0xfdda <main+0x1c0>
-    fd28:	f5 01       	movw	r30, r10
-    fd2a:	61 91       	ld	r22, Z+
-    fd2c:	5f 01       	movw	r10, r30
-    fd2e:	c4 01       	movw	r24, r8
-    fd30:	97 d0       	rcall	.+302    	; 0xfe60 <eeprom_write_byte>
-    fd32:	ff ef       	ldi	r31, 0xFF	; 255
-    fd34:	8f 1a       	sub	r8, r31
-    fd36:	9f 0a       	sbc	r9, r31
-    fd38:	f3 cf       	rjmp	.-26     	; 0xfd20 <main+0x106>
-	     * and we needed the space back.
-	     */
-#ifdef FOURPAGEERASE
-	    if ((address.bytes[0] & ((SPM_PAGESIZE<<2)-1))==0) {
-#endif
-	    __boot_page_erase_short(address.word);
-    fd3a:	83 e0       	ldi	r24, 0x03	; 3
-    fd3c:	f8 01       	movw	r30, r16
-    fd3e:	87 bf       	out	0x37, r24	; 55
-    fd40:	e8 95       	spm
-	    boot_spm_busy_wait();
-    fd42:	07 b6       	in	r0, 0x37	; 55
-    fd44:	00 fc       	sbrc	r0, 0
-    fd46:	fd cf       	rjmp	.-6      	; 0xfd42 <main+0x128>
-    fd48:	a0 e0       	ldi	r26, 0x00	; 0
-    fd4a:	b1 e0       	ldi	r27, 0x01	; 1
-    fd4c:	f8 01       	movw	r30, r16
-
-	    /*
-	     * Copy data from the buffer into the flash write buffer.
-	     */
-	    do {
-		__boot_page_fill_short((uint16_t)(void*)addrPtr, *(mybuff.wptr++));
-    fd4e:	8d 91       	ld	r24, X+
-    fd50:	9d 91       	ld	r25, X+
-    fd52:	0c 01       	movw	r0, r24
-    fd54:	f7 be       	out	0x37, r15	; 55
-    fd56:	e8 95       	spm
-		addrPtr += 2;
-	    } while (len -= 2);
-    fd58:	11 24       	eor	r1, r1
-    fd5a:	22 97       	sbiw	r28, 0x02	; 2
-    fd5c:	32 96       	adiw	r30, 0x02	; 2
-    fd5e:	20 97       	sbiw	r28, 0x00	; 0
-
-	    /*
-	     * Actually Write the buffer to flash (and wait for it to finish.)
-	     */
-	    __boot_page_write_short(address.word);
-    fd60:	b1 f7       	brne	.-20     	; 0xfd4e <main+0x134>
-    fd62:	f8 01       	movw	r30, r16
-	    boot_spm_busy_wait();
-    fd64:	e7 be       	out	0x37, r14	; 55
-    fd66:	e8 95       	spm
-#if defined(RWWSRE)
-	    // Reenable read access to flash
-	    __boot_rww_enable_short();
-    fd68:	07 b6       	in	r0, 0x37	; 55
-    fd6a:	00 fc       	sbrc	r0, 0
-    fd6c:	fd cf       	rjmp	.-6      	; 0xfd68 <main+0x14e>
-      writebuffer(desttype, buff, address, savelength);
-
-
-    }
-    /* Read memory block mode, length is big endian.  */
-    else if(ch == STK_READ_PAGE) {
-    fd6e:	d7 be       	out	0x37, r13	; 55
-    fd70:	e8 95       	spm
-      uint8_t desttype;
-      GETLENGTH(length);
-    fd72:	33 c0       	rjmp	.+102    	; 0xfdda <main+0x1c0>
-    fd74:	84 37       	cpi	r24, 0x74	; 116
-    fd76:	19 f5       	brne	.+70     	; 0xfdbe <main+0x1a4>
-    fd78:	3a d0       	rcall	.+116    	; 0xfdee <getch>
-    fd7a:	c8 2f       	mov	r28, r24
-    fd7c:	d0 e0       	ldi	r29, 0x00	; 0
-    fd7e:	dc 2f       	mov	r29, r28
-    fd80:	cc 27       	eor	r28, r28
-
-      desttype = getch();
-    fd82:	35 d0       	rcall	.+106    	; 0xfdee <getch>
-    fd84:	5e 01       	movw	r10, r28
-    fd86:	a8 2a       	or	r10, r24
-
-      verifySpace();
-    fd88:	32 d0       	rcall	.+100    	; 0xfdee <getch>
-    fd8a:	98 2e       	mov	r9, r24
-
-static inline void read_mem(uint8_t memtype, addr16_t address, pagelen_t length)
-{
-    uint8_t ch;
-
-    switch (memtype) {
-    fd8c:	42 d0       	rcall	.+132    	; 0xfe12 <verifySpace>
-    fd8e:	e8 01       	movw	r28, r16
-    fd90:	f5 e4       	ldi	r31, 0x45	; 69
-
-#if defined(SUPPORT_EEPROM) || defined(BIGBOOT)
-    case 'E': // EEPROM
-	do {
-	    putch(eeprom_read_byte((address.bptr++)));
-    fd92:	9f 12       	cpse	r9, r31
-    fd94:	0b c0       	rjmp	.+22     	; 0xfdac <main+0x192>
-    fd96:	ce 01       	movw	r24, r28
-    fd98:	5b d0       	rcall	.+182    	; 0xfe50 <eeprom_read_byte>
-	} while (--length);
-    fd9a:	22 d0       	rcall	.+68     	; 0xfde0 <putch>
-    fd9c:	81 e0       	ldi	r24, 0x01	; 1
-    fd9e:	a8 1a       	sub	r10, r24
-    fda0:	b1 08       	sbc	r11, r1
-    fda2:	21 96       	adiw	r28, 0x01	; 1
-    fda4:	a1 14       	cp	r10, r1
-    fda6:	b1 04       	cpc	r11, r1
-	    //      while (--length);
-	    // read a Flash and increment the address (may increment RAMPZ)
-	    __asm__ ("elpm %0,Z+\n" : "=r" (ch), "=z" (address.bptr): "1" (address));
-#else
-	    // read a Flash byte and increment the address
-	    __asm__ ("lpm %0,Z+\n" : "=r" (ch), "=z" (address.bptr): "1" (address));
-    fda8:	b1 f7       	brne	.-20     	; 0xfd96 <main+0x17c>
-    fdaa:	17 c0       	rjmp	.+46     	; 0xfdda <main+0x1c0>
-#endif
-	    putch(ch);
-    fdac:	fe 01       	movw	r30, r28
-    fdae:	85 91       	lpm	r24, Z+
-	} while (--length);
-    fdb0:	ef 01       	movw	r28, r30
-    fdb2:	16 d0       	rcall	.+44     	; 0xfde0 <putch>
-    fdb4:	e1 e0       	ldi	r30, 0x01	; 1
-    fdb6:	ae 1a       	sub	r10, r30
-    fdb8:	b1 08       	sbc	r11, r1
-
-      read_mem(desttype, address, length);
-    }
-
-    /* Get device signature bytes  */
-    else if(ch == STK_READ_SIGN) {
-    fdba:	c1 f7       	brne	.-16     	; 0xfdac <main+0x192>
-    fdbc:	0e c0       	rjmp	.+28     	; 0xfdda <main+0x1c0>
-      // READ SIGN - return what Avrdude wants to hear
-      verifySpace();
-    fdbe:	85 37       	cpi	r24, 0x75	; 117
-    fdc0:	39 f4       	brne	.+14     	; 0xfdd0 <main+0x1b6>
-      putch(SIGNATURE_0);
-    fdc2:	27 d0       	rcall	.+78     	; 0xfe12 <verifySpace>
-    fdc4:	8e e1       	ldi	r24, 0x1E	; 30
-    fdc6:	0c d0       	rcall	.+24     	; 0xfde0 <putch>
-      putch(SIGNATURE_1);
-    fdc8:	86 e9       	ldi	r24, 0x96	; 150
-    fdca:	0a d0       	rcall	.+20     	; 0xfde0 <putch>
-    fdcc:	8a e0       	ldi	r24, 0x0A	; 10
-      putch(SIGNATURE_2);
-    fdce:	6d cf       	rjmp	.-294    	; 0xfcaa <main+0x90>
-    fdd0:	81 35       	cpi	r24, 0x51	; 81
-    }
-    else if (ch == STK_LEAVE_PROGMODE) { /* 'Q' */
-    fdd2:	11 f4       	brne	.+4      	; 0xfdd8 <main+0x1be>
-    fdd4:	88 e0       	ldi	r24, 0x08	; 8
-      // Adaboot no-wait mod
-      watchdogConfig(WATCHDOG_16MS);
-    fdd6:	17 d0       	rcall	.+46     	; 0xfe06 <watchdogConfig>
-    fdd8:	1c d0       	rcall	.+56     	; 0xfe12 <verifySpace>
-    fdda:	80 e1       	ldi	r24, 0x10	; 16
-      verifySpace();
-    }
-    else {
-      // This covers the response to commands like STK_ENTER_PROGMODE
-      verifySpace();
-    fddc:	01 d0       	rcall	.+2      	; 0xfde0 <putch>
-    fdde:	58 cf       	rjmp	.-336    	; 0xfc90 <main+0x76>
-
-0000fde0 <putch>:
-    }
-    putch(STK_OK);
-    fde0:	90 91 c0 00 	lds	r25, 0x00C0	; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7e00c0>
-    fde4:	95 ff       	sbrs	r25, 5
-  }
-    fde6:	fc cf       	rjmp	.-8      	; 0xfde0 <putch>
-    while (!(UART_SRA & _BV(UDRE0))) {  /* Spin */ }
-  #else
-    while (!(LINSIR & _BV(LTXOK)))   {  /* Spin */ }
-  #endif
-
-  UART_UDR = ch;
-    fde8:	80 93 c6 00 	sts	0x00C6, r24	; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7e00c6>
-    fdec:	08 95       	ret
-
-0000fdee <getch>:
-    :
-      "r25"
-);
-#else
-#ifndef LIN_UART
-  while(!(UART_SRA & _BV(RXC0)))  {  /* Spin */ }
-    fdee:	80 91 c0 00 	lds	r24, 0x00C0	; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7e00c0>
-    fdf2:	87 ff       	sbrs	r24, 7
-    fdf4:	fc cf       	rjmp	.-8      	; 0xfdee <getch>
-  if (!(UART_SRA & _BV(FE0))) {
-    fdf6:	80 91 c0 00 	lds	r24, 0x00C0	; 0x8000c0 <__TEXT_REGION_LENGTH__+0x7e00c0>
-    fdfa:	84 fd       	sbrc	r24, 4
-    fdfc:	01 c0       	rjmp	.+2      	; 0xfe00 <getch+0x12>
-}
-#endif
-
-// Watchdog functions. These are only safe with interrupts turned off.
-void watchdogReset() {
-  __asm__ __volatile__ (
-    fdfe:	a8 95       	wdr
-       * don't care that an invalid char is returned...)
-       */
-    watchdogReset();
-  }
-
-  ch = UART_UDR;
-    fe00:	80 91 c6 00 	lds	r24, 0x00C6	; 0x8000c6 <__TEXT_REGION_LENGTH__+0x7e00c6>
-  LED_PIN |= _BV(LED);
-#endif
-#endif
-
-  return ch;
-}
-    fe04:	08 95       	ret
-
-0000fe06 <watchdogConfig>:
-}
-
-void watchdogConfig(uint8_t x) {
-#ifdef WDCE //does it have a Watchdog Change Enable?
- #ifdef WDTCSR
-  WDTCSR = _BV(WDCE) | _BV(WDE);
-    fe06:	e0 e6       	ldi	r30, 0x60	; 96
-    fe08:	f0 e0       	ldi	r31, 0x00	; 0
-    fe0a:	98 e1       	ldi	r25, 0x18	; 24
-    fe0c:	90 83       	st	Z, r25
-#else //then it must be one of those newfangled ones that use CCP
-  CCP=0xD8; //so write this magic number to CCP
-#endif 
-
-#ifdef WDTCSR
-  WDTCSR = x;
-    fe0e:	80 83       	st	Z, r24
-    fe10:	08 95       	ret
-
-0000fe12 <verifySpace>:
-  do getch(); while (--count);
-  verifySpace();
-}
-
-void verifySpace() {
-  if (getch() != CRC_EOP) {
-    fe12:	ed df       	rcall	.-38     	; 0xfdee <getch>
-    fe14:	80 32       	cpi	r24, 0x20	; 32
-    fe16:	19 f0       	breq	.+6      	; 0xfe1e <verifySpace+0xc>
-    watchdogConfig(WATCHDOG_16MS);    // shorten WD timeout
-    fe18:	88 e0       	ldi	r24, 0x08	; 8
-    fe1a:	f5 df       	rcall	.-22     	; 0xfe06 <watchdogConfig>
-    fe1c:	ff cf       	rjmp	.-2      	; 0xfe1c <verifySpace+0xa>
-    while (1)			      // and busy-loop so that WD causes
-      ;				      //  a reset and app start.
-  }
-  putch(STK_INSYNC);
-    fe1e:	84 e1       	ldi	r24, 0x14	; 20
-    fe20:	df cf       	rjmp	.-66     	; 0xfde0 <putch>
-
-0000fe22 <getNch>:
-    ::[count] "M" (UART_B_VALUE)
-  );
-}
-#endif
-
-void getNch(uint8_t count) {
-    fe22:	cf 93       	push	r28
-    fe24:	c8 2f       	mov	r28, r24
-  do getch(); while (--count);
-    fe26:	e3 df       	rcall	.-58     	; 0xfdee <getch>
-    fe28:	c1 50       	subi	r28, 0x01	; 1
-    fe2a:	e9 f7       	brne	.-6      	; 0xfe26 <getNch+0x4>
-  verifySpace();
-}
-    fe2c:	cf 91       	pop	r28
-}
-#endif
-
-void getNch(uint8_t count) {
-  do getch(); while (--count);
-  verifySpace();
-    fe2e:	f1 cf       	rjmp	.-30     	; 0xfe12 <verifySpace>
-
-0000fe30 <do_spm>:
-    fe30:	fc 01       	movw	r30, r24
- *   data=0 in WRITE
- */
-static void do_spm(uint16_t address, uint8_t command, uint16_t data)  __attribute__ ((used));
-static void do_spm(uint16_t address, uint8_t command, uint16_t data) {
-    // Do spm stuff
-    asm volatile (
-    fe32:	0a 01       	movw	r0, r20
-    fe34:	67 bf       	out	0x37, r22	; 55
-    fe36:	e8 95       	spm
-    fe38:	11 24       	eor	r1, r1
-    fe3a:	07 b6       	in	r0, 0x37	; 55
-    );
-
-    // wait for spm to complete
-    //   it doesn't have much sense for __BOOT_PAGE_FILL,
-    //   but it doesn't hurt and saves some bytes on 'if'
-    boot_spm_busy_wait();
-    fe3c:	00 fc       	sbrc	r0, 0
-    fe3e:	fd cf       	rjmp	.-6      	; 0xfe3a <do_spm+0xa>
-    fe40:	66 70       	andi	r22, 0x06	; 6
-#if defined(RWWSRE)
-    // this 'if' condition should be: (command == __BOOT_PAGE_WRITE || command == __BOOT_PAGE_ERASE)...
-    // but it's tweaked a little assuming that in every command we are interested in here, there
-    // must be also SELFPRGEN set. If we skip checking this bit, we save here 4B
-    if ((command & (_BV(PGWRT)|_BV(PGERS))) && (data == 0) ) {
-    fe42:	29 f0       	breq	.+10     	; 0xfe4e <do_spm+0x1e>
-    fe44:	45 2b       	or	r20, r21
-    fe46:	19 f4       	brne	.+6      	; 0xfe4e <do_spm+0x1e>
-    fe48:	81 e1       	ldi	r24, 0x11	; 17
-      // Reenable read access to flash
-      __boot_rww_enable_short();
-    fe4a:	87 bf       	out	0x37, r24	; 55
-    fe4c:	e8 95       	spm
-    fe4e:	08 95       	ret
-
-0000fe50 <eeprom_read_byte>:
-    fe50:	f9 99       	sbic	0x1f, 1	; 31
-    fe52:	fe cf       	rjmp	.-4      	; 0xfe50 <eeprom_read_byte>
-    fe54:	92 bd       	out	0x22, r25	; 34
-    fe56:	81 bd       	out	0x21, r24	; 33
-    fe58:	f8 9a       	sbi	0x1f, 0	; 31
-    fe5a:	99 27       	eor	r25, r25
-    fe5c:	80 b5       	in	r24, 0x20	; 32
-    fe5e:	08 95       	ret
-
-0000fe60 <eeprom_write_byte>:
-    fe60:	26 2f       	mov	r18, r22
-
-0000fe62 <eeprom_write_r18>:
-    fe62:	f9 99       	sbic	0x1f, 1	; 31
-    fe64:	fe cf       	rjmp	.-4      	; 0xfe62 <eeprom_write_r18>
-    fe66:	1f ba       	out	0x1f, r1	; 31
-    fe68:	92 bd       	out	0x22, r25	; 34
-    fe6a:	81 bd       	out	0x21, r24	; 33
-    fe6c:	20 bd       	out	0x20, r18	; 32
-    fe6e:	0f b6       	in	r0, 0x3f	; 63
-    fe70:	f8 94       	cli
-    fe72:	fa 9a       	sbi	0x1f, 2	; 31
-    fe74:	f9 9a       	sbi	0x1f, 1	; 31
-    fe76:	0f be       	out	0x3f, r0	; 63
-    fe78:	01 96       	adiw	r24, 0x01	; 1
-    fe7a:	08 95       	ret

+ 0 - 0
optiboot/release.sh