Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug #53703] FT232H based programmer returns all 0xFF when reading flash from atmega2560 #474

Closed
avrs-admin opened this issue Dec 11, 2021 · 23 comments
Labels
bug Something isn't working

Comments

@avrs-admin
Copy link

Christoph ceaich@gmx.de
Thu 19 Apr 2018 10:07:59 PM UTC
Programmer hardware: FT232H
Device type: m2560

avrftdi.c does not send load extended address byte command when address is lower than 64k word but using a device which need this command. See attached patch for bug-fix.

file #43979: avrftdi.c.patch

This issue was migrated from https://savannah.nongnu.org/bugs/?53703

@mcuee
Copy link
Collaborator

mcuee commented Jun 5, 2022

This patch may be a valid one. I will try to set up my FT2232H based programmer to carry out this test.

diff -rupN avrdude-6.3.orig/avrftdi.c avrdude-6.3/avrftdi.c
--- avrdude-6.3.orig/avrftdi.c	2016-02-15 21:30:35.000000000 +0100
+++ avrdude-6.3/avrftdi.c	2018-04-20 02:54:06.000000000 +0200
@@ -1009,7 +1009,7 @@ static int avrftdi_flash_write(PROGRAMME
 	 * bytes.
 	 * write the command only once.
 	 */
-	if(use_lext_address && (((addr/2) & 0xffff0000))) {
+	if (use_lext_address && (addr == 0 || ((addr/2) % /*ext_address_boundary*/ 65536) == 0)) {
 		if (0 > avrftdi_lext(pgm, p, m, addr/2))
 			return -1;
 	}
@@ -1117,7 +1117,7 @@ static int avrftdi_flash_read(PROGRAMMER
 		return -1;
 	}
 	
-	if(use_lext_address && ((address & 0xffff0000))) {
+	if (use_lext_address && (address == 0 || (address % /*ext_address_boundary*/ 65536) == 0)) {
 		if (0 > avrftdi_lext(pgm, p, m, address))
 			return -1;
 	}


@mcuee
Copy link
Collaborator

mcuee commented Jun 8, 2022

It seems to me that I can not flash the ATmega2560 with avrftdi (JTAGKey-2 FT2232H based). I will carry out more tests.

PS C:\work\avr\avrdude_test\avrdude-v7.0-windows-x64>  .\avrdude.exe -p m2560 -c jtagkey 
-U flash:w:.\Blink.ino.with_bootloader.mega.hex:i -v

avrdude.exe: Version 7.0
             Copyright (c) Brian Dean, http://www.bdmicro.com/
             Copyright (c) Joerg Wunsch

             System wide configuration file is "C:/work/avr/avrdude_test/avrdude-v7.0-windows-x64/avrdude.conf"

             Using Port                    : usb
             Using Programmer              : jtagkey
             AVR Part                      : ATmega2560
             Chip Erase delay              : 9000 us
             PAGEL                         : PD7
             BS2                           : PA0
             RESET disposition             : dedicated
             RETRY pulse                   : SCK
             Serial program mode           : yes
             Parallel program mode         : yes
             Timeout                       : 200
             StabDelay                     : 100
             CmdexeDelay                   : 25
             SyncLoops                     : 32
             PollIndex                     : 3
             PollValue                     : 0x53
             Memory Detail                 :

                                               Block Poll               Page                       Polled
               Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               eeprom                 65    10     8    0 no       4096    8      0  9000  9000 0x00 0x00
               flash                  65    10   256    0 yes    262144  256   1024  4500  4500 0x00 0x00
               lfuse                   0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
               hfuse                   0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
               efuse                   0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
               lock                    0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
               calibration             0     0     0    0 no          1    1      0     0     0 0x00 0x00
               signature               0     0     0    0 no          3    1      0     0     0 0x00 0x00

             Programmer Type : avrftdi
             Description     : Amontec JTAGKey, JTAGKey-Tiny and JTAGKey2

avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude.exe: Device signature = 0x1e9801 (probably m2560)
avrdude.exe: NOTE: "flash" memory has been specified, an erase cycle will be performed
             To disable this feature, specify the -D option.
avrdude.exe: erasing chip
avrdude.exe: reading input file ".\Blink.ino.with_bootloader.mega.hex"
avrdude.exe: writing flash (261406 bytes):

Writing | #                                                  | 2% 0.06s
(hang here)

@mcuee
Copy link
Collaborator

mcuee commented Jun 8, 2022

Reading also has some problem with content mis-match but not really returns all 0xFF.

PS C:\work\avr\avrdude_test\avrdude-v7.0-windows-x64>  .\avrdude.exe -p m2560 -c jtagkey 
-U flash:r:.\mega2560_test_ftdi2232h_read.hex:i

avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude.exe: Device signature = 0x1e9801 (probably m2560)
avrdude.exe: reading flash memory:

Reading | ################################################## | 100% 57.58s

avrdude.exe: writing output file ".\mega2560_test_ftdi2232h_read.hex"

avrdude.exe done.  Thank you.

PS C:\work\avr\avrdude_test\avrdude-v7.0-windows-x64>  .\avrdude.exe -p m2560 -c jtagkey 
-U flash:v:.\mega2560_test_ftdi2232h_read.hex:i

avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude.exe: Device signature = 0x1e9801 (probably m2560)
avrdude.exe: verifying flash memory against .\mega2560_test_ftdi2232h_read.hex:

Reading | ################################################## | 100% 57.44s

avrdude.exe: 261414 bytes of flash verified

avrdude.exe done.  Thank you.

But using the bootloader and AVR Dragon shows that verification failed at 0x1e000.

PS C:\work\avr\avrdude_test\avrdude-v7.0-windows-x64>  .\avrdude.exe -p m2560 -c wiring -P COM6 
-U flash:v:.\mega2560_test_ftdi2232h_read.hex:i

avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude.exe: Device signature = 0x1e9801 (probably m2560)
avrdude.exe: verifying flash memory against .\mega2560_test_ftdi2232h_read.hex:

Reading | ################################################## | 100% 30.95s

avrdude.exe: verification error, first mismatch at byte 0x1e000
             0xff != 0x0d
avrdude.exe: verification error; content mismatch

avrdude.exe done.  Thank you.

PS C:\work\avr\avrdude_test\avrdude-v7.0-windows-x64>  .\avrdude.exe -p m2560 -c dragon_isp 
-U flash:v:.\mega2560_test_ftdi2232h_read.hex:i

avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.15s

avrdude.exe: Device signature = 0x1e9801 (probably m2560)
avrdude.exe: verifying flash memory against .\mega2560_test_ftdi2232h_read.hex:

Reading | ################################################## | 100% 120.73s

avrdude.exe: verification error, first mismatch at byte 0x1e000
             0xff != 0x0d
avrdude.exe: verification error; content mismatch

avrdude.exe done.  Thank you.

@mcuee
Copy link
Collaborator

mcuee commented Jun 8, 2022

Readback differences using FT2232H and AVR Dragon.

Using the wiring bootloader to verify -- this shows that AVR Dragon is correct.

PS C:\work\avr\avrdude_test\avrdude-v7.0-windows-x64>  .\avrdude.exe -p m2560 -c wiring -P COM6 
-U flash:v:.\mega2560_test_dragonisp_read.hex:i

avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude.exe: Device signature = 0x1e9801 (probably m2560)
avrdude.exe: verifying flash memory against .\mega2560_test_dragonisp_read.hex:

Reading | ################################################## | 100% 30.92s

avrdude.exe: 261414 bytes of flash verified

avrdude.exe done.  Thank you.

PS C:\work\avr\avrdude_test\avrdude-v7.0-windows-x64>  .\avrdude.exe -p m2560 -c wiring -P COM6 
-U flash:v:.\mega2560_test_ftdi2232h_read.hex:i

avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude.exe: Device signature = 0x1e9801 (probably m2560)
avrdude.exe: verifying flash memory against .\mega2560_test_ftdi2232h_read.hex:

Reading | ################################################## | 100% 30.92s

avrdude.exe: verification error, first mismatch at byte 0x1e000
             0xff != 0x0d
avrdude.exe: verification error; content mismatch

avrdude.exe done.  Thank you.

mega2560_test_dragonisp_read.hex.txt
mega2560_test_ftdi2232h_read.hex.txt

@mcuee
Copy link
Collaborator

mcuee commented Jun 8, 2022

I can confirm the patch here fixed the reading issue for me.
avrdude_issue474.exe was built using MSY2 mingw64 so I need to switch the driver to WinUSB.

PS C:\work\avr\avrdude> git diff
diff --git a/src/avrftdi.c b/src/avrftdi.c
index e41d775..1a186ed 100644
--- a/src/avrftdi.c
+++ b/src/avrftdi.c
@@ -1021,7 +1021,7 @@ static int avrftdi_flash_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
         * bytes.
         * write the command only once.
         */
-       if(use_lext_address && (((addr/2) & 0xffff0000))) {
+       if (use_lext_address && (addr == 0 || ((addr/2) % /*ext_address_boundary*/ 65536) == 0)) {
                if (0 > avrftdi_lext(pgm, p, m, addr/2))
                        return -1;
        }
@@ -1128,7 +1128,7 @@ static int avrftdi_flash_read(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
                return -1;
        }

-       if(use_lext_address && ((address & 0xffff0000))) {
+       if (use_lext_address && (address == 0 || (address % /*ext_address_boundary*/ 65536) == 0)) {
                if (0 > avrftdi_lext(pgm, p, m, address))
                        return -1;
        }

PS C:\work\avr\avrdude_test\avrdude-7.0_bin64>  .\avrdude_issue474.exe -p m2560 -c jtagkey 
-U flash:r:.\mega2560_test_ftdi2232h_read474.hex:i

avrdude_issue474.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude_issue474.exe: Device signature = 0x1e9801 (probably m2560)
avrdude_issue474.exe: reading flash memory:

Reading | ################################################## | 100% 57.90s

avrdude_issue474.exe: writing output file ".\mega2560_test_ftdi2232h_read474.hex"

avrdude_issue474.exe done.  Thank you.

PS C:\work\avr\avrdude_test\avrdude-7.0_bin64>  .\avrdude.exe -p m2560 -c wiring -P COM6 
-U flash:v:.\mega2560_test_ftdi2232h_read474.hex:i

avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude.exe: Device signature = 0x1e9801 (probably m2560)
avrdude.exe: verifying flash memory against .\mega2560_test_ftdi2232h_read474.hex:

Reading | ################################################## | 100% 31.77s

avrdude.exe: 261414 bytes of flash verified

avrdude.exe done.  Thank you.

PS C:\work\avr\avrdude_test\avrdude-7.0_bin64>  .\avrdude.exe -p m2560 -c dragon_isp 
-U flash:v:.\mega2560_test_ftdi2232h_read474.hex:i

avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.17s

avrdude.exe: Device signature = 0x1e9801 (probably m2560)
avrdude.exe: verifying flash memory against .\mega2560_test_ftdi2232h_read474.hex:

Reading | ################################################## | 100% 122.06s

avrdude.exe: 261414 bytes of flash verified

avrdude.exe done.  Thank you.

@mcuee
Copy link
Collaborator

mcuee commented Jun 8, 2022

It also fixed the write issue for me.

Before the fix:

PS C:\work\avr\avrdude_test\avrdude-7.0_bin64>  .\avrdude.exe -p m2560 -c jtagkey -D 
-U flash:w:.\Blink.ino.mega.hex:i -vvvv
executable_abspath = C:/work/avr/avrdude_test/avrdude-7.0_bin64/avrdude.exe
executable_abspath_len = 54
executable_dirpath = C:/work/avr/avrdude_test/avrdude-7.0_bin64
executable_dirpath_len = 42
sys_config = C:/work/avr/avrdude_test/avrdude-7.0_bin64/avrdude.conf
sys_config_found = true


avrdude.exe: Version 7.0
             Copyright (c) Brian Dean, http://www.bdmicro.com/
             Copyright (c) Joerg Wunsch

             System wide configuration file is "C:/work/avr/avrdude_test/avrdude-7.0_bin64/avrdude.conf"

             Using Port                    : usb
             Using Programmer              : jtagkey
I avrftdi_open(713): Using device VID:PID 0403:cff8 and SN '(null)' on interface A.
D write_flush(478): Setting pin direction (0x0000) and value (0x0000)
T write_flush(490): Set pins command: 80 00 00 82 00 00
I set_frequency(210): Using frequency: 150000
I set_frequency(211): Clock divisor: 0x0027
D avrftdi_check_pins_mpsse(571): Using valid mask mpsse: 0x0000fff8
avrdude.exe: <unknown>: Pin is ok.
avrdude.exe: VCC: Pin is ok.
avrdude.exe: BUFF: Pin is ok.
avrdude.exe: RESET: Pin is ok.
avrdude.exe: SCK: Pin is ok.
avrdude.exe: MOSI: Pin is ok.
avrdude.exe: MISO: Pin is ok.
avrdude.exe: ERRLED: Pin is ok.
avrdude.exe: RDYLED: Pin is ok.
avrdude.exe: PGMLED: Pin is ok.
avrdude.exe: VFYLED: Pin is ok.
D avrftdi_check_pins_bb(535): Using valid mask bitbanging: 0x0000ffff
avrdude.exe: <unknown>: Pin is ok.
avrdude.exe: VCC: Pin is ok.
avrdude.exe: BUFF: Pin is ok.
avrdude.exe: RESET: Pin is ok.
avrdude.exe: SCK: Pin is ok.
avrdude.exe: MOSI: Pin is ok.
avrdude.exe: MISO: Pin is ok.
avrdude.exe: ERRLED: Pin is ok.
avrdude.exe: RDYLED: Pin is ok.
avrdude.exe: PGMLED: Pin is ok.
avrdude.exe: VFYLED: Pin is ok.
I avrftdi_pin_setup(645): Pin direction mask: 001b
I avrftdi_pin_setup(646): Pin value mask: 0010
             AVR Part                      : ATmega2560
             Chip Erase delay              : 9000 us
             PAGEL                         : PD7
             BS2                           : PA0
             RESET disposition             : dedicated
             RETRY pulse                   : SCK
             Serial program mode           : yes
             Parallel program mode         : yes
             Timeout                       : 200
             StabDelay                     : 100
             CmdexeDelay                   : 25
             SyncLoops                     : 32
             PollIndex                     : 3
             PollValue                     : 0x53
             Memory Detail                 :

                                               Block Poll               Page                       Polled
               Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               eeprom                 65    10     8    0 no       4096    8      0  9000  9000 0x00 0x00
                                               Block Poll               Page                       Polled
               Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               flash                  65    10   256    0 yes    262144  256   1024  4500  4500 0x00 0x00
                                               Block Poll               Page                       Polled
               Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               lfuse                   0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
                                               Block Poll               Page                       Polled
               Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               hfuse                   0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
                                               Block Poll               Page                       Polled
               Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               efuse                   0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
                                               Block Poll               Page                       Polled
               Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               lock                    0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
                                               Block Poll               Page                       Polled
               Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               calibration             0     0     0    0 no          1    1      0     0     0 0x00 0x00
                                               Block Poll               Page                       Polled
               Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               signature               0     0     0    0 no          3    1      0     0     0 0x00 0x00

             Programmer Type : avrftdi
             Description     : Amontec JTAGKey, JTAGKey-Tiny and JTAGKey2

D set_pin(240): Setting pin 4 (ADBUS4) as BUFF: high (low active)
D write_flush(478): Setting pin direction (0x001b) and value (0x0000)
T write_flush(490): Set pins command: 80 00 1b 82 00 00
D set_pin(240): Setting pin 3 (ADBUS3) as RESET: low (high active)
D write_flush(478): Setting pin direction (0x001b) and value (0x0000)
T write_flush(490): Set pins command: 80 00 1b 82 00 00
D set_pin(240): Setting pin 0 (ADBUS0) as SCK: low (high active)
D write_flush(478): Setting pin direction (0x001b) and value (0x0000)
T write_flush(490): Set pins command: 80 00 1b 82 00 00
D set_pin(240): Setting pin 3 (ADBUS3) as RESET: high (high active)
D write_flush(478): Setting pin direction (0x001b) and value (0x0008)
T write_flush(490): Set pins command: 80 08 1b 82 00 00
D set_pin(240): Setting pin 3 (ADBUS3) as RESET: low (high active)
D write_flush(478): Setting pin direction (0x001b) and value (0x0000)
T write_flush(490): Set pins command: 80 00 1b 82 00 00
avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude.exe: Device signature = 0x1e9801 (probably m2560)
avrdude.exe: reading input file ".\Blink.ino.mega.hex"
avrdude.exe: writing flash (1536 bytes):

Writing |                                             | 0% 0.00sD avrftdi_flash_write(1034): -< bytes = 0 of 256
D avrftdi_flash_write(1034): -< bytes = 2 of 256
D avrftdi_flash_write(1034): -< bytes = 4 of 256
D avrftdi_flash_write(1034): -< bytes = 6 of 256
D avrftdi_flash_write(1034): -< bytes = 8 of 256
D avrftdi_flash_write(1034): -< bytes = 10 of 256
D avrftdi_flash_write(1034): -< bytes = 12 of 256
D avrftdi_flash_write(1034): -< bytes = 14 of 256
D avrftdi_flash_write(1034): -< bytes = 16 of 256
D avrftdi_flash_write(1034): -< bytes = 18 of 256
D avrftdi_flash_write(1034): -< bytes = 20 of 256
D avrftdi_flash_write(1034): -< bytes = 22 of 256
D avrftdi_flash_write(1034): -< bytes = 24 of 256
D avrftdi_flash_write(1034): -< bytes = 26 of 256
D avrftdi_flash_write(1034): -< bytes = 28 of 256
D avrftdi_flash_write(1034): -< bytes = 30 of 256
D avrftdi_flash_write(1034): -< bytes = 32 of 256
D avrftdi_flash_write(1034): -< bytes = 34 of 256
D avrftdi_flash_write(1034): -< bytes = 36 of 256
D avrftdi_flash_write(1034): -< bytes = 38 of 256
D avrftdi_flash_write(1034): -< bytes = 40 of 256
D avrftdi_flash_write(1034): -< bytes = 42 of 256
D avrftdi_flash_write(1034): -< bytes = 44 of 256
D avrftdi_flash_write(1034): -< bytes = 46 of 256
D avrftdi_flash_write(1034): -< bytes = 48 of 256
D avrftdi_flash_write(1034): -< bytes = 50 of 256
D avrftdi_flash_write(1034): -< bytes = 52 of 256
D avrftdi_flash_write(1034): -< bytes = 54 of 256
D avrftdi_flash_write(1034): -< bytes = 56 of 256
D avrftdi_flash_write(1034): -< bytes = 58 of 256
D avrftdi_flash_write(1034): -< bytes = 60 of 256
D avrftdi_flash_write(1034): -< bytes = 62 of 256
D avrftdi_flash_write(1034): -< bytes = 64 of 256
D avrftdi_flash_write(1034): -< bytes = 66 of 256
D avrftdi_flash_write(1034): -< bytes = 68 of 256
D avrftdi_flash_write(1034): -< bytes = 70 of 256
D avrftdi_flash_write(1034): -< bytes = 72 of 256
D avrftdi_flash_write(1034): -< bytes = 74 of 256
D avrftdi_flash_write(1034): -< bytes = 76 of 256
D avrftdi_flash_write(1034): -< bytes = 78 of 256
D avrftdi_flash_write(1034): -< bytes = 80 of 256
D avrftdi_flash_write(1034): -< bytes = 82 of 256
D avrftdi_flash_write(1034): -< bytes = 84 of 256
D avrftdi_flash_write(1034): -< bytes = 86 of 256
D avrftdi_flash_write(1034): -< bytes = 88 of 256
D avrftdi_flash_write(1034): -< bytes = 90 of 256
D avrftdi_flash_write(1034): -< bytes = 92 of 256
D avrftdi_flash_write(1034): -< bytes = 94 of 256
D avrftdi_flash_write(1034): -< bytes = 96 of 256
D avrftdi_flash_write(1034): -< bytes = 98 of 256
D avrftdi_flash_write(1034): -< bytes = 100 of 256
D avrftdi_flash_write(1034): -< bytes = 102 of 256
D avrftdi_flash_write(1034): -< bytes = 104 of 256
D avrftdi_flash_write(1034): -< bytes = 106 of 256
D avrftdi_flash_write(1034): -< bytes = 108 of 256
D avrftdi_flash_write(1034): -< bytes = 110 of 256
D avrftdi_flash_write(1034): -< bytes = 112 of 256
D avrftdi_flash_write(1034): -< bytes = 114 of 256
D avrftdi_flash_write(1034): -< bytes = 116 of 256
D avrftdi_flash_write(1034): -< bytes = 118 of 256
D avrftdi_flash_write(1034): -< bytes = 120 of 256
D avrftdi_flash_write(1034): -< bytes = 122 of 256
D avrftdi_flash_write(1034): -< bytes = 124 of 256
D avrftdi_flash_write(1034): -< bytes = 126 of 256
D avrftdi_flash_write(1034): -< bytes = 128 of 256
D avrftdi_flash_write(1034): -< bytes = 130 of 256
D avrftdi_flash_write(1034): -< bytes = 132 of 256
D avrftdi_flash_write(1034): -< bytes = 134 of 256
D avrftdi_flash_write(1034): -< bytes = 136 of 256
D avrftdi_flash_write(1034): -< bytes = 138 of 256
D avrftdi_flash_write(1034): -< bytes = 140 of 256
D avrftdi_flash_write(1034): -< bytes = 142 of 256
D avrftdi_flash_write(1034): -< bytes = 144 of 256
D avrftdi_flash_write(1034): -< bytes = 146 of 256
D avrftdi_flash_write(1034): -< bytes = 148 of 256
D avrftdi_flash_write(1034): -< bytes = 150 of 256
D avrftdi_flash_write(1034): -< bytes = 152 of 256
D avrftdi_flash_write(1034): -< bytes = 154 of 256
D avrftdi_flash_write(1034): -< bytes = 156 of 256
D avrftdi_flash_write(1034): -< bytes = 158 of 256
D avrftdi_flash_write(1034): -< bytes = 160 of 256
D avrftdi_flash_write(1034): -< bytes = 162 of 256
D avrftdi_flash_write(1034): -< bytes = 164 of 256
D avrftdi_flash_write(1034): -< bytes = 166 of 256
D avrftdi_flash_write(1034): -< bytes = 168 of 256
D avrftdi_flash_write(1034): -< bytes = 170 of 256
D avrftdi_flash_write(1034): -< bytes = 172 of 256
D avrftdi_flash_write(1034): -< bytes = 174 of 256
D avrftdi_flash_write(1034): -< bytes = 176 of 256
D avrftdi_flash_write(1034): -< bytes = 178 of 256
D avrftdi_flash_write(1034): -< bytes = 180 of 256
D avrftdi_flash_write(1034): -< bytes = 182 of 256
D avrftdi_flash_write(1034): -< bytes = 184 of 256
D avrftdi_flash_write(1034): -< bytes = 186 of 256
D avrftdi_flash_write(1034): -< bytes = 188 of 256
D avrftdi_flash_write(1034): -< bytes = 190 of 256
D avrftdi_flash_write(1034): -< bytes = 192 of 256
D avrftdi_flash_write(1034): -< bytes = 194 of 256
D avrftdi_flash_write(1034): -< bytes = 196 of 256
D avrftdi_flash_write(1034): -< bytes = 198 of 256
D avrftdi_flash_write(1034): -< bytes = 200 of 256
D avrftdi_flash_write(1034): -< bytes = 202 of 256
D avrftdi_flash_write(1034): -< bytes = 204 of 256
D avrftdi_flash_write(1034): -< bytes = 206 of 256
D avrftdi_flash_write(1034): -< bytes = 208 of 256
D avrftdi_flash_write(1034): -< bytes = 210 of 256
D avrftdi_flash_write(1034): -< bytes = 212 of 256
D avrftdi_flash_write(1034): -< bytes = 214 of 256
D avrftdi_flash_write(1034): -< bytes = 216 of 256
D avrftdi_flash_write(1034): -< bytes = 218 of 256
D avrftdi_flash_write(1034): -< bytes = 220 of 256
D avrftdi_flash_write(1034): -< bytes = 222 of 256
D avrftdi_flash_write(1034): -< bytes = 224 of 256
D avrftdi_flash_write(1034): -< bytes = 226 of 256
D avrftdi_flash_write(1034): -< bytes = 228 of 256
D avrftdi_flash_write(1034): -< bytes = 230 of 256
D avrftdi_flash_write(1034): -< bytes = 232 of 256
D avrftdi_flash_write(1034): -< bytes = 234 of 256
D avrftdi_flash_write(1034): -< bytes = 236 of 256
D avrftdi_flash_write(1034): -< bytes = 238 of 256
D avrftdi_flash_write(1034): -< bytes = 240 of 256
D avrftdi_flash_write(1034): -< bytes = 242 of 256
D avrftdi_flash_write(1034): -< bytes = 244 of 256
D avrftdi_flash_write(1034): -< bytes = 246 of 256
D avrftdi_flash_write(1034): -< bytes = 248 of 256
D avrftdi_flash_write(1034): -< bytes = 250 of 256
D avrftdi_flash_write(1034): -< bytes = 252 of 256
D avrftdi_flash_write(1034): -< bytes = 254 of 256
I avrftdi_flash_write(1074): Transmitting buffer of size: 1028
I avrftdi_flash_write(1080): Using m->buf[255] = 0x01 as polling value 
.....................................................

(keep doing this for quite long until I lost my patience and hit CTRL-C)

After the fix:

PS C:\work\avr\avrdude_test\avrdude-7.0_bin64>  .\avrdude_issue474.exe -p m2560 -c jtagkey -D 
-U flash:w:.\Blink.ino.mega.hex:i -v

avrdude_issue474.exe: Version 7.0-20220530 (feaa1c6)
                      Copyright (c) Brian Dean, http://www.bdmicro.com/
                      Copyright (c) Joerg Wunsch

                      System wide configuration file is "C:/work/avr/avrdude_test/avrdude-7.0_bin64/avrdude.conf"

                      Using Port                    : usb
                      Using Programmer              : jtagkey
                      AVR Part                      : ATmega2560
                      Chip Erase delay              : 9000 us
                      PAGEL                         : PD7
                      BS2                           : PA0
                      RESET disposition             : dedicated
                      RETRY pulse                   : SCK
                      Serial program mode           : yes
                      Parallel program mode         : yes
                      Timeout                       : 200
                      StabDelay                     : 100
                      CmdexeDelay                   : 25
                      SyncLoops                     : 32
                      PollIndex                     : 3
                      PollValue                     : 0x53
                      Memory Detail                 :

                                                        Block Poll               Page                       Polled
                        Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
                        ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
                        eeprom                 65    10     8    0 no       4096    8      0  9000  9000 0x00 0x00
                        flash                  65    10   256    0 yes    262144  256   1024  4500  4500 0x00 0x00
                        lfuse                   0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
                        hfuse                   0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
                        efuse                   0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
                        lock                    0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
                        calibration             0     0     0    0 no          1    1      0     0     0 0x00 0x00
                        signature               0     0     0    0 no          3    1      0     0     0 0x00 0x00

                      Programmer Type : avrftdi
                      Description     : Amontec JTAGKey, JTAGKey-Tiny and JTAGKey2

avrdude_issue474.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude_issue474.exe: Device signature = 0x1e9801 (probably m2560)
avrdude_issue474.exe: reading input file ".\Blink.ino.mega.hex"
avrdude_issue474.exe: writing flash (1536 bytes):

Writing | ################################################## | 100% 0.39s

avrdude_issue474.exe: 1536 bytes of flash written
avrdude_issue474.exe: verifying flash memory against .\Blink.ino.mega.hex:

Reading | ################################################## | 100% 0.36s

avrdude_issue474.exe: 1536 bytes of flash verified

avrdude_issue474.exe done.  Thank you.

@mcuee
Copy link
Collaborator

mcuee commented Jun 8, 2022

@dl8dtl and @mariusgreuel

My test shows that the patch (I applied the patch on git head) is good. Please apply. Thanks.

PS C:\work\avr\avrdude> git diff
diff --git a/src/avrftdi.c b/src/avrftdi.c
index e41d775..1a186ed 100644
--- a/src/avrftdi.c
+++ b/src/avrftdi.c
@@ -1021,7 +1021,7 @@ static int avrftdi_flash_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
         * bytes.
         * write the command only once.
         */
-       if(use_lext_address && (((addr/2) & 0xffff0000))) {
+       if (use_lext_address && (addr == 0 || ((addr/2) % /*ext_address_boundary*/ 65536) == 0)) {
                if (0 > avrftdi_lext(pgm, p, m, addr/2))
                        return -1;
        }
@@ -1128,7 +1128,7 @@ static int avrftdi_flash_read(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
                return -1;
        }

-       if(use_lext_address && ((address & 0xffff0000))) {
+       if (use_lext_address && (address == 0 || (address % /*ext_address_boundary*/ 65536) == 0)) {
                if (0 > avrftdi_lext(pgm, p, m, address))
                        return -1;
        }

PS C:\work\avr\avrdude_test\avrdude-7.0_bin64> .\avrdude_issue474.exe -v

avrdude_issue474.exe: Version 7.0-20220530 (feaa1c6)
                      Copyright (c) Brian Dean, http://www.bdmicro.com/
                      Copyright (c) Joerg Wunsch

                      System wide configuration file is "C:/work/avr/avrdude_test/avrdude-7.0_bin64/avrdude.conf"


avrdude_issue474.exe: no programmer has been specified on the command line or the config file
                      Specify a programmer using the -c option and try again

@MCUdude
Copy link
Collaborator

MCUdude commented Jun 8, 2022

Thanks for spending your time and testing this patch! As I don't have any 2232 hardware, @dl8dtl or @mariusgreuel should take a look at this. If they approve, someone should create a PR so we get this fix into the main branch.

@mariusgreuel
Copy link
Contributor

Both the old and patched code look fishy. Isn't the purpose of a lext command to set the upper 8 bits of a 24-bit address? To me, it makes little sense to trigger this based on the state of the lower 16 address bits. We need to send an lext when the upper 8 address bits do not match the CPUs upper 8 bits, i.e. the first time we start programming and every time the upper 8 address bits change.

Could you try programming a hex file that starts at at address 0x1000? I would assume that breaks the patch.

@mcuee
Copy link
Collaborator

mcuee commented Jun 9, 2022

Could you try programming a hex file that starts at at address 0x1000? I would assume that breaks the patch.

Yes I will try.

If you can come out with a more proper fix, I can test it out as well.

@mariusgreuel
Copy link
Contributor

@mcuee Thanks for all your help! Thinking about this, 0x1000 should probably be 0x11000.

@mcuee
Copy link
Collaborator

mcuee commented Jun 9, 2022

@mariusgreuel Sorry it takes a few iteration for me to generate the correct test hex file. So I have deleted a few posts to avoid cluttering this issue.

And you are exactly right, the patch here is not correct. It will fail with the contents starting at 0x11000.

PS C:\work\avr\avrdude_test\avrdude-7.0_bin64>  .\avrdude_issue474.exe -p m2560 -c jtagkey 
-U flash:w:.\atmega2560_0x11000_offset.hex:i -v

avrdude_issue474.exe: Version 7.0-20220530 (feaa1c6)
                      Copyright (c) Brian Dean, http://www.bdmicro.com/
                      Copyright (c) Joerg Wunsch

                      System wide configuration file is "C:/work/avr/avrdude_test/avrdude-7.0_bin64/avrdude.conf"

                      Using Port                    : usb
                      Using Programmer              : jtagkey
                      AVR Part                      : ATmega2560
                      Chip Erase delay              : 9000 us
                      PAGEL                         : PD7
                      BS2                           : PA0
                      RESET disposition             : dedicated
                      RETRY pulse                   : SCK
                      Serial program mode           : yes
                      Parallel program mode         : yes
                      Timeout                       : 200
                      StabDelay                     : 100
                      CmdexeDelay                   : 25
                      SyncLoops                     : 32
                      PollIndex                     : 3
                      PollValue                     : 0x53
                      Memory Detail                 :

                                                        Block Poll               Page                       Polled
                        Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
                        ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
                        eeprom                 65    10     8    0 no       4096    8      0  9000  9000 0x00 0x00
                        flash                  65    10   256    0 yes    262144  256   1024  4500  4500 0x00 0x00
                        lfuse                   0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
                        hfuse                   0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
                        efuse                   0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
                        lock                    0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
                        calibration             0     0     0    0 no          1    1      0     0     0 0x00 0x00
                        signature               0     0     0    0 no          3    1      0     0     0 0x00 0x00

                      Programmer Type : avrftdi
                      Description     : Amontec JTAGKey, JTAGKey-Tiny and JTAGKey2

avrdude_issue474.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude_issue474.exe: Device signature = 0x1e9801 (probably m2560)
avrdude_issue474.exe: NOTE: "flash" memory has been specified, an erase cycle will be performed
                      To disable this feature, specify the -D option.
avrdude_issue474.exe: erasing chip
avrdude_issue474.exe: reading input file ".\atmega2560_0x11000_offset.hex"
avrdude_issue474.exe: writing flash (261414 bytes):

Writing | ################################################## | 100% 0.13s

avrdude_issue474.exe: 261414 bytes of flash written
avrdude_issue474.exe: verifying flash memory against .\atmega2560_0x11000_offset.hex:

Reading | ################################################## | 100% 0.07s

avrdude_issue474.exe: 261414 bytes of flash verified

avrdude_issue474.exe done.  Thank you.

PS C:\work\avr\avrdude_test\avrdude-7.0_bin64>  .\avrdude_issue474.exe -p m2560 -c wiring -P COM9 -D 
-U flash:v:.\atmega2560_0x11000_offset.hex:i

avrdude_issue474.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.02s

avrdude_issue474.exe: Device signature = 0x1e9801 (probably m2560)
avrdude_issue474.exe: verifying flash memory against .\atmega2560_0x11000_offset.hex:

Reading | ################################################## | 100% 0.07s

avrdude_issue474.exe: verification error, first mismatch at byte 0x11000
                      0xff != 0x54
avrdude_issue474.exe: verification error; content mismatch

avrdude_issue474.exe done.  Thank you.

PS C:\work\avr\avrdude_test\avrdude-7.0_bin64>  .\avrdude_issue474.exe -p m2560 -c dragon_isp 
-U flash:v:.\atmega2560_0x11000_offset.hex:i

avrdude_issue474.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.17s

avrdude_issue474.exe: Device signature = 0x1e9801 (probably m2560)
avrdude_issue474.exe: verifying flash memory against .\atmega2560_0x11000_offset.hex:

Reading | ################################################## | 100% 0.07s

avrdude_issue474.exe: verification error, first mismatch at byte 0x11000
                      0xff != 0x54
avrdude_issue474.exe: verification error; content mismatch

avrdude_issue474.exe done.  Thank you.

atmega2560_0x11000_offset_new.hex.txt

@mcuee
Copy link
Collaborator

mcuee commented Jun 9, 2022

The test hex file is usng the ATmega2560 stk500v2 bootloader contents plus extra contents at 0x11000. The extra contents were generated by srec_cat.

$ srec_cat eepromtest.bin -offset 0x011000 -o eepromtest.srec
srec_cat: eepromtest.bin: 19: warning: no execution start address record

$ srec_cat eepromtest.srec  -o eepromtest_intel.hex -intel
srec_cat: eepromtest.srec: 19: warning: no execution start address record

$ cat eepromtest_intel.hex
:020000040001F9
:2010000054686520717569636B2062726F776E20666F78206A756D7073206F7665722074FE
:201020006865206C617A7920646F670A54686520717569636B2062726F776E20666F78206C
:201040006A756D7073206F76657220746865206C617A7920646F670A5468652071756963ED
:201060006B2062726F776E20666F78206A756D7073206F76657220746865206C617A7920C4
:20108000646F670A54686520717569636B2062726F776E20666F78206A756D7073206F76A5
:2010A000657220746865206C617A7920646F670A54686520717569636B2062726F776E20EE
:2010C000666F78206A756D7073206F76657220746865206C617A7920646F670A54686520B2
:2010E000717569636B2062726F776E20666F78206A756D7073206F76657220746865206C06
:20110000617A7920646F670A54686520717569636B2062726F776E20666F78206A756D7028
:2011200073206F76657220746865206C617A7920646F670A54686520717569636B20627269
:201140006F776E20666F78206A756D7073206F76657220746865206C617A7920646F670AFE
:2011600054686520717569636B2062726F776E20666F78206A756D7073206F76657220749D
:201180006865206C617A7920646F670A54686520717569636B2062726F776E20666F78200B
:2011A0006A756D7073206F76657220746865206C617A7920646F670A54686520717569638C
:2011C0006B2062726F776E20666F78206A756D7073206F76657220746865206C617A792063
:2011E000646F670A54686520717569636B2062726F776E20666F78206A756D7073206F7644
:00000001FF

@mcuee
Copy link
Collaborator

mcuee commented Jun 16, 2022

Both the old and patched code look fishy. Isn't the purpose of a lext command to set the upper 8 bits of a 24-bit address? To me, it makes little sense to trigger this based on the state of the lower 16 address bits. We need to send an lext when the upper 8 address bits do not match the CPUs upper 8 bits, i.e. the first time we start programming and every time the upper 8 address bits change.

Is the fix something like this? Or probably the command set is different.
https://github.com/avrdudes/avrdude/blob/main/src/stk500v2.c#L2281

// determine which command is to be used
  if (strcmp(m->desc, "flash") == 0) {
    addrshift = 1;
    commandbuf[0] = CMD_PROGRAM_FLASH_ISP;
    /*
     * If bit 31 is set, this indicates that the following read/write
     * operation will be performed on a memory that is larger than
     * 64KBytes. This is an indication to STK500 that a load extended
     * address must be executed.
     */
    if (m->op[AVR_OP_LOAD_EXT_ADDR] != NULL) {
      use_ext_addr = (1U << 31);
    }
  }

@mcuee
Copy link
Collaborator

mcuee commented Jun 17, 2022

Apparently the test file exceeds 256KB and I need to redo the test with a proper hex file.

@mcuee
Copy link
Collaborator

mcuee commented Jun 18, 2022

@stefanrueger
Is this the correct way to combine the two hex file? It does not seem to be correct.

mcuee@mcuees-Mac-mini bin % srec_cat entest_0x11000_offset.hex -intel 
stk500boot_v2_mega2560_eeprom_fix.hex -intel -o MergedHexFile.hex -intel
merged hex file
mcuee@mcuees-Mac-mini bin % cat entest_0x11000_offset.hex 
:020000040001F9
:201000005468650A5468650A5468650A5468650A5468650A5468650A5468650A5468650A78
:201020005468650A5468650A5468650A5468650A5468650A5468650A5468650A5468650A58
:201040005468650A5468650A5468650A5468650A5468650A5468650A5468650A5468650A38
:201060005468650A5468650A5468650A5468650A5468650A5468650A5468650A5468650A18
:201080005468650A5468650A5468650A5468650A5468650A5468650A5468650A5468650AF8
:2010A0005468650A5468650A5468650A5468650A5468650A5468650A5468650A5468650AD8
:2010C0005468650A5468650A5468650A5468650A5468650A5468650A5468650A5468650AB8
:2010E0005468650A5468650A5468650A5468650A5468650A5468650A5468650A5468650A98
:201100005468650A5468650A5468650A5468650A5468650A5468650A5468650A5468650A77
:201120005468650A5468650A5468650A5468650A5468650A5468650A5468650A5468650A57
:201140005468650A5468650A5468650A5468650A5468650A5468650A5468650A5468650A37
:201160005468650A5468650A5468650A5468650A5468650A5468650A5468650A5468650A17
:201180005468650A5468650A5468650A5468650A5468650A5468650A5468650A5468650AF7
:2011A0005468650A5468650A5468650A5468650A5468650A5468650A5468650A5468650AD7
:2011C0005468650A5468650A5468650A5468650A5468650A5468650A5468650A5468650AB7
:2011E0005468650A5468650A5468650A5468650A5468650A5468650A5468650A5468650A97
:00000001FF

mcuee@mcuees-Mac-mini bin % cat stk500boot_v2_mega2560_eeprom_fix.hex     
:020000023000CC
:10E000000D9489F10D94B2F10D94B2F10D94B2F129
:10E010000D94B2F10D94B2F10D94B2F10D94B2F1F0
:10E020000D94B2F10D94B2F10D94B2F10D94B2F1E0
:10E030000D94B2F10D94B2F10D94B2F10D94B2F1D0
:10E040000D94B2F10D94B2F10D94B2F10D94B2F1C0
:10E050000D94B2F10D94B2F10D94B2F10D94B2F1B0
:10E060000D94B2F10D94B2F10D94B2F10D94B2F1A0
:10E070000D94B2F10D94B2F10D94B2F10D94B2F190
:10E080000D94B2F10D94B2F10D94B2F10D94B2F180
:10E090000D94B2F10D94B2F10D94B2F10D94B2F170
:10E0A0000D94B2F10D94B2F10D94B2F10D94B2F160
:10E0B0000D94B2F10D94B2F10D94B2F10D94B2F150
:10E0C0000D94B2F10D94B2F10D94B2F10D94B2F140
:10E0D0000D94B2F10D94B2F10D94B2F10D94B2F130
:10E0E0000D94B2F141546D656761323536300041AF
:10E0F000726475696E6F206578706C6F72657220DE
:10E1000073746B3530305632206279204D4C530099
:10E11000426F6F746C6F616465723E004875683F52
:10E1200000436F6D70696C6564206F6E203D200048
:10E130004350552054797065202020203D20005FF9
:10E140005F4156525F415243485F5F3D2000415658
:10E1500052204C696243205665723D20004743437C
:10E160002056657273696F6E203D20004350552024
:10E1700049442020202020203D20004C6F7720663D
:10E18000757365202020203D20004869676820665F
:10E190007573652020203D200045787420667573D6
:10E1A00065202020203D20004C6F636B2066757336
:10E1B000652020203D20004A756E20203520323019
:10E1C000323200312E362E3700342E332E330056A5
:10E1D00023202020414444522020206F7020636F70
:10E1E00064652020202020696E73747275637469E1
:10E1F0006F6E2061646472202020496E74657272B3
:10E20000757074006E6F20766563746F7200726A49
:10E210006D702020006A6D70200057686174207056
:10E220006F72743A00506F7274206E6F7420737541
:10E2300070706F72746564004D7573742062652030
:10E2400061206C6574746572002000577269747483
:10E25000696E672045450052656164696E672045B7
:10E26000450045452065727220636E743D00504F35
:10E27000525400303D5A65726F2061646472003FF1
:10E280003D43505520737461747300403D454550C3
:10E29000524F4D207465737400423D426C696E6B41
:10E2A000204C454400453D44756D70204545505215
:10E2B0004F4D00463D44756D7020464C415348001B
:10E2C000483D48656C70004C3D4C69737420492F83
:10E2D0004F20506F72747300513D51756974005234
:10E2E0003D44756D702052414D00563D73686F7707
:10E2F00020696E7465727275707420566563746FF0
:10E30000727300593D506F727420626C696E6B00BD
:10E310002A0011241FBECFEFD1E2DEBFCDBF01E046
:10E320000CBF12E0A0E0B2E0E6E2FDEF03E00BBFBD
:10E3300002C007900D92A030B107D9F712E0A0E01B
:10E34000B2E001C01D92AE30B107E1F70F9460F367
:10E350000D9491FE01E20EBF0FEF0DBF11241FBE01
:10E360000D9460F30D9400F020E030E040ED57E0B4
:10E3700005C0FA013197F1F72F5F3F4F2817390792
:10E38000C0F308959C01260F311DC901A0E0B0E043
:10E390002F5F3F4FABBFFC018791882361F08093D3
:10E3A000C6008091C00086FFFCCF8091C0008064D1
:10E3B0008093C000EACF08958DE08093C6008091DD
:10E3C000C00086FFFCCF8091C00080648093C000B5
:10E3D0008AE08093C6008091C00086FFFCCF8091C8
:10E3E000C00080648093C00008950F94C2F10F9420
:10E3F000DCF10895FC019081992359F09093C600B7
:10E400008091C00086FFFCCF8091C0008064809323
:10E41000C0003196992379F70895282F982F929567
:10E420009F70892F805D8A3308F0895F8093C600D2
:10E430008091C00086FFFCCF8091C00080648093F3
:10E44000C000822F8F70982F905D9A3308F0995FEB
:10E450009093C6008091C00086FFFCCF8091C000E1
:10E4600080648093C00008959C01FB01853691056E
:10E470001CF46330710594F0C90164E670E00F94F8
:10E4800032FE605D7F4F6093C6008091C00086FFC2
:10E49000FCCF8091C00080648093C0002B30310598
:10E4A00014F43297B4F0C90164E670E00F9432FEC0
:10E4B0006AE070E00F9432FE605D7F4F6093C600AB
:10E4C0008091C00086FFFCCF8091C0008064809363
:10E4D000C000C9016AE070E00F9432FEC0968093DC
:10E4E000C6008091C00086FFFCCF8091C000806490
:10E4F0008093C00008951F93182F8EE692EE60E07F
:10E500000F94C2F11093C6008091C00086FFFCCF2B
:10E510008091C00080648093C0000F94DCF11F9153
:10E5200008952F923F924F925F926F927F928F92B7
:10E530009F92AF92BF92CF92DF92EF92FF920F9392
:10E540001F93DF93CF93CDB7DEB762970FB6F894E2
:10E55000DEBF0FBECDBF382E622ECA01DB015C01CB
:10E560006D01772420E2222E2E010894411C511CBB
:10E570008BC081E0A81680E0B80681E0C80680E084
:10E58000D80628F0C601AA27BB270F940DF2BB2797
:10E59000AD2D9C2D8B2D0F940DF28A2D0F940DF225
:10E5A0002092C6008091C00086FFFCCF8091C00001
:10E5B00080648093C0009DE29093C6008091C0006B
:10E5C00086FFFCCF8091C00080648093C0002092C1
:10E5D000C6008091C00086FFFCCF8091C00080649F
:10E5E0008093C00019828601750188249924A1E0D6
:10E5F0003A1651F03A1620F0B2E03B1661F409C029
:10E600000BBFF701779007C0C7010F947BFE782EF0
:10E6100002C0F7017080872D0F940DF22092C60082
:10E620008091C00086FFFCCF8091C0008064809301
:10E63000C000872D8052F401EF70F0708F3520F408
:10E64000E40DF51D708204C0E40DF51D8EE280839B
:10E650000894E11CF11C011D111D0894811C911CE2
:10E6600090E18916910409F0C2CF80E190E0A0E02A
:10E67000B0E0A80EB91ECA1EDB1E198AC2010F9493
:10E68000FAF10F94DCF16A94662009F072CF629679
:10E690000FB6F894DEBF0FBECDBFCF91DF911F91B3
:10E6A0000F91FF90EF90DF90CF90BF90AF909F9031
:10E6B0008F907F906F905F904F903F902F90089534
:10E6C0002F923F924F925F926F927F928F929F9282
:10E6D000AF92BF92CF92DF92EF92FF920F931F9370
:10E6E000DF93CF93CDB7DEB7CD53D1400FB6F894BB
:10E6F000DEBF0FBECDBF01E20EBF0FEF0DBF94B75F
:10E70000F894A89514BE80916000886180936000A1
:10E7100010926000789493FF05C0E0910002F091A0
:10E7200001021995279A2F9A8091C00082608093E8
:10E73000C00080E18093C40088E18093C1000000A4
:10E74000EE24FF24870144E0A42EB12CCC24DD2448
:10E7500024C0C5010197F1F70894E11CF11C011DCB
:10E76000111D21E2E2162EE4F20620E0020720E06D
:10E77000120718F031E0C32ED12CC801B70127ECE5
:10E780003BE140E050E00F9445FE611571058105C5
:10E79000910519F485B1805885B98091C00087FD35
:10E7A00003C0C114D104A9F2A6014F5F5F4FC25E3E
:10E7B000DE4F59834883CE51D140C25EDE4F8881FF
:10E7C0009981CE51D140019711F00D9414FEC05D96
:10E7D000DE4F19821882C053D14060E0C15DDE4F28
:10E7E0001882CF52D14088249924C35DDE4F19820C
:10E7F0001882CD52D140C05EDE4F188219821A8233
:10E800001B82C052D140CE5CDE4F188219821A8220
:10E810001B82C253D140EE24FF2487010BBFF701B6
:10E8200007911691C45CDE4F19830883CC53D14005
:10E830000D940FFEC25EDE4F28813981CE51D1404A
:10E840002130310509F52091C600C25EDE4F1982E4
:10E850001882CE51D14022C02F5F3F4F4F4F5F4FA4
:10E86000213082E138078AE7480780E0580780F0C6
:10E87000C45CDE4FE881F981CC53D140EF5FFF4F9C
:10E8800019F0EE27FF27099420E030E040E050E047
:10E890008091C00087FFE0CF2091C600C35DDE4FAE
:10E8A00048815981CD52D1404F5F5F4FC35DDE4FEC
:10E8B00059834883CD52D140213209F063C64A3092
:10E8C000510508F05FC60894811C911C53E0851621
:10E8D000910409F059C600E010E018C081E280936D
:10E8E000C6008091C00086FFFCCF8091C00080648C
:10E8F0008093C0002F5F3F4F2931310579F70F9486
:10E90000DCF10F5F1F4F0530110519F020E030E0FA
:10E91000E5CF10920A0210920B0210920C02109294
:10E920000D02109206021092070210920802109235
:10E930000902109202021092030210920402109235
:10E9400005028FEE90EE60E00F94F5F180E191EE1C
:10E9500060E00F94C2F18091C00087FFFCCF9091DE
:10E96000C600903608F09F759032B8F09093C600BC
:10E970008091C00086FFFCCF8091C00080648093AE
:10E98000C000A0E2A093C6008091C00086FFFCCF2B
:10E990008091C00080648093C000983409F4D7C18E
:10E9A0009934B8F4923409F459C1933458F490333B
:10E9B00019F1903308F4E3C59F33A1F1903409F0C5
:10E9C000DEC5BDC0953409F470C1963409F0D7C5D1
:10E9D00098C1923509F42BC2933538F49C3409F46C
:10E9E000F5C1913509F0CBC518C2963509F445C279
:10E9F000993509F0C4C567C483E792EE62E00F94CD
:10EA0000F5F110920602109207021092080210927D
:10EA1000090210920A0210920B0210920C0210923C
:10EA20000D0213C18FE792EE62E00F94F5F18FEEC5
:10EA300090EE60E00F94F5F181E291EE60E00F94CA
:10EA4000C2F187EB91EE60E00F94F5F180E391EE77
:10EA500060E00F94C2F184EE90EE60E00F94F5F167
:10EA60008FE391EE60E00F94C2F186E090E061E008
:10EA700070E00F9434F20F94DCF18DE591EE60E0DC
:10EA80000F94C2F189EC91EE60E00F94F5F18EE401
:10EA900091EE60E00F94C2F183EC91EE60E00F9490
:10EAA000F5F18CE691EE60E00F94C2F18EE10F94E7
:10EAB0000DF288E90F940DF281E00F940DF20F949E
:10EAC000DCF18BE791EE60E00F94C2F119E0E0E039
:10EAD000F0E010935700E4918E2F0F940DF20F94F5
:10EAE000DCF18AE891EE60E00F94C2F1E3E0F0E03F
:10EAF00010935700E4918E2F0F940DF20F94DCF1D8
:10EB000089E991EE60E00F94C2F1E2E0F0E0109349
:10EB10005700E4918E2F0F940DF20F94DCF188EAE8
:10EB200091EE60E00F94C2F1E1E0F0E01093570045
:10EB30001491812F0F940DF20F94DCF107CF8BE825
:10EB400092EE62E00F94F5F18BE492EE60E00F94A8
:10EB5000F5F10F94DCF100E010E019C0C8016F2D51
:10EB60000F9483FEFF2031F489E492EE60E00F946D
:10EB7000C2F10BC0F092C6008091C00086FFFCCFAE
:10EB80008091C00080648093C0000F5F1F4FC80158
:10EB900081519F41A0E0B0E0ABBFFC01F790BAE229
:10EBA000FB1621F0E2E000301E07C1F60F94DCF105
:10EBB0000F94DCF187E592EE60E00F94F5F10F948D
:10EBC000DCF1CC24DD2400E010E01EC0C8010F946D
:10EBD0007BFEF82E882331F489E492EE60E00F94F6
:10EBE000C2F10BC08093C6008091C00086FFFCCFAD
:10EBF0008091C00080648093C000FE1419F00894D6
:10EC0000C11CD11C0F5F1F4FC80181519F41A0E063
:10EC1000B0E0ABBFFC01E790FAE2EF1621F022E092
:10EC20000030120799F60F94DCF10F94DCF182E6C4
:10EC300092EE60E00F94C2F1C60161E070E00F94C3
:10EC400034F20F94DCF10F94DCF110920202109276
:10EC50000302109204021092050278CE89E992EE26
:10EC600062E00F94F5F1279A2F9A16C02F9880E052
:10EC700090E0E0EDF7E03197F1F7019684369105E9
:10EC8000C1F72F9A80E090E0E0EDF7E03197F1F7DF
:10EC9000019684369105C1F78091C00087FFE6CFC9
:10ECA0008091C00087FFFCCF64C485EA92EE62E0E9
:10ECB0000F94F5F140910202509103026091040219
:10ECC0007091050281E020E10F9491F2809102029F
:10ECD00090910302A0910402B091050280509F4FD1
:10ECE000AF4FBF4F8093020290930302A0930402A0
:10ECF000B093050280509041A040B04008F426CE69
:10ED0000A4CF83EB92EE62E00F94F5F140910602FE
:10ED100050910702609108027091090280E020E1A1
:10ED20000F9491F28091060290910702A09108023F
:10ED3000B091090280509F4FAF4FBF4F80930602A2
:10ED400090930702A0930802B0930902FFCD80ECD4
:10ED500092EE62E00F94F5F183E792EE60E00F949B
:10ED6000F5F18FE792EE60E00F94F5F18BE892EE0B
:10ED700060E00F94F5F189E992EE60E00F94F5F10F
:10ED800085EA92EE60E00F94F5F183EB92EE60E09D
:10ED90000F94F5F180EC92EE60E00F94F5F187ECC2
:10EDA00092EE60E00F94F5F188ED92EE60E00F9442
:10EDB000F5F18FED92EE60E00F94F5F18AEE92EEB0
:10EDC00060E00F94F5F183E093EEBDCD87EC92EE19
:10EDD00062E00F94F5F181E40F947BF282E40F94EA
:10EDE0007BF283E40F947BF284E40F947BF285E45E
:10EDF0000F947BF286E40F947BF287E40F947BF20E
:10EE000088E40F947BF28AE40F947BF28BE40F94F6
:10EE10007BF28CE40F947BF299CD88ED92EE62E068
:10EE20000F94F5F1772473948824992409C48FED05
:10EE300092EE62E00F94F5F140910A0250910B02BC
:10EE400060910C0270910D0282E020E10F9491F22A
:10EE500080910A0290910B02A0910C02B0910D02D8
:10EE600080509F4FAF4FBF4F80930A0290930B0289
:10EE7000A0930C02B0930D0269CD8AEE92EE62E08F
:10EE80000F94F5F184EE90EE60E00F94F5F18FECC5
:10EE900091EE60E00F94F5F1662477244301CC5D98
:10EEA000DE4F19821882C452D140D401C301B695F5
:10EEB000A79597958795CA5DDE4F88839983AA8326
:10EEC000BB83C652D140CC5DDE4FA881B981C4520C
:10EED000D1401196CC5DDE4FB983A883C452D14096
:10EEE000CD0162E070E00F9434F2B0E2B093C6005E
:10EEF0008091C00086FFFCCF8091C0008064809329
:10EF0000C000EDE2E093C6008091C00086FFFCCF18
:10EF10008091C00080648093C000F0E2F093C6004E
:10EF20008091C00086FFFCCF8091C00080648093F8
:10EF3000C000CA5DDE4FE880F9800A811B81C6529D
:10EF4000D140BB27A12F902F8F2D0F940DF2CA5DBA
:10EF5000DE4F8881C652D1400F940DF2B0E2FB2EF5
:10EF6000F092C6008091C00086FFFCCF8091C00067
:10EF700080648093C0000DE30093C6008091C000C0
:10EF800086FFFCCF8091C00080648093C00010E2B7
:10EF90001093C6008091C00086FFFCCF8091C00016
:10EFA00080648093C0008BBEF3012791C65DDE4F65
:10EFB0002883CA52D140A22EBB24CC24DD2408943D
:10EFC000611C711C811C911C8BBEF3018791282E42
:10EFD0003324442455240894611C711C811C911C09
:10EFE0008BBEF3013791C55DDE4F3883CB52D140E4
:10EFF0000894611C711C811C911C8BBEF30147910C
:10F00000C45DDE4F4883CC52D140ADEFEA2EAFEF66
:10F01000FA2EAFEF0A2FAFEF1A2F6E0C7F1C801E57
:10F02000911E142D032DF22CEE24EA0CFB1C0C1D5A
:10F030001D1D0F940DF220E22093C6008091C000A8
:10F0400086FFFCCF8091C00080648093C000C65DC5
:10F05000DE4F8881CA52D1400F940DF230E23093D6
:10F06000C6008091C00086FFFCCF8091C000806404
:10F070008093C000C45DDE4F8881CC52D1400F9494
:10F080000DF240E24093C6008091C00086FFFCCFA5
:10F090008091C00080648093C000C55DDE4F888190
:10F0A000CB52D1400F940DF250E25093C6008091A4
:10F0B000C00086FFFCCF8091C00080648093C000B8
:10F0C0008FEFE8168FEFF80680E0080780E018075A
:10F0D00031F484E092EE60E00F94C2F1DFC0D80119
:10F0E000C7018070907CA070B0708050904CA040A0
:10F0F000B040D1F52FEF3FE340E050E0E222F322B1
:10F1000004231523CA5DDE4FA880B980CA80DB8046
:10F11000C652D140AE0CBF1CC01ED11EAA0CBB1CD7
:10F12000CC1CDD1C8EE092EE60E00F94C2F1BB2798
:10F13000A12F902F8F2D0F940DF28E2D0F940DF285
:10F1400030E23093C6008091C00086FFFCCF8091F2
:10F15000C00080648093C0004EE34093C60080915D
:10F16000C00086FFFCCF87C08EE09EEFA0E0B0E03D
:10F17000E822F9220A231B239CE0E91694E9F90608
:10F1800090E0090790E0190709F088C0C45DDE4FE0
:10F19000A881CC52D140EA2EFF2400E010E0102FCD
:10F1A0000F2DFE2CEE24C55DDE4FB881CB52D14031
:10F1B000EB0EF11C011D111DD601C501817090706F
:10F1C000A070B070DC0199278827E80EF91E0A1F8D
:10F1D0001B1F20EF30E040E050E0A222B322C42207
:10F1E000D52241E1AA0CBB1CCC1CDD1C4A95D1F7F1
:10F1F000EA0CFB1C0C1D1D1D81E090E0A0E0B0E0BE
:10F20000282239224A225B2235E1220C331C441C7D
:10F21000551C3A95D1F7E20CF31C041D151D57013E
:10F220006801AA0CBB1CCC1CDD1C85E192EE60E0E1
:10F230000F94C2F1C801AA27BB270F940DF2BB2778
:10F24000A12F902F8F2D0F940DF28E2D0F940DF274
:10F2500090E29093C6008091C00086FFFCCF809121
:10F26000C00080648093C000AEE3A093C60080918C
:10F27000C00086FFFCCF8091C00080648093C000F6
:10F28000C601AA27BB270F940DF2BB27AD2D9C2DDD
:10F290008B2D0F940DF28A2D0F940DF20F94DCF14B
:10F2A000CC5DDE4FE881F981C452D140F99709F471
:10F2B0004DCBF4E0EF2EF12C012D112D6E0C7F1CA7
:10F2C000801E911EF2CD83E093EE62E00F94F5F183
:10F2D0008AE192EE60E00F94C2F18091C00087FF56
:10F2E000FCCF1091C6001F751093C6008091C0001E
:10F2F00086FFFCCF8091C00080648093C0000F9493
:10F30000DCF1812F81548A3108F036C1163409F4BA
:10F3100095C0173490F4133409F44EC0143430F40B
:10F320001134F1F0123409F01DC130C0143409F465
:10F3300059C0153409F016C16BC01A3409F4C4C0A1
:10F340001B3438F4173409F48FC0183409F00AC19B
:10F35000A1C01B3409F4D2C01C3409F003C1E8C0B9
:10F360008FEF81B90DC082B1809582B980E090E0C5
:10F37000E0EDF7E03197F1F70196883C9105C1F790
:10F380008091C00087FFEFCF12B8EFC08FEF84B934
:10F390000DC085B1809585B980E090E0E0EDF7E0A3
:10F3A0003197F1F70196883C9105C1F78091C00033
:10F3B00087FFEFCF15B8D9C08FEF87B90DC088B1DF
:10F3C000809588B980E090E0E0EDF7E03197F1F7C3
:10F3D0000196883C9105C1F78091C00087FFEFCF6F
:10F3E00018B8C3C08FEF8AB90DC08BB180958BB9A7
:10F3F00080E090E0E0EDF7E03197F1F70196883C8E
:10F400009105C1F78091C00087FFEFCF1BB8ADC059
:10F410008FEF8DB90DC08EB180958EB980E090E0F0
:10F42000E0EDF7E03197F1F70196883C9105C1F7DF
:10F430008091C00087FFEFCF1EB897C08FEF80BBD1
:10F440000DC081B3809581BB80E090E0E0EDF7E0F6
:10F450003197F1F70196883C9105C1F78091C00082
:10F4600087FFEFCF11BA81C08FEF83BB0DC084B38C
:10F47000809584BB80E090E0E0EDF7E03197F1F714
:10F480000196883C9105C1F78091C00087FFEFCFBE
:10F4900014BA6BC08FEF809301010FC080910201FD
:10F4A00080958093020180E090E0E0EDF7E03197F5
:10F4B000F1F70196883C9105C1F78091C00087FF64
:10F4C000EDCF1092020151C08FEF809304010FC065
:10F4D0008091050180958093050180E090E0E0ED4A
:10F4E000F7E03197F1F70196883C9105C1F78091DB
:10F4F000C00087FFEDCF1092050137C08FEF8093DA
:10F5000007010FC08091080180958093080180E079
:10F5100090E0E0EDF7E03197F1F70196883C910536
:10F52000C1F78091C00087FFEDCF109208011DC088
:10F530008FEF80930A010FC080910B01809580931B
:10F540000B0180E090E0E0EDF7E03197F1F70196F4
:10F55000883C9105C1F78091C00087FFEDCF1092E4
:10F560000B0103C085E292EEEEC98091C00087FFD7
:10F57000FCCF8091C600EAC988E392EEE4C98CE131
:10F5800091EEE1C988249924933011F1943028F444
:10F59000913089F09230B8F408C0953061F195301F
:10F5A000F0F0963009F048C043C02B3109F042C951
:10F5B00091E06BE13FC96227C15DDE4F2883CF52E6
:10F5C000D14092E037C9B22FA0E0622793E032C960
:10F5D000822F90E0A82BB92B622794E02BC92E3004
:10F5E00009F03DC3622795E0C05DDE4F19821882A5
:10F5F000C053D1401FC9E1E0F0E0EC0FFD1FC05D3A
:10F60000DE4F08811981C053D140E00FF11F2083E4
:10F610000F5F1F4FC05DDE4F19830883C053D14079
:10F6200062270A171B0709F005C9D80196E002C92D
:10F63000261709F014C303C0973009F0FBC87724DC
:10F640009981933109F412C19431C8F4963009F4C8
:10F65000D8C0973050F4923009F406C1933009F4C1
:10F660006DC0913009F05DC253C0913109F477C08B
:10F67000923108F0BBC0903109F053C2F5C0983107
:10F6800009F487C0993150F4953109F4EFC09531F0
:10F6900008F4C6C1963109F044C2C2C19A3109F4D6
:10F6A0006CC09A3108F491C09B3109F45BC09D3164
:10F6B00009F037C29D81903359F48F81882311F46A
:10F6C0009EE11CC0813011F091E018C098E916C08D
:10F6D000892F807591F0903539F4E0E0F0E089E011
:10F6E0008093570094910AC0983539F4E3E0F0E034
:10F6F00089E080935700949101C090E01A821B82A8
:10F700008D818C831D829E831F8227E030E00DC295
:10F710001A8288E08B8381E48C8386E58D8382E581
:10F720008E8389E48F8383E5888780E589878FE5E9
:10F730008A8782E38B872BE030E0F7C18A818139A9
:10F7400041F0823941F0803911F48FE005C080E04A
:10F7500003C082E001C08AE01A828B8344C0772410
:10F76000739482C08D81882311F48EE12CC0813086
:10F7700011F081E028C088E926C01A82E1E0F0E0BB
:10F7800089E08093570084918B831C8224E030E0D1
:10F79000CCC18B81803589F48C81883039F4E2E0EA
:10F7A000F0E089E08093570084910DC0E0E0F0E044
:10F7B00089E080935700849106C0E3E0F0E089E09F
:10F7C0008093570084911A82DFCF8D81836C99E0FA
:10F7D000E1E0F0E0082E90935700E89507B600FCB2
:10F7E000FDCF1A821B8223E030E09FC180EC8A8328
:10F7F000CE5CDE4F188219821A821B82C253D1401E
:10F8000092C18A8190E0A0E0B0E0582F44273327CE
:10F8100022278B8190E0A0E0B0E0DC0199278827C7
:10F82000282B392B4A2B5B2B8D8190E0A0E0B0E098
:10F83000282B392B4A2B5B2B8C8190E0A0E0B0E089
:10F84000BA2FA92F982F8827282B392B4A2B5B2BCF
:10F85000220F331F441F551FC05EDE4F288339839C
:10F860004A835B83C052D1401A825DC13A81C95C30
:10F87000DE4F3883C753D140CA5CDE4F1882C6536F
:10F88000D1408B81C82EDD24CA5CDE4F488159816E
:10F89000C653D140C42AD52A933109F082C0CE5C28
:10F8A000DE4F88819981AA81BB81C253D1408050AB
:10F8B000904CA340B04030F583E0CE5CDE4FE88052
:10F8C000F9800A811B81C253D140F70100935B008C
:10F8D00080935700E89507B600FCFDCFCE5CDE4F65
:10F8E000088119812A813B81C253D14000501F4FAA
:10F8F0002F4F3F4FCE5CDE4F088319832A833B8313
:10F90000C253D140C05EDE4F488159816A817B81FC
:10F91000C052D140DE011B9631E08C9111962C91A2
:10F9200011971296C75CDE4F2883C953D140C85C3B
:10F93000DE4F1882C853D14090E0C85CDE4FE881AA
:10F94000F981C853D1408E2B9F2B0C01FA01609393
:10F950005B0030935700E89511244E5F5F4F6F4F67
:10F960007F4F0EEFE02E0FEFF02ECE0CDF1CC114F8
:10F97000D10499F685E0C05EDE4F088119812A81A5
:10F980003B81C052D140F80120935B008093570027
:10F99000E89507B600FCFDCF81E180935700E8951C
:10F9A00035C0C05EDE4F88819981AA81BB81C0527B
:10F9B000D140B695A795979587957C018601FBE088
:10F9C000AF2EB12CAC0EBD1E0BC0D5016D915D01EB
:10F9D000C7010F9483FE0894E11CF11C01501040F4
:10F9E0000115110591F7A60160E070E0440F551F65
:10F9F000661F771FC05EDE4FE880F9800A811B8199
:10FA0000C052D1404E0D5F1D601F711F1A82C05E33
:10FA1000DE4F488359836A837B83C052D14083C0C1
:10FA2000FA80C55CDE4FF882CB53D140C65CDE4F16
:10FA30001882CA53D1408B81282F30E0C65CDE4F3C
:10FA400008811981CA53D140202B312B1A82898118
:10FA5000AE014D5F5F4F843121F5B901C05EDE4FCD
:10FA6000E880F9800A811B81C052D1400BBFF701A9
:10FA700087919691DA018C9311969C934E5F5F4F1C
:10FA8000D801C7010296A11DB11DC05EDE4F88835B
:10FA90009983AA83BB83C052D14062507040F1F673
:10FAA0003BC0C05EDE4F88819981AA81BB81C05274
:10FAB000D140B695A79597958795BC01F90161BD91
:10FAC00072BD6F5F7F4FF89A80B5DA018D93AD01FB
:10FAD0003197A9F721503040C901A0E0B0E02F5F75
:10FAE0003F4F880F991FAA1FBB1F0296A11DB11D72
:10FAF000C05EDE4FE880F9800A811B81C052D14090
:10FB0000E80EF91E0A1F1B1FC05EDE4FE882F98255
:10FB10000A831B83C052D1402D5F3F4FDA011C92F4
:10FB200004C080EC8A8322E030E08BE18093C60041
:10FB30008091C00086FFFCCF8091C00080648093DC
:10FB4000C000C15DDE4FB881CF52D140B093C60036
:10FB50008091C00086FFFCCF8091C00080648093BC
:10FB6000C000432F3093C6008091C00086FFFCCFB9
:10FB70008091C00080648093C000922F2093C600C3
:10FB80008091C00086FFFCCF8091C000806480938C
:10FB9000C0008EE08093C6008091C00086FFFCCF3D
:10FBA0008091C00080648093C00065E1C15DDE4F3C
:10FBB000E881CF52D1406E2769276427FE01319634
:10FBC00010C090819093C6008091C00086FFFCCF4A
:10FBD00031968091C00080648093C00069272150D5
:10FBE00030402115310569F76093C6008091C0004F
:10FBF00086FFFCCF8091C00080648093C00085B1F7
:10FC0000805885B9772081F4C15DDE4FF881CF52ED
:10FC1000D140FF5FC15DDE4FF883CF52D14090E00D
:10FC2000A0E0B0E00D941AF427982F9880E090E0BF
:10FC300020ED37E0F9013197F1F70196843691050F
:10FC4000C9F700008091C0008D7F8093C00081E1E2
:10FC500080935700E895EE27FF270994FFCF90E0A7
:10FC60000D941AF497FB092E07260AD077FD04D0CD
:10FC70002ED006D000201AF4709561957F4F08951C
:10FC8000F6F7909581959F4F0895A1E21A2EAA1B31
:10FC9000BB1BFD010DC0AA1FBB1FEE1FFF1FA2173C
:10FCA000B307E407F50720F0A21BB30BE40BF50B39
:10FCB000661F771F881F991F1A9469F760957095C2
:10FCC000809590959B01AC01BD01CF010895AA1BC1
:10FCD000BB1B51E107C0AA1FBB1FA617B70710F037
:10FCE000A61BB70B881F991F5A95A9F78095909569
:10FCF000BC01CD010895F999FECF92BD81BDF89A5E
:10FD0000992780B50895262FF999FECF1FBA92BD85
:10FD100081BD20BD0FB6F894FA9AF99A0FBE0196EC
:06FD20000895F894FFCFE6
:040000033000E000E9
:00000001FF
mcuee@mcuees-Mac-mini bin % cat MergedHexFile.hex 
:020000040001F9
:201000005468650A5468650A5468650A5468650A5468650A5468650A5468650A5468650A78
:201020005468650A5468650A5468650A5468650A5468650A5468650A5468650A5468650A58
:201040005468650A5468650A5468650A5468650A5468650A5468650A5468650A5468650A38
:201060005468650A5468650A5468650A5468650A5468650A5468650A5468650A5468650A18
:201080005468650A5468650A5468650A5468650A5468650A5468650A5468650A5468650AF8
:2010A0005468650A5468650A5468650A5468650A5468650A5468650A5468650A5468650AD8
:2010C0005468650A5468650A5468650A5468650A5468650A5468650A5468650A5468650AB8
:2010E0005468650A5468650A5468650A5468650A5468650A5468650A5468650A5468650A98
:201100005468650A5468650A5468650A5468650A5468650A5468650A5468650A5468650A77
:201120005468650A5468650A5468650A5468650A5468650A5468650A5468650A5468650A57
:201140005468650A5468650A5468650A5468650A5468650A5468650A5468650A5468650A37
:201160005468650A5468650A5468650A5468650A5468650A5468650A5468650A5468650A17
:201180005468650A5468650A5468650A5468650A5468650A5468650A5468650A5468650AF7
:2011A0005468650A5468650A5468650A5468650A5468650A5468650A5468650A5468650AD7
:2011C0005468650A5468650A5468650A5468650A5468650A5468650A5468650A5468650AB7
:2011E0005468650A5468650A5468650A5468650A5468650A5468650A5468650A5468650A97
:020000040003F7
:20E000000D9489F10D94B2F10D94B2F10D94B2F10D94B2F10D94B2F10D94B2F10D94B2F109
:20E020000D94B2F10D94B2F10D94B2F10D94B2F10D94B2F10D94B2F10D94B2F10D94B2F1C0
:20E040000D94B2F10D94B2F10D94B2F10D94B2F10D94B2F10D94B2F10D94B2F10D94B2F1A0
:20E060000D94B2F10D94B2F10D94B2F10D94B2F10D94B2F10D94B2F10D94B2F10D94B2F180
:20E080000D94B2F10D94B2F10D94B2F10D94B2F10D94B2F10D94B2F10D94B2F10D94B2F160
:20E0A0000D94B2F10D94B2F10D94B2F10D94B2F10D94B2F10D94B2F10D94B2F10D94B2F140
:20E0C0000D94B2F10D94B2F10D94B2F10D94B2F10D94B2F10D94B2F10D94B2F10D94B2F120
:20E0E0000D94B2F141546D656761323536300041726475696E6F206578706C6F726572205D
:20E1000073746B3530305632206279204D4C5300426F6F746C6F616465723E004875683FDC
:20E1200000436F6D70696C6564206F6E203D20004350552054797065202020203D20005F52
:20E140005F4156525F415243485F5F3D2000415652204C696243205665723D200047434305
:20E160002056657273696F6E203D20004350552049442020202020203D20004C6F772066B2
:20E18000757365202020203D20004869676820667573652020203D200045787420667573A6
:20E1A00065202020203D20004C6F636B20667573652020203D20004A756E202035203230E0
:20E1C000323200312E362E3700342E332E33005623202020414444522020206F7020636FC6
:20E1E00064652020202020696E737472756374696F6E2061646472202020496E7465727265
:20E20000757074006E6F20766563746F7200726A6D702020006A6D70200057686174207091
:20E220006F72743A00506F7274206E6F7420737570706F72746564004D7573742062652083
:20E2400061206C65747465720020005772697474696E672045450052656164696E6720456C
:20E26000450045452065727220636E743D00504F525400303D5A65726F2061646472003F78
:20E280003D43505520737461747300403D454550524F4D207465737400423D426C696E6B76
:20E2A000204C454400453D44756D7020454550524F4D00463D44756D7020464C41534800C2
:20E2C000483D48656C70004C3D4C69737420492F4F20506F72747300513D51756974005269
:20E2E0003D44756D702052414D00563D73686F7720696E7465727275707420566563746FC9
:20E30000727300593D506F727420626C696E6B002A0011241FBECFEFD1E2DEBFCDBF01E0F6
:20E320000CBF12E0A0E0B2E0E6E2FDEF03E00BBF02C007900D92A030B107D9F712E0A0E0EB
:20E34000B2E001C01D92AE30B107E1F70F9460F30D9491FE01E20EBF0FEF0DBF11241FBE9B
:20E360000D9460F30D9400F020E030E040ED57E005C0FA013197F1F72F5F3F4F2817390799
:20E38000C0F308959C01260F311DC901A0E0B0E02F5F3F4FABBFFC018791882361F0809389
:20E3A000C6008091C00086FFFCCF8091C00080648093C000EACF08958DE08093C600809141
:20E3C000C00086FFFCCF8091C00080648093C0008AE08093C6008091C00086FFFCCF809130
:20E3E000C00080648093C00008950F94C2F10F94DCF10895FC019081992359F09093C600AA
:20E400008091C00086FFFCCF8091C00080648093C0003196992379F70895282F982F92957E
:20E420009F70892F805D8A3308F0895F8093C6008091C00086FFFCCF8091C00080648093D9
:20E44000C000822F8F70982F905D9A3308F0995F9093C6008091C00086FFFCCF8091C00000
:20E4600080648093C00008959C01FB01853691051CF46330710594F0C90164E670E00F94BA
:20E4800032FE605D7F4F6093C6008091C00086FFFCCF8091C00080648093C0002B303105CE
:20E4A00014F43297B4F0C90164E670E00F9432FE6AE070E00F9432FE605D7F4F6093C600FF
:20E4C0008091C00086FFFCCF8091C00080648093C000C9016AE070E00F9432FEC0968093F3
:20E4E000C6008091C00086FFFCCF8091C00080648093C00008951F93182F8EE692EE60E0E3
:20E500000F94C2F11093C6008091C00086FFFCCF8091C00080648093C0000F94DCF11F9173
:20E5200008952F923F924F925F926F927F928F929F92AF92BF92CF92DF92EF92FF920F935E
:20E540001F93DF93CF93CDB7DEB762970FB6F894DEBF0FBECDBF382E622ECA01DB015C01E2
:20E560006D01772420E2222E2E010894411C511C8BC081E0A81680E0B80681E0C80680E094
:20E58000D80628F0C601AA27BB270F940DF2BB27AD2D9C2D8B2D0F940DF28A2D0F940DF231
:20E5A0002092C6008091C00086FFFCCF8091C00080648093C0009DE29093C6008091C00001
:20E5C00086FFFCCF8091C00080648093C0002092C6008091C00086FFFCCF8091C000806415
:20E5E0008093C00019828601750188249924A1E03A1651F03A1620F0B2E03B1661F409C0D4
:20E600000BBFF701779007C0C7010F947BFE782E02C0F7017080872D0F940DF22092C60068
:20E620008091C00086FFFCCF8091C00080648093C000872D8052F401EF70F0708F3520F41F
:20E64000E40DF51D708204C0E40DF51D8EE280830894E11CF11C011D111D0894811C911CB3
:20E6600090E18916910409F0C2CF80E190E0A0E0B0E0A80EB91ECA1EDB1E198AC2010F9413
:20E68000FAF10F94DCF16A94662009F072CF62960FB6F894DEBF0FBECDBFCF91DF911F91A2
:20E6A0000F91FF90EF90DF90CF90BF90AF909F908F907F906F905F904F903F902F900895FB
:20E6C0002F923F924F925F926F927F928F929F92AF92BF92CF92DF92EF92FF920F931F93A8
:20E6E000DF93CF93CDB7DEB7CD53D1400FB6F894DEBF0FBECDBF01E20EBF0FEF0DBF94B7F0
:20E70000F894A89514BE8091600088618093600010926000789493FF05C0E0910002F09138
:20E7200001021995279A2F9A8091C00082608093C00080E18093C40088E18093C1000000A3
:20E74000EE24FF24870144E0A42EB12CCC24DD2424C0C5010197F1F70894E11CF11C011D4A
:20E76000111D21E2E2162EE4F20620E0020720E0120718F031E0C32ED12CC801B70127ECA9
:20E780003BE140E050E00F9445FE611571058105910519F485B1805885B98091C00087FD71
:20E7A00003C0C114D104A9F2A6014F5F5F4FC25EDE4F59834883CE51D140C25EDE4F8881D4
:20E7C0009981CE51D140019711F00D9414FEC05DDE4F19821882C053D14060E0C15DDE4F75
:20E7E0001882CF52D14088249924C35DDE4F19821882CD52D140C05EDE4F188219821A8216
:20E800001B82C052D140CE5CDE4F188219821A821B82C253D140EE24FF2487010BBFF701CE
:20E8200007911691C45CDE4F19830883CC53D1400D940FFEC25EDE4F28813981CE51D14067
:20E840002130310509F52091C600C25EDE4F19821882CE51D14022C02F5F3F4F4F4F5F4FC0
:20E86000213082E138078AE7480780E0580780F0C45CDE4FE881F981CC53D140EF5FFF4FBA
:20E8800019F0EE27FF27099420E030E040E050E08091C00087FFE0CF2091C600C35DDE4F6D
:20E8A00048815981CD52D1404F5F5F4FC35DDE4F59834883CD52D140213209F063C64A3016
:20E8C000510508F05FC60894811C911C53E08516910409F059C600E010E018C081E2809346
:20E8E000C6008091C00086FFFCCF8091C00080648093C0002F5F3F4F2931310579F70F94EA
:20E90000DCF10F5F1F4F0530110519F020E030E0E5CF10920A0210920B0210920C02109287
:20E920000D0210920602109207021092080210920902109202021092030210920402109283
:20E9400005028FEE90EE60E00F94F5F180E191EE60E00F94C2F18091C00087FFFCCF909133
:20E96000C600903608F09F759032B8F09093C6008091C00086FFFCCF8091C00080648093C3
:20E98000C000A0E2A093C6008091C00086FFFCCF8091C00080648093C000983409F4D7C132
:20E9A0009934B8F4923409F459C1933458F4903319F1903308F4E3C59F33A1F1903409F099
:20E9C000DEC5BDC0953409F470C1963409F0D7C598C1923509F42BC2933538F49C3409F4F6
:20E9E000F5C1913509F0CBC518C2963509F445C2993509F0C4C567C483E792EE62E00F941F
:20EA0000F5F11092060210920702109208021092090210920A0210920B0210920C021092B3
:20EA20000D0213C18FE792EE62E00F94F5F18FEE90EE60E00F94F5F181E291EE60E00F94A9
:20EA4000C2F187EB91EE60E00F94F5F180E391EE60E00F94C2F184EE90EE60E00F94F5F118
:20EA60008FE391EE60E00F94C2F186E090E061E070E00F9434F20F94DCF18DE591EE60E03E
:20EA80000F94C2F189EC91EE60E00F94F5F18EE491EE60E00F94C2F183EC91EE60E00F940B
:20EAA000F5F18CE691EE60E00F94C2F18EE10F940DF288E90F940DF281E00F940DF20F941F
:20EAC000DCF18BE791EE60E00F94C2F119E0E0E0F0E010935700E4918E2F0F940DF20F94E8
:20EAE000DCF18AE891EE60E00F94C2F1E3E0F0E010935700E4918E2F0F940DF20F94DCF1F1
:20EB000089E991EE60E00F94C2F1E2E0F0E010935700E4918E2F0F940DF20F94DCF188EA2C
:20EB200091EE60E00F94C2F1E1E0F0E0109357001491812F0F940DF20F94DCF107CF8BE885
:20EB400092EE62E00F94F5F18BE492EE60E00F94F5F10F94DCF100E010E019C0C8016F2D34
:20EB60000F9483FEFF2031F489E492EE60E00F94C2F10BC0F092C6008091C00086FFFCCF76
:20EB80008091C00080648093C0000F5F1F4FC80181519F41A0E0B0E0ABBFFC01F790BAE2FC
:20EBA000FB1621F0E2E000301E07C1F60F94DCF10F94DCF187E592EE60E00F94F5F10F942D
:20EBC000DCF1CC24DD2400E010E01EC0C8010F947BFEF82E882331F489E492EE60E00F941E
:20EBE000C2F10BC08093C6008091C00086FFFCCF8091C00080648093C000FE1419F008945E
:20EC0000C11CD11C0F5F1F4FC80181519F41A0E0B0E0ABBFFC01E790FAE2EF1621F022E0F1
:20EC20000030120799F60F94DCF10F94DCF182E692EE60E00F94C2F1C60161E070E00F94A3
:20EC400034F20F94DCF10F94DCF11092020210920302109204021092050278CE89E992EED8
:20EC600062E00F94F5F1279A2F9A16C02F9880E090E0E0EDF7E03197F1F701968436910597
:20EC8000C1F72F9A80E090E0E0EDF7E03197F1F7019684369105C1F78091C00087FFE6CF24
:20ECA0008091C00087FFFCCF64C485EA92EE62E00F94F5F14091020250910302609104029E
:20ECC0007091050281E020E10F9491F28091020290910302A0910402B091050280509F4F2C
:20ECE000AF4FBF4F8093020290930302A0930402B093050280509041A040B04008F426CEE5
:20ED0000A4CF83EB92EE62E00F94F5F14091060250910702609108027091090280E020E19C
:20ED20000F9491F28091060290910702A0910802B091090280509F4FAF4FBF4F80930602FE
:20ED400090930702A0930802B0930902FFCD80EC92EE62E00F94F5F183E792EE60E00F94AC
:20ED6000F5F18FE792EE60E00F94F5F18BE892EE60E00F94F5F189E992EE60E00F94F5F177
:20ED800085EA92EE60E00F94F5F183EB92EE60E00F94F5F180EC92EE60E00F94F5F187ECDC
:20EDA00092EE60E00F94F5F188ED92EE60E00F94F5F18FED92EE60E00F94F5F18AEE92EE8F
:20EDC00060E00F94F5F183E093EEBDCD87EC92EE62E00F94F5F181E40F947BF282E40F94C0
:20EDE0007BF283E40F947BF284E40F947BF285E40F947BF286E40F947BF287E40F947BF249
:20EE000088E40F947BF28AE40F947BF28BE40F947BF28CE40F947BF299CD88ED92EE62E05C
:20EE20000F94F5F1772473948824992409C48FED92EE62E00F94F5F140910A0250910B02DF
:20EE400060910C0270910D0282E020E10F9491F280910A0290910B02A0910C02B0910D0240
:20EE600080509F4FAF4FBF4F80930A0290930B02A0930C02B0930D0269CD8AEE92EE62E076
:20EE80000F94F5F184EE90EE60E00F94F5F18FEC91EE60E00F94F5F1662477244301CC5DDB
:20EEA000DE4F19821882C452D140D401C301B695A79597958795CA5DDE4F88839983AA83B9
:20EEC000BB83C652D140CC5DDE4FA881B981C452D1401196CC5DDE4FB983A883C452D14060
:20EEE000CD0162E070E00F9434F2B0E2B093C6008091C00086FFFCCF8091C0008064809365
:20EF0000C000EDE2E093C6008091C00086FFFCCF8091C00080648093C000F0E2F093C60065
:20EF20008091C00086FFFCCF8091C00080648093C000CA5DDE4FE880F9800A811B81C652B4
:20EF4000D140BB27A12F902F8F2D0F940DF2CA5DDE4F8881C652D1400F940DF2B0E2FB2EEE
:20EF6000F092C6008091C00086FFFCCF8091C00080648093C0000DE30093C6008091C00086
:20EF800086FFFCCF8091C00080648093C00010E21093C6008091C00086FFFCCF8091C0004C
:20EFA00080648093C0008BBEF3012791C65DDE4F2883CA52D140A22EBB24CC24DD24089441
:20EFC000611C711C811C911C8BBEF3018791282E3324442455240894611C711C811C911C0A
:20EFE0008BBEF3013791C55DDE4F3883CB52D1400894611C711C811C911C8BBEF3014791CF
:20F00000C45DDE4F4883CC52D140ADEFEA2EAFEFFA2EAFEF0A2FAFEF1A2F6E0C7F1C801EBD
:20F02000911E142D032DF22CEE24EA0CFB1C0C1D1D1D0F940DF220E22093C6008091C00022
:20F0400086FFFCCF8091C00080648093C000C65DDE4F8881CA52D1400F940DF230E23093DB
:20F06000C6008091C00086FFFCCF8091C00080648093C000C45DDE4F8881CC52D1400F94F8
:20F080000DF240E24093C6008091C00086FFFCCF8091C00080648093C000C55DDE4F8881B5
:20F0A000CB52D1400F940DF250E25093C6008091C00086FFFCCF8091C00080648093C000FC
:20F0C0008FEFE8168FEFF80680E0080780E0180731F484E092EE60E00F94C2F1DFC0D80133
:20F0E000C7018070907CA070B0708050904CA040B040D1F52FEF3FE340E050E0E222F32231
:20F1000004231523CA5DDE4FA880B980CA80DB80C652D140AE0CBF1CC01ED11EAA0CBB1C1E
:20F12000CC1CDD1C8EE092EE60E00F94C2F1BB27A12F902F8F2D0F940DF28E2D0F940DF23E
:20F1400030E23093C6008091C00086FFFCCF8091C00080648093C0004EE34093C600809190
:20F16000C00086FFFCCF87C08EE09EEFA0E0B0E0E822F9220A231B239CE0E91694E9F906A6
:20F1800090E0090790E0190709F088C0C45DDE4FA881CC52D140EA2EFF2400E010E0102F2E
:20F1A0000F2DFE2CEE24C55DDE4FB881CB52D140EB0EF11C011D111DD601C5018170907041
:20F1C000A070B070DC0199278827E80EF91E0A1F1B1F20EF30E040E050E0A222B322C42255
:20F1E000D52241E1AA0CBB1CCC1CDD1C4A95D1F7EA0CFB1C0C1D1D1D81E090E0A0E0B0E090
:20F20000282239224A225B2235E1220C331C441C551C3A95D1F7E20CF31C041D151D5701BD
:20F220006801AA0CBB1CCC1CDD1C85E192EE60E00F94C2F1C801AA27BB270F940DF2BB277B
:20F24000A12F902F8F2D0F940DF28E2D0F940DF290E29093C6008091C00086FFFCCF8091D7
:20F26000C00080648093C000AEE3A093C6008091C00086FFFCCF8091C00080648093C000E4
:20F28000C601AA27BB270F940DF2BB27AD2D9C2D8B2D0F940DF28A2D0F940DF20F94DCF1AA
:20F2A000CC5DDE4FE881F981C452D140F99709F44DCBF4E0EF2EF12C012D112D6E0C7F1CBA
:20F2C000801E911EF2CD83E093EE62E00F94F5F18AE192EE60E00F94C2F18091C00087FF9B
:20F2E000FCCF1091C6001F751093C6008091C00086FFFCCF8091C00080648093C0000F9493
:20F30000DCF1812F81548A3108F036C1163409F495C0173490F4133409F44EC0143430F4C8
:20F320001134F1F0123409F01DC130C0143409F459C0153409F016C16BC01A3409F4C4C029
:20F340001B3438F4173409F48FC0183409F00AC1A1C01B3409F4D2C01C3409F003C1E8C097
:20F360008FEF81B90DC082B1809582B980E090E0E0EDF7E03197F1F70196883C9105C1F7B8
:20F380008091C00087FFEFCF12B8EFC08FEF84B90DC085B1809585B980E090E0E0EDF7E05A
:20F3A0003197F1F70196883C9105C1F78091C00087FFEFCF15B8D9C08FEF87B90DC088B1B5
:20F3C000809588B980E090E0E0EDF7E03197F1F70196883C9105C1F78091C00087FFEFCFF5
:20F3E00018B8C3C08FEF8AB90DC08BB180958BB980E090E0E0EDF7E03197F1F70196883C18
:20F400009105C1F78091C00087FFEFCF1BB8ADC08FEF8DB90DC08EB180958EB980E090E04D
:20F42000E0EDF7E03197F1F70196883C9105C1F78091C00087FFEFCF1EB897C08FEF80BBD4
:20F440000DC081B3809581BB80E090E0E0EDF7E03197F1F70196883C9105C1F78091C000BC
:20F4600087FFEFCF11BA81C08FEF83BB0DC084B3809584BB80E090E0E0EDF7E03197F1F704
:20F480000196883C9105C1F78091C00087FFEFCF14BA6BC08FEF809301010FC0809102013F
:20F4A00080958093020180E090E0E0EDF7E03197F1F70196883C9105C1F78091C00087FFFD
:20F4C000EDCF1092020151C08FEF809304010FC08091050180958093050180E090E0E0ED73
:20F4E000F7E03197F1F70196883C9105C1F78091C00087FFEDCF1092050137C08FEF809399
:20F5000007010FC08091080180958093080180E090E0E0EDF7E03197F1F70196883C9105B4
:20F52000C1F78091C00087FFEDCF109208011DC08FEF80930A010FC080910B0180958093C8
:20F540000B0180E090E0E0EDF7E03197F1F70196883C9105C1F78091C00087FFEDCF10921D
:20F560000B0103C085E292EEEEC98091C00087FFFCCF8091C600EAC988E392EEE4C98CE16D
:20F5800091EEE1C988249924933011F1943028F4913089F09230B8F408C0953061F19530E8
:20F5A000F0F0963009F048C043C02B3109F042C991E06BE13FC96227C15DDE4F2883CF52DC
:20F5C000D14092E037C9B22FA0E0622793E032C9822F90E0A82BB92B622794E02BC92E3029
:20F5E00009F03DC3622795E0C05DDE4F19821882C053D1401FC9E1E0F0E0EC0FFD1FC05DC4
:20F60000DE4F08811981C053D140E00FF11F20830F5F1F4FC05DDE4F19830883C053D14063
:20F6200062270A171B0709F005C9D80196E002C9261709F014C303C0973009F0FBC877242F
:20F640009981933109F412C19431C8F4963009F4D8C0973050F4923009F406C1933009F4CF
:20F660006DC0913009F05DC253C0913109F477C0923108F0BBC0903109F053C2F5C09831F8
:20F6800009F487C0993150F4953109F4EFC0953108F4C6C1963109F044C2C2C19A3109F44C
:20F6A0006CC09A3108F491C09B3109F45BC09D3109F037C29D81903359F48F81882311F474
:20F6C0009EE11CC0813011F091E018C098E916C0892F807591F0903539F4E0E0F0E089E064
:20F6E0008093570094910AC0983539F4E3E0F0E089E080935700949101C090E01A821B82C2
:20F700008D818C831D829E831F8227E030E00DC21A8288E08B8381E48C8386E58D8382E51D
:20F720008E8389E48F8383E5888780E589878FE58A8782E38B872BE030E0F7C18A818139B9
:20F7400041F0823941F0803911F48FE005C080E003C082E001C08AE01A828B8344C07724A1
:20F76000739482C08D81882311F48EE12CC0813011F081E028C088E926C01A82E1E0F0E0A8
:20F7800089E08093570084918B831C8224E030E0CCC18B81803589F48C81883039F4E2E042
:20F7A000F0E089E08093570084910DC0E0E0F0E089E080935700849106C0E3E0F0E089E08A
:20F7C0008093570084911A82DFCF8D81836C99E0E1E0F0E0082E90935700E89507B600FC73
:20F7E000FDCF1A821B8223E030E09FC180EC8A83CE5CDE4F188219821A821B82C253D1402D
:20F8000092C18A8190E0A0E0B0E0582F4427332722278B8190E0A0E0B0E0DC01992788279D
:20F82000282B392B4A2B5B2B8D8190E0A0E0B0E0282B392B4A2B5B2B8C8190E0A0E0B0E049
:20F84000BA2FA92F982F8827282B392B4A2B5B2B220F331F441F551FC05EDE4F28833983B3
:20F860004A835B83C052D1401A825DC13A81C95CDE4F3883C753D140CA5CDE4F1882C65307
:20F88000D1408B81C82EDD24CA5CDE4F48815981C653D140C42AD52A933109F082C0CE5C1E
:20F8A000DE4F88819981AA81BB81C253D1408050904CA340B04030F583E0CE5CDE4FE880A5
:20F8C000F9800A811B81C253D140F70100935B0080935700E89507B600FCFDCFCE5CDE4FB9
:20F8E000088119812A813B81C253D14000501F4F2F4F3F4FCE5CDE4F088319832A833B83A5
:20F90000C253D140C05EDE4F488159816A817B81C052D140DE011B9631E08C9111962C91A7
:20F9200011971296C75CDE4F2883C953D140C85CDE4F1882C853D14090E0C85CDE4FE8810E
:20F94000F981C853D1408E2B9F2B0C01FA0160935B0030935700E89511244E5F5F4F6F4F43
:20F960007F4F0EEFE02E0FEFF02ECE0CDF1CC114D10499F685E0C05EDE4F088119812A8106
:20F980003B81C052D140F80120935B0080935700E89507B600FCFDCF81E180935700E895CC
:20F9A00035C0C05EDE4F88819981AA81BB81C052D140B695A795979587957C018601FBE0AC
:20F9C000AF2EB12CAC0EBD1E0BC0D5016D915D01C7010F9483FE0894E11CF11C01501040A8
:20F9E0000115110591F7A60160E070E0440F551F661F771FC05EDE4FE880F9800A811B81E7
:20FA0000C052D1404E0D5F1D601F711F1A82C05EDE4F488359836A837B83C052D14083C0FE
:20FA2000FA80C55CDE4FF882CB53D140C65CDE4F1882CA53D1408B81282F30E0C65CDE4F7C
:20FA400008811981CA53D140202B312B1A828981AE014D5F5F4F843121F5B901C05EDE4F2F
:20FA6000E880F9800A811B81C052D1400BBFF70187919691DA018C9311969C934E5F5F4F2F
:20FA8000D801C7010296A11DB11DC05EDE4F88839983AA83BB83C052D14062507040F1F658
:20FAA0003BC0C05EDE4F88819981AA81BB81C052D140B695A79597958795BC01F90161BDAF
:20FAC00072BD6F5F7F4FF89A80B5DA018D93AD013197A9F721503040C901A0E0B0E02F5F3A
:20FAE0003F4F880F991FAA1FBB1F0296A11DB11DC05EDE4FE880F9800A811B81C052D140EC
:20FB0000E80EF91E0A1F1B1FC05EDE4FE882F9820A831B83C052D1402D5F3F4FDA011C9254
:20FB200004C080EC8A8322E030E08BE18093C6008091C00086FFFCCF8091C0008064809348
:20FB4000C000C15DDE4FB881CF52D140B093C6008091C00086FFFCCF8091C000806480933D
:20FB6000C000432F3093C6008091C00086FFFCCF8091C00080648093C000922F2093C600E7
:20FB80008091C00086FFFCCF8091C00080648093C0008EE08093C6008091C00086FFFCCF54
:20FBA0008091C00080648093C00065E1C15DDE4FE881CF52D1406E2769276427FE0131961B
:20FBC00010C090819093C6008091C00086FFFCCF31968091C00080648093C00069272150EA
:20FBE00030402115310569F76093C6008091C00086FFFCCF8091C00080648093C00085B131
:20FC0000805885B9772081F4C15DDE4FF881CF52D140FF5FC15DDE4FF883CF52D14090E006
:20FC2000A0E0B0E00D941AF427982F9880E090E020ED37E0F9013197F1F7019684369105FA
:20FC4000C9F700008091C0008D7F8093C00081E180935700E895EE27FF270994FFCF90E0D5
:20FC60000D941AF497FB092E07260AD077FD04D02ED006D000201AF4709561957F4F089555
:20FC8000F6F7909581959F4F0895A1E21A2EAA1BBB1BFD010DC0AA1FBB1FEE1FFF1FA217F9
:20FCA000B307E407F50720F0A21BB30BE40BF50B661F771F881F991F1A9469F760957095A7
:20FCC000809590959B01AC01BD01CF010895AA1BBB1B51E107C0AA1FBB1FA617B70710F0C4
:20FCE000A61BB70B881F991F5A95A9F780959095BC01CD010895F999FECF92BD81BDF89AB3
:20FD0000992780B50895262FF999FECF1FBA92BD81BD20BD0FB6F894FA9AF99A0FBE01967E
:06FD20000895F894FFCFE6
:040000050003E00014
:00000001FF

@stefanrueger
Copy link
Collaborator

stefanrueger commented Jun 18, 2022

Is this the correct way to combine the two hex file? It does not seem to be correct

Yes it is, but why do you want to combine the files? You can use multiple -U ... options with different files on the command line.

@mariusgreuel is correct in his analysis. It is clear from the code that programming a file that starts at 0x11000 will not work. (no tests needed). There are examples in stk500.c how to treat sending the LOAD_EXT_ADDR command only when needed.

If you want a real quick fix then always send the LOAD_EXT_ADDR command when it exists for the part a la

  if(use_lext_address && avrftdi_lext(pgm, p, m, addr/2) < 0)
    return -1;

That will do. As it is for paged read/writes and as the ATmega2560 has a page size of 256, programming 65k will draw 254 redundant load extended address commands at some 8(?) bytes traffic each, so programming might take 3% longer - you probably won't even notice.

@mcuee
Copy link
Collaborator

mcuee commented Jun 18, 2022

@stefanrueger
Thanks. I will test the simple fix with my JTAGkey 2 (miss-placed and need to find it).

Still I think my original hex file (simply combined the two files using Notepad++) is still valid for this test as it is using programmer and not bootloader. So 261414 bytes size is still okay and within the 256KB range (262144 bytes).

It is not valid for the #994 test since that was for the bootloader (262144 - 768 = 261376).

@mcuee
Copy link
Collaborator

mcuee commented Jun 18, 2022

Is this the correct way to combine the two hex file? It does not seem to be correct

Yes it is, but why do you want to combine the files? You can use multiple -U ... options with different files on the command line.

@mariusgreuel is correct in his analysis. It is clear from the code that programming a file that starts at 0x11000 will not work. (no tests needed). There are examples in stk500.c how to treat sending the LOAD_EXT_ADDR command only when needed.

If you want a real quick fix then always send the LOAD_EXT_ADDR command when it exists for the part a la

  if(use_lext_address && avrftdi_lext(pgm, p, m, addr/2) < 0)
    return -1;

That will do. As it is for paged read/writes and as the ATmega2560 has a page size of 256, programming 65k will draw 254 redundant load extended address commands at some 8(?) bytes traffic each, so programming might take 3% longer - you probably won't even notice.

@stefanrueger
Indeed the quick fix seems to work fine.

$ git diff
diff --git a/src/avrftdi.c b/src/avrftdi.c
index e41d775..24e2d01 100644
--- a/src/avrftdi.c
+++ b/src/avrftdi.c
@@ -1021,10 +1021,8 @@ static int avrftdi_flash_write(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
         * bytes.
         * write the command only once.
         */
-       if(use_lext_address && (((addr/2) & 0xffff0000))) {
-               if (0 > avrftdi_lext(pgm, p, m, addr/2))
+       if(use_lext_address && avrftdi_lext(pgm, p, m, addr/2) < 0)
                        return -1;
-       }

        /* prepare the command stream for the whole page */
        /* addr is in bytes, but we program in words. addr/2 should be something
@@ -1128,10 +1126,8 @@ static int avrftdi_flash_read(PROGRAMMER * pgm, AVRPART * p, AVRMEM * m,
                return -1;
        }

-       if(use_lext_address && ((address & 0xffff0000))) {
-               if (0 > avrftdi_lext(pgm, p, m, address))
+    if(use_lext_address && avrftdi_lext(pgm, p, m, addr/2) < 0)
                        return -1;
-       }

        /* word addressing! */
        for(word = addr/2, index = 0; word < (addr + len)/2; word++)

PS C:\work\avr\avrdude_test\avrdude-7.0_bin64> .\avrdude_sr474.exe -p m2560 -c jtagkey -v 
-U .\stk500boot_v2_mega2560_arduino_official.hex -U .\entest_offset_0x11000.hex

avrdude_sr474.exe: Version 7.0-20220530 (feaa1c6)
                   Copyright (c) Brian Dean, http://www.bdmicro.com/
                   Copyright (c) Joerg Wunsch

                   System wide configuration file is "C:/work/avr/avrdude_test/avrdude-7.0_bin64/avrdude.conf"

                   Using Port                    : usb
                   Using Programmer              : jtagkey
                   AVR Part                      : ATmega2560
                   Chip Erase delay              : 9000 us
                   PAGEL                         : PD7
                   BS2                           : PA0
                   RESET disposition             : dedicated
                   RETRY pulse                   : SCK
                   Serial program mode           : yes
                   Parallel program mode         : yes
                   Timeout                       : 200
                   StabDelay                     : 100
                   CmdexeDelay                   : 25
                   SyncLoops                     : 32
                   PollIndex                     : 3
                   PollValue                     : 0x53
                   Memory Detail                 :

                                                     Block Poll               Page                       Polled
                     Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
                     ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
                     eeprom                 65    10     8    0 no       4096    8      0  9000  9000 0x00 0x00
                     flash                  65    10   256    0 yes    262144  256   1024  4500  4500 0x00 0x00
                     lfuse                   0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
                     hfuse                   0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
                     efuse                   0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
                     lock                    0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
                     calibration             0     0     0    0 no          1    1      0     0     0 0x00 0x00
                     signature               0     0     0    0 no          3    1      0     0     0 0x00 0x00

                   Programmer Type : avrftdi
                   Description     : Amontec JTAGKey, JTAGKey-Tiny and JTAGKey2

avrdude_sr474.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude_sr474.exe: Device signature = 0x1e9801 (probably m2560)
avrdude_sr474.exe: NOTE: "flash" memory has been specified, an erase cycle will be performed
                   To disable this feature, specify the -D option.
avrdude_sr474.exe: erasing chip
avrdude_sr474.exe: reading input file ".\stk500boot_v2_mega2560_arduino_official.hex"
avrdude_sr474.exe: input file .\stk500boot_v2_mega2560_arduino_official.hex auto detected as Intel Hex
avrdude_sr474.exe: writing flash (261406 bytes):

Writing | ################################################## | 100% 0.06s

avrdude_sr474.exe: 261406 bytes of flash written
avrdude_sr474.exe: verifying flash memory against .\stk500boot_v2_mega2560_arduino_official.hex:
avrdude_sr474.exe: input file .\stk500boot_v2_mega2560_arduino_official.hex auto detected as Intel Hex

Reading | ################################################## | 100% 0.06s

avrdude_sr474.exe: 261406 bytes of flash verified
avrdude_sr474.exe: reading input file ".\entest_offset_0x11000.hex"
avrdude_sr474.exe: input file .\entest_offset_0x11000.hex auto detected as Intel Hex
avrdude_sr474.exe: writing flash (70144 bytes):

Writing | ################################################## | 100% 0.00s

avrdude_sr474.exe: 70144 bytes of flash written
avrdude_sr474.exe: verifying flash memory against .\entest_offset_0x11000.hex:
avrdude_sr474.exe: input file .\entest_offset_0x11000.hex auto detected as Intel Hex

Reading | ################################################## | 100% 0.00s

avrdude_sr474.exe: 70144 bytes of flash verified

avrdude_sr474.exe done.  Thank you.

PS C:\work\avr\avrdude_test\avrdude-7.0_bin64> .\avrdude_sr474.exe -p m2560 -c jtagkey -v 
-U flash:v:.\stk500boot_v2_mega2560_arduino_official.hex:i -U flash:v:.\entest_offset_0x11000.hex:i

avrdude_sr474.exe: Version 7.0-20220530 (feaa1c6)
                   Copyright (c) Brian Dean, http://www.bdmicro.com/
                   Copyright (c) Joerg Wunsch

                   System wide configuration file is "C:/work/avr/avrdude_test/avrdude-7.0_bin64/avrdude.conf"

                   Using Port                    : usb
                   Using Programmer              : jtagkey
                   AVR Part                      : ATmega2560
                   Chip Erase delay              : 9000 us
                   PAGEL                         : PD7
                   BS2                           : PA0
                   RESET disposition             : dedicated
                   RETRY pulse                   : SCK
                   Serial program mode           : yes
                   Parallel program mode         : yes
                   Timeout                       : 200
                   StabDelay                     : 100
                   CmdexeDelay                   : 25
                   SyncLoops                     : 32
                   PollIndex                     : 3
                   PollValue                     : 0x53
                   Memory Detail                 :

                                                     Block Poll               Page                       Polled
                     Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
                     ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
                     eeprom                 65    10     8    0 no       4096    8      0  9000  9000 0x00 0x00
                     flash                  65    10   256    0 yes    262144  256   1024  4500  4500 0x00 0x00
                     lfuse                   0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
                     hfuse                   0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
                     efuse                   0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
                     lock                    0     0     0    0 no          1    1      0  9000  9000 0x00 0x00
                     calibration             0     0     0    0 no          1    1      0     0     0 0x00 0x00
                     signature               0     0     0    0 no          3    1      0     0     0 0x00 0x00

                   Programmer Type : avrftdi
                   Description     : Amontec JTAGKey, JTAGKey-Tiny and JTAGKey2

avrdude_sr474.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude_sr474.exe: Device signature = 0x1e9801 (probably m2560)
avrdude_sr474.exe: verifying flash memory against .\stk500boot_v2_mega2560_arduino_official.hex:

Reading | ################################################## | 100% 0.06s

avrdude_sr474.exe: 261406 bytes of flash verified
avrdude_sr474.exe: verifying flash memory against .\entest_offset_0x11000.hex:

Reading | ################################################## | 100% 0.00s

avrdude_sr474.exe: 70144 bytes of flash verified

avrdude_sr474.exe done.  Thank you.

@stefanrueger
Copy link
Collaborator

Created PR #998 for this Issue #474

@mcuee
Copy link
Collaborator

mcuee commented Jun 19, 2022

Test hex file creation (maybe there are better ways to create the offset hex files from the base hex file).

$ srec_cat entest.srec -offset 0x021000 -o entest_offset_0x21000.srec
srec_cat: entest.bin: 19: warning: no execution start address record

$ srec_cat entest_offset_0x21000.srec  -o entest_offset_0x21000.hex -intel
srec_cat: entest_offset_0x21000.srec: 19: warning: no execution start address
    record

$ cat entest_offset_0x21000.hex
:020000040002F8
:2010000054686520717569636B2062726F776E20666F78206A756D7073206F7665722074FE
:201020006865206C617A7920646F670A54686520717569636B2062726F776E20666F78206C
:201040006A756D7073206F76657220746865206C617A7920646F670A5468652071756963ED
:201060006B2062726F776E20666F78206A756D7073206F76657220746865206C617A7920C4
:20108000646F670A54686520717569636B2062726F776E20666F78206A756D7073206F76A5
:2010A000657220746865206C617A7920646F670A54686520717569636B2062726F776E20EE
:2010C000666F78206A756D7073206F76657220746865206C617A7920646F670A54686520B2
:2010E000717569636B2062726F776E20666F78206A756D7073206F76657220746865206C06
:20110000617A7920646F670A54686520717569636B2062726F776E20666F78206A756D7028
:2011200073206F76657220746865206C617A7920646F670A54686520717569636B20627269
:201140006F776E20666F78206A756D7073206F76657220746865206C617A7920646F670AFE
:2011600054686520717569636B2062726F776E20666F78206A756D7073206F76657220749D
:201180006865206C617A7920646F670A54686520717569636B2062726F776E20666F78200B
:2011A0006A756D7073206F76657220746865206C617A7920646F670A54686520717569638C
:2011C0006B2062726F776E20666F78206A756D7073206F76657220746865206C617A792063
:2011E000646F670A54686520717569636B2062726F776E20666F78206A756D7073206F7644
:00000001FF

$ srec_cat entest_offset_0x11000.hex -intel -o - -c-arra dopp -Output_Word | tail -9 | head -4
const unsigned long dopp_termination = 0x00000000;
const unsigned long dopp_start       = 0x00011000;
const unsigned long dopp_finish      = 0x00011200;
const unsigned long dopp_length      = 0x00000200;

$ srec_cat entest_offset_0x21000.hex -intel -o - -c-arra dopp -Output_Word | tail -9 | head -4
const unsigned long dopp_termination = 0x00000000;
const unsigned long dopp_start       = 0x00021000;
const unsigned long dopp_finish      = 0x00021200;
const unsigned long dopp_length      = 0x00000200;

$ srec_cat entest.hex -intel -o - -c-arra dopp -Output_Word | tail -9 | head -4
const unsigned long dopp_termination = 0x00000000;
const unsigned long dopp_start       = 0x00000000;
const unsigned long dopp_finish      = 0x00000200;
const unsigned long dopp_length      = 0x00000200;

entest_hexfiles.zip

@mcuee
Copy link
Collaborator

mcuee commented Jun 19, 2022

Created PR #998 for this Issue #474

@stefanrueger

Great. This works perfectly.

PS C:\work\avr\avrdude_test\avrdude-7.0_bin64> .\avrdude_sr474v1.exe -c jtagkey -patmega2560 -D 
-U flash:w:.\hex\entest_offset_0x21000.hex:i

avrdude_sr474v1.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude_sr474v1.exe: Device signature = 0x1e9801 (probably m2560)
avrdude_sr474v1.exe: reading input file ".\hex\entest_offset_0x21000.hex"
avrdude_sr474v1.exe: writing flash (135680 bytes):

Writing | ################################################## | 100% 0.00s

avrdude_sr474v1.exe: 135680 bytes of flash written
avrdude_sr474v1.exe: verifying flash memory against .\hex\entest_offset_0x21000.hex:

Reading | ################################################## | 100% 0.00s

avrdude_sr474v1.exe: 135680 bytes of flash verified

avrdude_sr474v1.exe done.  Thank you.

PS C:\work\avr\avrdude_test\avrdude-7.0_bin64> .\avrdude_sr474v1.exe -c jtagkey -patmega2560 -D 
-U flash:v:.\hex\entest_offset_0x21000.hex:i

avrdude_sr474v1.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude_sr474v1.exe: Device signature = 0x1e9801 (probably m2560)
avrdude_sr474v1.exe: verifying flash memory against .\hex\entest_offset_0x21000.hex:

Reading | ################################################## | 100% 0.00s

avrdude_sr474v1.exe: 135680 bytes of flash verified

avrdude_sr474v1.exe done.  Thank you.

PS C:\work\avr\avrdude_test\avrdude-7.0_bin64> .\avrdude_sr474v1.exe -c usbasp -patmega2560 -D 
-U flash:v:.\hex\entest_offset_0x21000.hex:i

avrdude_sr474v1.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude_sr474v1.exe: Device signature = 0x1e9801 (probably m2560)
avrdude_sr474v1.exe: verifying flash memory against .\hex\entest_offset_0x21000.hex:

Reading | ################################################## | 100% 0.00s

avrdude_sr474v1.exe: 135680 bytes of flash verified

avrdude_sr474v1.exe done.  Thank you.

@mcuee mcuee added the bug Something isn't working label Jun 19, 2022
stefanrueger added a commit that referenced this issue Jul 4, 2022
Fix Issue #474 FT232H support for ATmega2560 et al (load extended address)
@stefanrueger
Copy link
Collaborator

Fixed in PR #998

stefanrueger added a commit that referenced this issue Jul 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants