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

avrdude git main issue with SNAP and PICKit 4 under Windows 7 -- MinGW build #1594

Closed
mcuee opened this issue Dec 18, 2023 · 119 comments · Fixed by #1608
Closed

avrdude git main issue with SNAP and PICKit 4 under Windows 7 -- MinGW build #1594

mcuee opened this issue Dec 18, 2023 · 119 comments · Fixed by #1608
Labels
bug Something isn't working

Comments

@mcuee
Copy link
Collaborator

mcuee commented Dec 18, 2023

From the comments here by @avrfreak

I tested v7.3, it just hangs like avrdude cannot find the com port.
(just like in older versions if the programmer was not connected)
V7.0 & V7.2 both work well with my programmer.

FYI I use a snap debugger connected to the USB port.
The debugger is in avr mode.

I am using :

avrdude -C avrdude.conf -c snap_updi -p avr32DD20 -B 4.0 -e -U flash:w:flash.hex:a -U eeprom:w:eep.hex:a

I have a few AVR16EB32's to test with if anyone has any ideas why it's not working with my programmer.

@mcuee mcuee added the unconfirmed Maybe a bug, needs to be reproduced by someone else label Dec 18, 2023
@mcuee
Copy link
Collaborator Author

mcuee commented Dec 18, 2023

As per @avrfreak, the response is different every time. Even when unplugging the USB cable from the port and trying again.

Failed log 1:
https://github.com/avrdudes/avrdude/files/13696708/V7.3_log.txt


G:\avrdude7.3>avrdude -C avrdude.conf -vvvv -c snap
_updi -p avr32DD20 -B 4.0 -e -U flash:w:flash.hex:a -U eeprom:w:eep.hex:a

avrdude: Version 7.2-20231215 (c7155f9)
         Copyright the AVRDUDE authors;
         see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

         System wide configuration file is G:\avrdude7.3\avrdude.conf

         Using port            : usb
         Using programmer      : snap_updi
         Setting bit clk period: 4.0 us
avrdude: jtag3_open_updi()
avrdude: HV UPDI support: 1
avrdude: usbhid_open(): probing for max packet size

Failed log 2:
https://github.com/avrdudes/avrdude/files/13696725/V7.3_log2.txt


G:\avrdude7.3>avrdude -C avrdude.conf -c snap_updi
-vvvv -p avr32DD20 -B 4.0 -e -U flash:w:flash.hex:a -U eeprom:w:eep.hex:a

avrdude: Version 7.2-20231215 (c7155f9)
         Copyright the AVRDUDE authors;
         see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

         System wide configuration file is G:\avrdude7.3\avrdude.conf

         Using port            : usb
         Using programmer      : snap_updi
         Setting bit clk period: 4.0 us
avrdude: jtag3_open_updi()
avrdude: HV UPDI support: 1
avrdude: usbhid_open(): probing for max packet size
avrdude: usbhid_open(): setting max_xfer from DAP_Info response to 64
avrdude: found CMSIS-DAP compliant device, using EDBG protocol
avrdude: jtag3_getsync()

avrdude: jtag3_edbg_prepare()
avrdude: jtag3_edbg_prepare(): connection status 0x01

@mcuee
Copy link
Collaborator Author

mcuee commented Dec 18, 2023

avrdude 7.2 release is okay as per @avrfreak.
https://github.com/avrdudes/avrdude/files/13696709/v72_LOG.txt


avrdude: Version 7.2
         Copyright the AVRDUDE authors;
         see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

         System wide configuration file is G:\avrdude-v7.2-windows-x86\avrdude.conf

         Using Port                    : usb
         Using Programmer              : snap_updi
         Setting bit clk period        : 4.0
avrdude: jtag3_open_updi()
avrdude: HV UPDI support: 1
avrdude: usbhid_open(): probing for max packet size
avrdude: usbhid_open(): setting max_xfer from DAP_Info response to 64
avrdude: found CMSIS-DAP compliant device, using EDBG protocol
avrdude: jtag3_getsync()

avrdude: jtag3_edbg_prepare()
avrdude: jtag3_edbg_prepare(): connection status 0x01
avrdude: sending sign-on command: 
avrdude: jtag3_edbg_send(): sending 3 bytes
avrdude: jtag3_edbg_recv():
avrdude: jtag3_recv(): Got message seqno 0 (command_sequence == 0)

Raw message:
01  80  00  
[general] OK
... (skipped) ...

@mcuee
Copy link
Collaborator Author

mcuee commented Dec 18, 2023

@avrfreak

Please try the following binaries to see if there are any differences in the behavior. The issue seems to be related to HIDAPI.

Latest git main github action binaries.

  1. Windows 32bit mingw32 cross-build using Arduino avrdude-packing script, using hidapi 0.12.0
    https://github.com/avrdudes/avrdude/actions/runs/7242320665
    (download dist.zip and then get the 32bit Windows binary)

  2. Windows 64bit mingw64 and msvc64 binaries
    https://github.com/avrdudes/avrdude/actions/runs/7242320659
    avrdude-mingw-x86_64.zip --> avrdude mingw64 binary with MSYS2 bundled hidapi library, using hidapi 0.14.0.
    avrdude-msvc-x64.zip --> avrdude msvc64 binary with avrdude bundled hidapi library, same as hidapi 0.13.0.

Note: github action mingw64 build uses the following as per the log.

mingw-w64-x86_64-hidapi-0.14.0-2  mingw-w64-x86_64-libelf-0.8.13-7  
mingw-w64-x86_64-libftdi-1.5-5  mingw-w64-x86_64-libserialport-0.1.1.r399.6f9b03e-1  
mingw-w64-x86_64-libusb-1.0.26-1  mingw-w64-x86_64-libusb-compat-git-r76.b5db9d0-2  
mingw-w64-x86_64-ncurses-6.4.20230708-1  mingw-w64-x86_64-readline-8.2.007-1  
mingw-w64-x86_64-termcap-1.3.1-7

@avrfreak
Copy link

I tested both versions msvc & mingw on windows 10 with a snap debugger as the programmer. They are both working with older devices but not with the new AVREB.
I will post the log files here & the other thread.

msvc_logfile.txt
mingw_logfile.txt

@mcuee
Copy link
Collaborator Author

mcuee commented Dec 19, 2023

I tested both versions msvc & mingw on windows 10 with a snap debugger as the programmer. They are both working with older devices but not with the new AVREB. I will post the log files here & the other thread.

Thanks for the updates.

As per @MCUdude, SNAP does not support AVR EB yet in AVR mode.

@mcuee
Copy link
Collaborator Author

mcuee commented Dec 19, 2023

@avrfreak

Just want to confirm that the issue is only with AVR EB.

avrdude git main is working with AVR DD, right? Your original report is with AVR32DD20.

@mcuee mcuee changed the title avrdude git main issue with SNAP and AVR DD avrdude git main issue with SNAP and AVR EB Dec 19, 2023
@mcuee mcuee added enhancement New feature or request and removed unconfirmed Maybe a bug, needs to be reproduced by someone else labels Dec 19, 2023
@avrfreak
Copy link

avrfreak commented Dec 19, 2023

V7.3 does not work with the SNAP debugger/programmer regardless of the device that is being programmed. It only works with V7.2.

If they were working earlier today they are not working now.
I have been using the snap programmer all day today (and every day) with avrdudeV7.0 without any problems whatsoever. I am not using anything else that may change my programmer/debugger configuration, so there must be a modification in the V7.3 that doesn't work correctly.

mingw_logfile.txt
msvc_logfile.txt

@avrfreak
Copy link

I would like to know how avrdude V7.3 was tested? What programmer was used? Will jtag2updi work with V7.3?
Thanks

@mcuee
Copy link
Collaborator Author

mcuee commented Dec 19, 2023

I would like to know how avrdude V7.3 was tested? What programmer was used? Will jtag2updi work with V7.3? Thanks

There is no avrdude 7.3 release yet. jtag2updi should work with avrdude git main (which is close to avrdude 7.3 if no big issues were found).

Please help to provide a clear description of the issue you encountered -- basically avrdude 7.2 works with the devices you tested (please list them) but not avrdude git main.

If they were working earlier today they are not working now.

So avrdude git main was working previously but not any more? Sorry your reports are vague and I do not quite understand what you are trying to say.

@mcuee mcuee changed the title avrdude git main issue with SNAP and AVR EB avrdude git main issue with SNAP Dec 19, 2023
@mcuee mcuee added unconfirmed Maybe a bug, needs to be reproduced by someone else and removed enhancement New feature or request labels Dec 19, 2023
@mcuee
Copy link
Collaborator Author

mcuee commented Dec 19, 2023

@avrfreak

Still thanks a lot for carrying out the tests on git main. If this issue is confirmed to be a regression from avrdude 7.2, it will be a high priority to fix before avrdude 7.3 release.

@mcuee
Copy link
Collaborator Author

mcuee commented Dec 21, 2023

I will need to set up my SNAP to test with an AVR Dx chip.

Just a first test with a classic ATmega32A first, using SNAP in JTAG mode and there is no issue (same for PICKit 4).

PS> .\avrdude_git -c snap -p m32a -U flash:v:m32a_blink_read.hex:i
avrdude_git: AVR device initialized and ready to accept instructions
avrdude_git: device signature = 0x1e9502 (probably m32a)

avrdude_git: processing -U flash:v:m32a_blink_read.hex:i
avrdude_git: verifying flash memory against m32a_blink_read.hex
Reading | ################################################## | 100% 0.08 s
avrdude_git: 526 bytes of flash verified

avrdude_git done.  Thank you.

Full debug log with -vvvv.

Click for the full debug log with `-vvvv`
PS> .\avrdude_git -c snap -p m32a -U flash:v:m32a_blink_read.hex:i -vvvv

avrdude_git: Version 7.2-20231218 (67792ca8)
             Copyright the AVRDUDE authors;
             see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

             System wide configuration file is C:\work\avr\avrdude_test\avrdude_bin\avrdude.conf
             User configuration file is C:\work\avr\avrdude_test\avrdude_bin\avrdude.rc

             Using port            : usb
             Using programmer      : snap
             Default baud rate     : 57600
avrdude_git: jtag3_open()
avrdude_git: usbhid_open(): probing for max packet size
avrdude_git: usbhid_open(): setting max_xfer from DAP_Info response to 64
avrdude_git: found CMSIS-DAP compliant device, using EDBG protocol
avrdude_git: jtag3_getsync()

avrdude_git: jtag3_edbg_prepare()
avrdude_git: jtag3_edbg_prepare(): connection status 0x01
avrdude_git: sending sign-on command:
avrdude_git: jtag3_edbg_send(): sending 3 bytes
avrdude_git: jtag3_edbg_recv():
avrdude_git: jtag3_recv(): Got message seqno 0 (command_sequence == 0)

Raw message:
01  80  00
[general] OK
             AVR Part              : ATmega32A
             Programming modes     : ISP, HVPP, JTAG, JTAGmkI, SPM

             Memory        Size  Pg size
             ---------------------------
             eeprom        1024        4
             flash        32768      128
             hfuse            1        1
             lfuse            1        1
             lock             1        1
             calibration      4        1
             signature        3        1
             io              64        1
             sram          2048        1

             Variants       Package  F max   T range         V range
             --------------------------------------------------------------
             ATmega32A-AN   TQFP44   16 MHz  [-40 C, 105 C]  [2.7 V, 5.5 V]
             ATmega32A-ANR  TQFP44   16 MHz  [N/A,     N/A]  [2.7 V, 5.5 V]
             ATmega32A-AU   TQFP44   16 MHz  [-40 C,  85 C]  [2.7 V, 5.5 V]
             ATmega32A-AUR  TQFP44   16 MHz  [-40 C,  85 C]  [2.7 V, 5.5 V]
             ATmega32A-MN   VQFN44   16 MHz  [-40 C,  85 C]  [2.7 V, 5.5 V]
             ATmega32A-MNR  VQFN44   16 MHz  [N/A,     N/A]  [2.7 V, 5.5 V]
             ATmega32A-MU   MLF44    16 MHz  [-40 C,  85 C]  [2.7 V, 5.5 V]
             ATmega32A-MUR  VQFN44   16 MHz  [-40 C,  85 C]  [2.7 V, 5.5 V]
             ATmega32A-PN   PDIP40   16 MHz  [-40 C,  85 C]  [2.7 V, 5.5 V]
             ATmega32A-PU   PDIP40   16 MHz  [-40 C,  85 C]  [2.7 V, 5.5 V]

             Programmer Type       : JTAGICE3
             Description           : MPLAB(R) SNAP in JTAG mode
avrdude_git: jtag3_getparm()
avrdude_git: sending get parameter (scope 0x01, section 0, parm 0) command:
avrdude_git: jtag3_edbg_send(): sending 6 bytes
avrdude_git: jtag3_edbg_recv():
avrdude_git: jtag3_recv(): Got message seqno 1 (command_sequence == 1)

Raw message:
01  84  01  01  01  0a  f9  00  00
[general] Data returned:
0x01 0x01 0x01 0x0a 0xf9 0x00 0x00
             ICE HW version        : 1
             ICE FW version        : 1.10 (rel. 249)
             Serial number         : BURxxxxxxxxx
avrdude_git: jtag3_getparm()
avrdude_git: sending get parameter (scope 0x01, section 0, parm 1) command:
avrdude_git: jtag3_edbg_send(): sending 6 bytes
avrdude_git: jtag3_edbg_recv():
avrdude_git: jtag3_recv(): Got message seqno 2 (command_sequence == 2)

Raw message:
01  84  01  01  0a  00
[general] Data returned:
0x01 0x01 0x0a 0x00
avrdude_git: jtag3_setparm()
avrdude_git: sending set parameter (scope 0x12, section 0, parm 0) command:
avrdude_git: jtag3_edbg_send(): sending 7 bytes
avrdude_git: jtag3_edbg_recv():
avrdude_git: jtag3_recv(): Got message seqno 3 (command_sequence == 3)

Raw message:
12  80  00
[AVR] OK
avrdude_git: jtag3_setparm()
avrdude_git: sending set parameter (scope 0x12, section 0, parm 1) command:
avrdude_git: jtag3_edbg_send(): sending 7 bytes
avrdude_git: jtag3_edbg_recv():
avrdude_git: jtag3_recv(): Got message seqno 4 (command_sequence == 4)

Raw message:
12  80  00
[AVR] OK
avrdude_git: jtag3_setparm()
avrdude_git: sending set parameter (scope 0x12, section 1, parm 0) command:
avrdude_git: jtag3_edbg_send(): sending 7 bytes
avrdude_git: jtag3_edbg_recv():
avrdude_git: jtag3_recv(): Got message seqno 5 (command_sequence == 5)

Raw message:
12  80  00
[AVR] OK
avrdude_git: jtag3_initialize(): trying to set JTAG daisy-chain info to 0,0,0,0
avrdude_git: jtag3_setparm()
avrdude_git: sending set parameter (scope 0x12, section 1, parm 1) command:
avrdude_git: jtag3_edbg_send(): sending 10 bytes
avrdude_git: jtag3_edbg_recv():
avrdude_git: jtag3_recv(): Got message seqno 6 (command_sequence == 6)

Raw message:
12  80  00
[AVR] OK
avrdude_git: jtag3_getparm()
avrdude_git: sending get parameter (scope 0x01, section 1, parm 0) command:
avrdude_git: jtag3_edbg_send(): sending 6 bytes
avrdude_git: jtag3_edbg_recv():
avrdude_git: jtag3_recv(): Got message seqno 7 (command_sequence == 7)

Raw message:
01  84  01  5f  13  00
[general] Data returned:
0x01 0x5f 0x13 0x00
             Vtarget               : 4.96 V
avrdude_git: jtag3_getparm()
avrdude_git: sending get parameter (scope 0x12, section 1, parm 0) command:
avrdude_git: jtag3_edbg_send(): sending 6 bytes
avrdude_git: jtag3_edbg_recv():
avrdude_git: jtag3_recv(): Got message seqno 8 (command_sequence == 8)

Raw message:
12  84  00  04  00
[AVR] Data returned:
0x00 0x04 0x00
avrdude_git: jtag3_getparm()
avrdude_git: sending get parameter (scope 0x12, section 0, parm 0) command:
avrdude_git: jtag3_edbg_send(): sending 6 bytes
avrdude_git: jtag3_edbg_recv():
avrdude_git: jtag3_recv(): Got message seqno 9 (command_sequence == 9)

Raw message:
12  84  00  02  00
[AVR] Data returned:
0x00 0x02 0x00
avrdude_git: jtag3_getparm()
avrdude_git: sending get parameter (scope 0x12, section 1, parm 32) command:
avrdude_git: jtag3_edbg_send(): sending 6 bytes
avrdude_git: jtag3_edbg_recv():
avrdude_git: jtag3_recv(): Got message seqno 10 (command_sequence == 10)

Raw message:
12  84  00  e8  03  00
[AVR] Data returned:
0x00 0xe8 0x03 0x00
             JTAG clk prog.        : 1000 kHz
avrdude_git: jtag3_getparm()
avrdude_git: sending get parameter (scope 0x12, section 1, parm 33) command:
avrdude_git: jtag3_edbg_send(): sending 6 bytes
avrdude_git: jtag3_edbg_recv():
avrdude_git: jtag3_recv(): Got message seqno 11 (command_sequence == 11)

Raw message:
12  84  00  64  00  00
[AVR] Data returned:
0x00 0x64 0x00 0x00
             JTAG clk debug        : 100 kHz

avrdude_git: jtag3_setparm()
avrdude_git: sending set parameter (scope 0x12, section 2, parm 0) command:
avrdude_git: jtag3_edbg_send(): sending 37 bytes
avrdude_git: jtag3_edbg_recv():
avrdude_git: jtag3_recv(): Got message seqno 12 (command_sequence == 12)

Raw message:
12  80  00
[AVR] OK
avrdude_git: sending AVR sign-on command:
avrdude_git: jtag3_edbg_send(): sending 4 bytes
avrdude_git: jtag3_edbg_recv():
avrdude_git: jtag3_recv(): Got message seqno 13 (command_sequence == 13)

Raw message:
12  84  00  3f  20  50  a9  00
[AVR] Data returned:
0x00 0x3f 0x20 0x50 0xa9 0x00
avrdude_git: JTAG ID returned: 0x3f 0x20 0x50 0xa9
avrdude_git: AVR device initialized and ready to accept instructions
Reading |                                                    | 0% 0.00 s
avrdude_git: jtag3_read_byte(.., signature, 0x0, ...)
avrdude_git: sending enter progmode command:
avrdude_git: jtag3_edbg_send(): sending 3 bytes
avrdude_git: jtag3_edbg_recv():
avrdude_git: jtag3_recv(): Got message seqno 14 (command_sequence == 14)

Raw message:
12  80  00
[AVR] OK
avrdude_git: sending read memory command:
avrdude_git: jtag3_edbg_send(): sending 12 bytes
avrdude_git: jtag3_edbg_recv():
avrdude_git: jtag3_recv(): Got message seqno 15 (command_sequence == 15)

Raw message:
12  84  00  1e  95  02  00
[AVR] Data returned:
0x00 0x1e 0x95 0x02 0x00
avrdude_git: jtag3_read_byte(.., signature, 0x1, ...)
Reading | #################                                  | 33% 0.08 s
avrdude_git: jtag3_read_byte(.., signature, 0x2, ...)
Reading | ################################################## | 100% 0.09 s
avrdude_git: device signature = 0x1e9502 (probably m32a)

avrdude_git: processing -U flash:v:m32a_blink_read.hex:i
avrdude_git: verifying flash memory against m32a_blink_read.hex
avrdude_git: load flash data from input file m32a_blink_read.hex
avrdude_git: input file m32a_blink_read.hex contains 526 bytes
avrdude_git: reading on-chip flash data ...
Reading |                                                    | 0% 0.00 s
avrdude_git: jtag3_paged_load(.., flash, 128, 0x0000, 128)
avrdude_git: jtag3_paged_load(): block_size at addr 0 is 128
avrdude_git: sending read memory command:
avrdude_git: jtag3_edbg_send(): sending 12 bytes
avrdude_git: jtag3_edbg_recv():
avrdude_git: jtag3_recv(): Got message seqno 16 (command_sequence == 16)

Raw message:
12  84  00  0c  94  2a  00  ff  ff  ff  ff  ff  ff  ff  ff  ff
ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff
ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff
ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff
ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff
ff  ff  ff  ff  ff  ff  ff  cf  e5  d8  e0  cd  bf  de  bf  c0
51  d0  40  0a  ea  08  83  00  24  e0  e6  f0  e0  10  e0  e0
36  f1  07  11  f0  01  92  fb  cf  00  83  e4  e5  f0  e0  a0
e6  b0  e0  00
[AVR] Data returned:
0x00 0x0c 0x94 0x2a 0x00 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff
0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff
0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff
0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff
0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff
0xff 0xff 0xff 0xff 0xff 0xcf 0xe5 0xd8 0xe0 0xcd 0xbf 0xde 0xbf 0xc0 0x51 0xd0
0x40 0x0a 0xea 0x08 0x83 0x00 0x24 0xe0 0xe6 0xf0 0xe0 0x10 0xe0 0xe0 0x36 0xf1
0x07 0x11 0xf0 0x01 0x92 0xfb 0xcf 0x00 0x83 0xe4 0xe5 0xf0 0xe0 0xa0 0xe6 0xb0
0xe0 0x00
Reading | ##########                                         | 20% 0.07 s
avrdude_git: jtag3_paged_load(.., flash, 128, 0x0080, 128)
avrdude_git: jtag3_paged_load(): block_size at addr 128 is 128
avrdude_git: sending read memory command:
avrdude_git: jtag3_edbg_send(): sending 12 bytes
avrdude_git: jtag3_edbg_recv():
avrdude_git: jtag3_recv(): Got message seqno 17 (command_sequence == 17)

Raw message:
12  84  00  10  e0  00  e0  0b  bf  e4  35  f1  07  21  f0  c8
95  31  96  0d  92  f9  cf  0e  94  4d  00  ff  cf  1a  93  0a
93  80  ef  81  bb  8f  ef  82  bb  0c  c0  aa  24  40  ef  06
c0  42  bb  0c  e2  11  e0  16  d0  44  0f  a3  94  84  e0  8a
15  b8  f7  f3  cf  22  96  08  95  4a  93  5a  93  44  27  55
27  03  c0  00  00  4f  5f  5f  4f  40  17  51  07  d0  f3  59
91  49  91  08  95  0e  94  88  00  66  27  77  27  44  27  55
27  0b  c0  66  27  77  27  02  c0  6f  5f  7f  4f  64  37  e4
e0  7e  07  00
[AVR] Data returned:
0x00 0x10 0xe0 0x00 0xe0 0x0b 0xbf 0xe4 0x35 0xf1 0x07 0x21 0xf0 0xc8 0x95 0x31
0x96 0x0d 0x92 0xf9 0xcf 0x0e 0x94 0x4d 0x00 0xff 0xcf 0x1a 0x93 0x0a 0x93 0x80
0xef 0x81 0xbb 0x8f 0xef 0x82 0xbb 0x0c 0xc0 0xaa 0x24 0x40 0xef 0x06 0xc0 0x42
0xbb 0x0c 0xe2 0x11 0xe0 0x16 0xd0 0x44 0x0f 0xa3 0x94 0x84 0xe0 0x8a 0x15 0xb8
0xf7 0xf3 0xcf 0x22 0x96 0x08 0x95 0x4a 0x93 0x5a 0x93 0x44 0x27 0x55 0x27 0x03
0xc0 0x00 0x00 0x4f 0x5f 0x5f 0x4f 0x40 0x17 0x51 0x07 0xd0 0xf3 0x59 0x91 0x49
0x91 0x08 0x95 0x0e 0x94 0x88 0x00 0x66 0x27 0x77 0x27 0x44 0x27 0x55 0x27 0x0b
0xc0 0x66 0x27 0x77 0x27 0x02 0xc0 0x6f 0x5f 0x7f 0x4f 0x64 0x37 0xe4 0xe0 0x7e
0x07 0x00
Reading | ####################                               | 40% 0.14 s
avrdude_git: jtag3_paged_load(.., flash, 128, 0x0100, 128)
avrdude_git: jtag3_paged_load(): block_size at addr 256 is 128
avrdude_git: sending read memory command:
avrdude_git: jtag3_edbg_send(): sending 12 bytes
avrdude_git: jtag3_edbg_recv():
avrdude_git: jtag3_recv(): Got message seqno 18 (command_sequence == 18)

Raw message:
12  84  00  d0  f3  4f  5f  5f  4f  40  17  51  07  90  f3  0c
94  8d  00  7a  93  6a  93  5a  93  4a  93  08  95  49  91  59
91  69  91  79  91  08  95  ff  ff  ff  ff  ff  ff  ff  ff  ff
ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff
ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff
ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff
ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff
ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff
ff  ff  ff  00
[AVR] Data returned:
0x00 0xd0 0xf3 0x4f 0x5f 0x5f 0x4f 0x40 0x17 0x51 0x07 0x90 0xf3 0x0c 0x94 0x8d
0x00 0x7a 0x93 0x6a 0x93 0x5a 0x93 0x4a 0x93 0x08 0x95 0x49 0x91 0x59 0x91 0x69
0x91 0x79 0x91 0x08 0x95 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff
0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff
0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff
0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff
0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff
0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff
0xff 0x00
Reading | ##############################                     | 60% 0.21 s
avrdude_git: jtag3_paged_load(.., flash, 128, 0x0180, 128)
avrdude_git: jtag3_paged_load(): block_size at addr 384 is 128
avrdude_git: sending read memory command:
avrdude_git: jtag3_edbg_send(): sending 12 bytes
avrdude_git: jtag3_edbg_recv():
avrdude_git: jtag3_recv(): Got message seqno 19 (command_sequence == 19)

Raw message:
12  84  00  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff
ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff
ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff
ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff
ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff
ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff
ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff
ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff
ff  ff  ff  00
[AVR] Data returned:
0x00 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff
0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff
0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff
0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff
0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff
0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff
0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff
0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff
0xff 0x00
Reading | ########################################           | 80% 0.28 s
avrdude_git: jtag3_paged_load(.., flash, 128, 0x0200, 128)
avrdude_git: jtag3_paged_load(): block_size at addr 512 is 128
avrdude_git: sending read memory command:
avrdude_git: jtag3_edbg_send(): sending 12 bytes
avrdude_git: jtag3_edbg_recv():
avrdude_git: jtag3_recv(): Got message seqno 20 (command_sequence == 20)

Raw message:
12  84  00  ff  ff  ff  ff  6f  20  77  6f  72  6c  64  21  00
ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff
ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff
ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff
ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff
ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff
ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff
ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff  ff
ff  ff  ff  00
[AVR] Data returned:
0x00 0xff 0xff 0xff 0xff 0x6f 0x20 0x77 0x6f 0x72 0x6c 0x64 0x21 0x00 0xff 0xff
0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff
0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff
0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff
0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff
0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff
0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff
0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff 0xff
0xff 0x00
Reading | ################################################## | 100% 0.36 s
avrdude_git: avr_read_mem(): skipping page 5: no interesting data
avrdude_git: avr_read_mem(): skipping page 6: no interesting data
avrdude_git: avr_read_mem(): skipping page 7: no interesting data
avrdude_git: avr_read_mem(): skipping page 8: no interesting data
avrdude_git: avr_read_mem(): skipping page 9: no interesting data
avrdude_git: avr_read_mem(): skipping page 10: no interesting data
avrdude_git: avr_read_mem(): skipping page 11: no interesting data
avrdude_git: avr_read_mem(): skipping page 12: no interesting data
avrdude_git: avr_read_mem(): skipping page 13: no interesting data
avrdude_git: avr_read_mem(): skipping page 14: no interesting data
avrdude_git: avr_read_mem(): skipping page 15: no interesting data
avrdude_git: avr_read_mem(): skipping page 16: no interesting data
avrdude_git: avr_read_mem(): skipping page 17: no interesting data
avrdude_git: avr_read_mem(): skipping page 18: no interesting data
avrdude_git: avr_read_mem(): skipping page 19: no interesting data
avrdude_git: avr_read_mem(): skipping page 20: no interesting data
avrdude_git: avr_read_mem(): skipping page 21: no interesting data
avrdude_git: avr_read_mem(): skipping page 22: no interesting data
avrdude_git: avr_read_mem(): skipping page 23: no interesting data
avrdude_git: avr_read_mem(): skipping page 24: no interesting data
avrdude_git: avr_read_mem(): skipping page 25: no interesting data
avrdude_git: avr_read_mem(): skipping page 26: no interesting data
avrdude_git: avr_read_mem(): skipping page 27: no interesting data
avrdude_git: avr_read_mem(): skipping page 28: no interesting data
avrdude_git: avr_read_mem(): skipping page 29: no interesting data
avrdude_git: avr_read_mem(): skipping page 30: no interesting data
avrdude_git: avr_read_mem(): skipping page 31: no interesting data
avrdude_git: avr_read_mem(): skipping page 32: no interesting data
avrdude_git: avr_read_mem(): skipping page 33: no interesting data
avrdude_git: avr_read_mem(): skipping page 34: no interesting data
avrdude_git: avr_read_mem(): skipping page 35: no interesting data
avrdude_git: avr_read_mem(): skipping page 36: no interesting data
avrdude_git: avr_read_mem(): skipping page 37: no interesting data
avrdude_git: avr_read_mem(): skipping page 38: no interesting data
avrdude_git: avr_read_mem(): skipping page 39: no interesting data
avrdude_git: avr_read_mem(): skipping page 40: no interesting data
avrdude_git: avr_read_mem(): skipping page 41: no interesting data
avrdude_git: avr_read_mem(): skipping page 42: no interesting data
avrdude_git: avr_read_mem(): skipping page 43: no interesting data
avrdude_git: avr_read_mem(): skipping page 44: no interesting data
avrdude_git: avr_read_mem(): skipping page 45: no interesting data
avrdude_git: avr_read_mem(): skipping page 46: no interesting data
avrdude_git: avr_read_mem(): skipping page 47: no interesting data
avrdude_git: avr_read_mem(): skipping page 48: no interesting data
avrdude_git: avr_read_mem(): skipping page 49: no interesting data
avrdude_git: avr_read_mem(): skipping page 50: no interesting data
avrdude_git: avr_read_mem(): skipping page 51: no interesting data
avrdude_git: avr_read_mem(): skipping page 52: no interesting data
avrdude_git: avr_read_mem(): skipping page 53: no interesting data
avrdude_git: avr_read_mem(): skipping page 54: no interesting data
avrdude_git: avr_read_mem(): skipping page 55: no interesting data
avrdude_git: avr_read_mem(): skipping page 56: no interesting data
avrdude_git: avr_read_mem(): skipping page 57: no interesting data
avrdude_git: avr_read_mem(): skipping page 58: no interesting data
avrdude_git: avr_read_mem(): skipping page 59: no interesting data
avrdude_git: avr_read_mem(): skipping page 60: no interesting data
avrdude_git: avr_read_mem(): skipping page 61: no interesting data
avrdude_git: avr_read_mem(): skipping page 62: no interesting data
avrdude_git: avr_read_mem(): skipping page 63: no interesting data
avrdude_git: avr_read_mem(): skipping page 64: no interesting data
avrdude_git: avr_read_mem(): skipping page 65: no interesting data
avrdude_git: avr_read_mem(): skipping page 66: no interesting data
avrdude_git: avr_read_mem(): skipping page 67: no interesting data
avrdude_git: avr_read_mem(): skipping page 68: no interesting data
avrdude_git: avr_read_mem(): skipping page 69: no interesting data
avrdude_git: avr_read_mem(): skipping page 70: no interesting data
avrdude_git: avr_read_mem(): skipping page 71: no interesting data
avrdude_git: avr_read_mem(): skipping page 72: no interesting data
avrdude_git: avr_read_mem(): skipping page 73: no interesting data
avrdude_git: avr_read_mem(): skipping page 74: no interesting data
avrdude_git: avr_read_mem(): skipping page 75: no interesting data
avrdude_git: avr_read_mem(): skipping page 76: no interesting data
avrdude_git: avr_read_mem(): skipping page 77: no interesting data
avrdude_git: avr_read_mem(): skipping page 78: no interesting data
avrdude_git: avr_read_mem(): skipping page 79: no interesting data
avrdude_git: avr_read_mem(): skipping page 80: no interesting data
avrdude_git: avr_read_mem(): skipping page 81: no interesting data
avrdude_git: avr_read_mem(): skipping page 82: no interesting data
avrdude_git: avr_read_mem(): skipping page 83: no interesting data
avrdude_git: avr_read_mem(): skipping page 84: no interesting data
avrdude_git: avr_read_mem(): skipping page 85: no interesting data
avrdude_git: avr_read_mem(): skipping page 86: no interesting data
avrdude_git: avr_read_mem(): skipping page 87: no interesting data
avrdude_git: avr_read_mem(): skipping page 88: no interesting data
avrdude_git: avr_read_mem(): skipping page 89: no interesting data
avrdude_git: avr_read_mem(): skipping page 90: no interesting data
avrdude_git: avr_read_mem(): skipping page 91: no interesting data
avrdude_git: avr_read_mem(): skipping page 92: no interesting data
avrdude_git: avr_read_mem(): skipping page 93: no interesting data
avrdude_git: avr_read_mem(): skipping page 94: no interesting data
avrdude_git: avr_read_mem(): skipping page 95: no interesting data
avrdude_git: avr_read_mem(): skipping page 96: no interesting data
avrdude_git: avr_read_mem(): skipping page 97: no interesting data
avrdude_git: avr_read_mem(): skipping page 98: no interesting data
avrdude_git: avr_read_mem(): skipping page 99: no interesting data
avrdude_git: avr_read_mem(): skipping page 100: no interesting data
avrdude_git: avr_read_mem(): skipping page 101: no interesting data
avrdude_git: avr_read_mem(): skipping page 102: no interesting data
avrdude_git: avr_read_mem(): skipping page 103: no interesting data
avrdude_git: avr_read_mem(): skipping page 104: no interesting data
avrdude_git: avr_read_mem(): skipping page 105: no interesting data
avrdude_git: avr_read_mem(): skipping page 106: no interesting data
avrdude_git: avr_read_mem(): skipping page 107: no interesting data
avrdude_git: avr_read_mem(): skipping page 108: no interesting data
avrdude_git: avr_read_mem(): skipping page 109: no interesting data
avrdude_git: avr_read_mem(): skipping page 110: no interesting data
avrdude_git: avr_read_mem(): skipping page 111: no interesting data
avrdude_git: avr_read_mem(): skipping page 112: no interesting data
avrdude_git: avr_read_mem(): skipping page 113: no interesting data
avrdude_git: avr_read_mem(): skipping page 114: no interesting data
avrdude_git: avr_read_mem(): skipping page 115: no interesting data
avrdude_git: avr_read_mem(): skipping page 116: no interesting data
avrdude_git: avr_read_mem(): skipping page 117: no interesting data
avrdude_git: avr_read_mem(): skipping page 118: no interesting data
avrdude_git: avr_read_mem(): skipping page 119: no interesting data
avrdude_git: avr_read_mem(): skipping page 120: no interesting data
avrdude_git: avr_read_mem(): skipping page 121: no interesting data
avrdude_git: avr_read_mem(): skipping page 122: no interesting data
avrdude_git: avr_read_mem(): skipping page 123: no interesting data
avrdude_git: avr_read_mem(): skipping page 124: no interesting data
avrdude_git: avr_read_mem(): skipping page 125: no interesting data
avrdude_git: avr_read_mem(): skipping page 126: no interesting data
avrdude_git: avr_read_mem(): skipping page 127: no interesting data
avrdude_git: avr_read_mem(): skipping page 128: no interesting data
avrdude_git: avr_read_mem(): skipping page 129: no interesting data
avrdude_git: avr_read_mem(): skipping page 130: no interesting data
avrdude_git: avr_read_mem(): skipping page 131: no interesting data
avrdude_git: avr_read_mem(): skipping page 132: no interesting data
avrdude_git: avr_read_mem(): skipping page 133: no interesting data
avrdude_git: avr_read_mem(): skipping page 134: no interesting data
avrdude_git: avr_read_mem(): skipping page 135: no interesting data
avrdude_git: avr_read_mem(): skipping page 136: no interesting data
avrdude_git: avr_read_mem(): skipping page 137: no interesting data
avrdude_git: avr_read_mem(): skipping page 138: no interesting data
avrdude_git: avr_read_mem(): skipping page 139: no interesting data
avrdude_git: avr_read_mem(): skipping page 140: no interesting data
avrdude_git: avr_read_mem(): skipping page 141: no interesting data
avrdude_git: avr_read_mem(): skipping page 142: no interesting data
avrdude_git: avr_read_mem(): skipping page 143: no interesting data
avrdude_git: avr_read_mem(): skipping page 144: no interesting data
avrdude_git: avr_read_mem(): skipping page 145: no interesting data
avrdude_git: avr_read_mem(): skipping page 146: no interesting data
avrdude_git: avr_read_mem(): skipping page 147: no interesting data
avrdude_git: avr_read_mem(): skipping page 148: no interesting data
avrdude_git: avr_read_mem(): skipping page 149: no interesting data
avrdude_git: avr_read_mem(): skipping page 150: no interesting data
avrdude_git: avr_read_mem(): skipping page 151: no interesting data
avrdude_git: avr_read_mem(): skipping page 152: no interesting data
avrdude_git: avr_read_mem(): skipping page 153: no interesting data
avrdude_git: avr_read_mem(): skipping page 154: no interesting data
avrdude_git: avr_read_mem(): skipping page 155: no interesting data
avrdude_git: avr_read_mem(): skipping page 156: no interesting data
avrdude_git: avr_read_mem(): skipping page 157: no interesting data
avrdude_git: avr_read_mem(): skipping page 158: no interesting data
avrdude_git: avr_read_mem(): skipping page 159: no interesting data
avrdude_git: avr_read_mem(): skipping page 160: no interesting data
avrdude_git: avr_read_mem(): skipping page 161: no interesting data
avrdude_git: avr_read_mem(): skipping page 162: no interesting data
avrdude_git: avr_read_mem(): skipping page 163: no interesting data
avrdude_git: avr_read_mem(): skipping page 164: no interesting data
avrdude_git: avr_read_mem(): skipping page 165: no interesting data
avrdude_git: avr_read_mem(): skipping page 166: no interesting data
avrdude_git: avr_read_mem(): skipping page 167: no interesting data
avrdude_git: avr_read_mem(): skipping page 168: no interesting data
avrdude_git: avr_read_mem(): skipping page 169: no interesting data
avrdude_git: avr_read_mem(): skipping page 170: no interesting data
avrdude_git: avr_read_mem(): skipping page 171: no interesting data
avrdude_git: avr_read_mem(): skipping page 172: no interesting data
avrdude_git: avr_read_mem(): skipping page 173: no interesting data
avrdude_git: avr_read_mem(): skipping page 174: no interesting data
avrdude_git: avr_read_mem(): skipping page 175: no interesting data
avrdude_git: avr_read_mem(): skipping page 176: no interesting data
avrdude_git: avr_read_mem(): skipping page 177: no interesting data
avrdude_git: avr_read_mem(): skipping page 178: no interesting data
avrdude_git: avr_read_mem(): skipping page 179: no interesting data
avrdude_git: avr_read_mem(): skipping page 180: no interesting data
avrdude_git: avr_read_mem(): skipping page 181: no interesting data
avrdude_git: avr_read_mem(): skipping page 182: no interesting data
avrdude_git: avr_read_mem(): skipping page 183: no interesting data
avrdude_git: avr_read_mem(): skipping page 184: no interesting data
avrdude_git: avr_read_mem(): skipping page 185: no interesting data
avrdude_git: avr_read_mem(): skipping page 186: no interesting data
avrdude_git: avr_read_mem(): skipping page 187: no interesting data
avrdude_git: avr_read_mem(): skipping page 188: no interesting data
avrdude_git: avr_read_mem(): skipping page 189: no interesting data
avrdude_git: avr_read_mem(): skipping page 190: no interesting data
avrdude_git: avr_read_mem(): skipping page 191: no interesting data
avrdude_git: avr_read_mem(): skipping page 192: no interesting data
avrdude_git: avr_read_mem(): skipping page 193: no interesting data
avrdude_git: avr_read_mem(): skipping page 194: no interesting data
avrdude_git: avr_read_mem(): skipping page 195: no interesting data
avrdude_git: avr_read_mem(): skipping page 196: no interesting data
avrdude_git: avr_read_mem(): skipping page 197: no interesting data
avrdude_git: avr_read_mem(): skipping page 198: no interesting data
avrdude_git: avr_read_mem(): skipping page 199: no interesting data
avrdude_git: avr_read_mem(): skipping page 200: no interesting data
avrdude_git: avr_read_mem(): skipping page 201: no interesting data
avrdude_git: avr_read_mem(): skipping page 202: no interesting data
avrdude_git: avr_read_mem(): skipping page 203: no interesting data
avrdude_git: avr_read_mem(): skipping page 204: no interesting data
avrdude_git: avr_read_mem(): skipping page 205: no interesting data
avrdude_git: avr_read_mem(): skipping page 206: no interesting data
avrdude_git: avr_read_mem(): skipping page 207: no interesting data
avrdude_git: avr_read_mem(): skipping page 208: no interesting data
avrdude_git: avr_read_mem(): skipping page 209: no interesting data
avrdude_git: avr_read_mem(): skipping page 210: no interesting data
avrdude_git: avr_read_mem(): skipping page 211: no interesting data
avrdude_git: avr_read_mem(): skipping page 212: no interesting data
avrdude_git: avr_read_mem(): skipping page 213: no interesting data
avrdude_git: avr_read_mem(): skipping page 214: no interesting data
avrdude_git: avr_read_mem(): skipping page 215: no interesting data
avrdude_git: avr_read_mem(): skipping page 216: no interesting data
avrdude_git: avr_read_mem(): skipping page 217: no interesting data
avrdude_git: avr_read_mem(): skipping page 218: no interesting data
avrdude_git: avr_read_mem(): skipping page 219: no interesting data
avrdude_git: avr_read_mem(): skipping page 220: no interesting data
avrdude_git: avr_read_mem(): skipping page 221: no interesting data
avrdude_git: avr_read_mem(): skipping page 222: no interesting data
avrdude_git: avr_read_mem(): skipping page 223: no interesting data
avrdude_git: avr_read_mem(): skipping page 224: no interesting data
avrdude_git: avr_read_mem(): skipping page 225: no interesting data
avrdude_git: avr_read_mem(): skipping page 226: no interesting data
avrdude_git: avr_read_mem(): skipping page 227: no interesting data
avrdude_git: avr_read_mem(): skipping page 228: no interesting data
avrdude_git: avr_read_mem(): skipping page 229: no interesting data
avrdude_git: avr_read_mem(): skipping page 230: no interesting data
avrdude_git: avr_read_mem(): skipping page 231: no interesting data
avrdude_git: avr_read_mem(): skipping page 232: no interesting data
avrdude_git: avr_read_mem(): skipping page 233: no interesting data
avrdude_git: avr_read_mem(): skipping page 234: no interesting data
avrdude_git: avr_read_mem(): skipping page 235: no interesting data
avrdude_git: avr_read_mem(): skipping page 236: no interesting data
avrdude_git: avr_read_mem(): skipping page 237: no interesting data
avrdude_git: avr_read_mem(): skipping page 238: no interesting data
avrdude_git: avr_read_mem(): skipping page 239: no interesting data
avrdude_git: avr_read_mem(): skipping page 240: no interesting data
avrdude_git: avr_read_mem(): skipping page 241: no interesting data
avrdude_git: avr_read_mem(): skipping page 242: no interesting data
avrdude_git: avr_read_mem(): skipping page 243: no interesting data
avrdude_git: avr_read_mem(): skipping page 244: no interesting data
avrdude_git: avr_read_mem(): skipping page 245: no interesting data
avrdude_git: avr_read_mem(): skipping page 246: no interesting data
avrdude_git: avr_read_mem(): skipping page 247: no interesting data
avrdude_git: avr_read_mem(): skipping page 248: no interesting data
avrdude_git: avr_read_mem(): skipping page 249: no interesting data
avrdude_git: avr_read_mem(): skipping page 250: no interesting data
avrdude_git: avr_read_mem(): skipping page 251: no interesting data
avrdude_git: avr_read_mem(): skipping page 252: no interesting data
avrdude_git: avr_read_mem(): skipping page 253: no interesting data
avrdude_git: avr_read_mem(): skipping page 254: no interesting data
avrdude_git: avr_read_mem(): skipping page 255: no interesting data
avrdude_git: verifying ...
avrdude_git: 526 bytes of flash verified
avrdude_git: sending leave progmode command:
avrdude_git: jtag3_edbg_send(): sending 3 bytes
avrdude_git: jtag3_edbg_recv():
avrdude_git: jtag3_recv(): Got message seqno 21 (command_sequence == 21)

Raw message:
12  80  00
[AVR] OK
avrdude_git: jtag3_close()
avrdude_git: sending AVR sign-off command:
avrdude_git: jtag3_edbg_send(): sending 3 bytes
avrdude_git: jtag3_edbg_recv():
avrdude_git: jtag3_recv(): Got message seqno 22 (command_sequence == 22)

Raw message:
12  80  00
[AVR] OK
avrdude_git: sending sign-off command:
avrdude_git: jtag3_edbg_send(): sending 4 bytes
avrdude_git: jtag3_edbg_recv():
avrdude_git: jtag3_recv(): Got message seqno 23 (command_sequence == 23)

Raw message:
01  80  00
[general] OK

avrdude_git: jtag3_edbg_signoff()

avrdude_git done.  Thank you.

@stefanrueger
Copy link
Collaborator

@mcuee Do we have more intell on this to either confirm this issue or, failing that, close it?

@avrfreak
Copy link

avrfreak commented Jan 1, 2024

I just tested it again. Not working with a snap debugger. Here is the log file.

logfile.txt

@avrfreak
Copy link

avrfreak commented Jan 1, 2024

here is the exact same setup using avrdude v7.2. It is working.
logfile.txt

@stefanrueger
Copy link
Collaborator

@avrfreak We have no doubt that you experience this issue. The problem we have is that @mcuee who has access to a lot of platforms has been unable to reproduce the issue, which is kind of important for us to investigate further.

The other peculiarity is that some of your runs appear to have worked earlier on. Begs the question what was the difference in the setup/OS/libraries/machine comms on your side between when those binaries worked on your machine at the time and when they did not work just now. Knowing the answer to that might help us reproduce the issue and investigate further.

@avrfreak
Copy link

avrfreak commented Jan 2, 2024

I will try it on other computers. I have several. I will let you know.
Thank you

@avrfreak
Copy link

avrfreak commented Jan 2, 2024

It appears there are two drivers for the snap programmer/debugger.
Maybe this is the reason why avrdude does not communicate with the programmer correctly.
I attached some pictures.
Snap1
Snap2

If anyone else is using the snap debugger with avrdude can you please let me know what drivers it is using?
Thanks

@avrfreak
Copy link

avrfreak commented Jan 2, 2024

I tried it on another PC. It looks like the driver is different.
It appears to be working with an avr16EA28.

Snap1(laptop)

Snap2(laptop)

@mcuee
Copy link
Collaborator Author

mcuee commented Jan 2, 2024

@mcuee Do we have more intell on this to either confirm this issue or, failing that, close it?

I can not produce the issue myself.

I can only think this is an issue with the HID interface of the SNAP. It could be an issue with HIDAPI, or a specific issue with @avrfreak's system, or it could be the way how avrdude is using hidapi.

@mcuee
Copy link
Collaborator Author

mcuee commented Jan 2, 2024

@Youw

The issue is quite strange to me. Just wondering if you have some idea to further debug this issue.

@avrfreak
Copy link

avrfreak commented Jan 2, 2024

I think something changed in avrdude because V7.2 always works with the snap programmer, no matter what driver version is installed on my computer. It's just this version that does not work with the snap programmer:
Version 7.2-20231218 (67792ca)

@stefanrueger
Copy link
Collaborator

As long as we don't have a reproducible way to observe the described issue we are a bit stuck. @avrfreak You can help by isolate the conditions when the issue occurs for you and when it does not.

@mcuee
Copy link
Collaborator Author

mcuee commented Jan 2, 2024

Last time it was reported that Microchip PICKit 2 (USB HID) may have some issues with some Windows applications. But then different host application may work around the issue.

I am not so sure it is a similar issue here or not -- some Windows applications may interfere with Microchip SNAP or PICKit 4 (using USB HID interface for avrdude).

@mcuee
Copy link
Collaborator Author

mcuee commented Jan 7, 2024

Here are two Windows 32 bit binaries created by the cross compiler.

root@734521f95d89:/workdir/test# cat test.c
#include <stdio.h>

int main(int argc, char * argv [])
 {
   size_t n;
   printf("%%zi format %s\n", 1 == sscanf("42", "%zi", &n) && n == 42? "OK": "fails");
}

root@734521f95d89:/workdir/test# i686-w64-mingw32-gcc -o test.exe test.c

root@734521f95d89:/workdir/test# i686-w64-mingw32-gcc -std=c99 -o test_c99.exe test.c

test_c99.zip

In my Windows 11 system, both work fine.

PS C:\work\avr\avrdude_test\avrdude_bin\avrtest> .\test_c99.exe
%zi format OK
PS C:\work\avr\avrdude_test\avrdude_bin\avrtest> .\test.exe
%zi format OK

@avrfreak

Please help to carry out the test under your Windows 7 machine to see if the output from test_c99.exe is the same as test.exe or not. Thanks.

@mcuee
Copy link
Collaborator Author

mcuee commented Jan 7, 2024

In the meantime I have created a PR that solves the :a problem when AVRDUDE is dynamically linked against a pre-C99 run-time library. That deals with one symptom of the problem but doesn't remove the problem. Compiling with C99 would be way better

It could also be the mingw32 cross compiler does support C99 but we need to explicitly tell the compiler to use C99.

Maybe you want to play with the Arduino crossbuild Docker container to see what is the version of compiler used.

@stefanrueger

Since I am now running the container, here are the versions of the cross-compiler used for Linux. Just FYI. They are pretty old but it is probbably because of the desire to be compatible with older version of Linux.

32bit x86 Linux

root@734521f95d89:~# /opt/i686-ubuntu16.04-linux-gnu/bin/i686-ubuntu16.04-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/opt/i686-ubuntu16.04-linux-gnu/bin/i686-ubuntu16.04-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/opt/i686-ubuntu16.04-linux-gnu/bin/../libexec/gcc/i686-ubuntu16.04-linux-gnu/8.3.0/lto-wrapper
Target: i686-ubuntu16.04-linux-gnu
Configured with: /home/arduino/ct-ng-toolchains/.build/i686-ubuntu16.04-linux-gnu/src/gcc/configure --build=x86_64-build_pc-linux-gnu --host=x86_64-build_pc-linux-gnu --target=i686-ubuntu16.04-linux-gnu --prefix=/home/arduino/x-tools/i686-ubuntu16.04-linux-gnu --with-sysroot=/home/arduino/x-tools/i686-ubuntu16.04-linux-gnu/i686-ubuntu16.04-linux-gnu/sysroot --enable-languages=c,c++ --with-arch=i686 --with-pkgversion='crosstool-NG 1.24.0' --enable-__cxa_atexit --disable-libmudflap --disable-libgomp --disable-libssp --disable-libquadmath --disable-libquadmath-support --disable-libsanitizer --enable-libmpx --with-gmp=/home/arduino/ct-ng-toolchains/.build/i686-ubuntu16.04-linux-gnu/buildtools --with-mpfr=/home/arduino/ct-ng-toolchains/.build/i686-ubuntu16.04-linux-gnu/buildtools --with-mpc=/home/arduino/ct-ng-toolchains/.build/i686-ubuntu16.04-linux-gnu/buildtools --with-isl=/home/arduino/ct-ng-toolchains/.build/i686-ubuntu16.04-linux-gnu/buildtools --enable-lto --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --enable-threads=posix --enable-target-optspace --disable-plugin --disable-nls --disable-multilib --with-local-prefix=/home/arduino/x-tools/i686-ubuntu16.04-linux-gnu/i686-ubuntu16.04-linux-gnu/sysroot --enable-long-long
Thread model: posix
gcc version 8.3.0 (crosstool-NG 1.24.0)

64bit x86_64 Linux

root@734521f95d89:~# /opt/x86_64-ubuntu16.04-linux-gnu-gcc/bin/x86_64-ubuntu16.04-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/opt/x86_64-ubuntu16.04-linux-gnu-gcc/bin/x86_64-ubuntu16.04-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/opt/x86_64-ubuntu16.04-linux-gnu-gcc/bin/../libexec/gcc/x86_64-ubuntu16.04-linux-gnu/7.2.0/lto-wrapper
Target: x86_64-ubuntu16.04-linux-gnu
Configured with: /ssd/x86-64-gcc-toolchain/.build/x86_64-ubuntu16.04-linux-gnu/src/gcc/configure --build=x86_64-build_pc-linux-gnu --host=x86_64-build_pc-linux-gnu --target=x86_64-ubuntu16.04-linux-gnu --prefix=/home/martino/x-tools/x86_64-ubuntu16.04-linux-gnu --with-sysroot=/home/martino/x-tools/x86_64-ubuntu16.04-linux-gnu/x86_64-ubuntu16.04-linux-gnu/sysroot --enable-languages=c,c++ --with-pkgversion='crosstool-NG crosstool-ng-1.23.0-242-g521d6c17' --enable-__cxa_atexit --disable-libmudflap --disable-libgomp --disable-libssp --disable-libquadmath --disable-libquadmath-support --disable-libsanitizer --enable-libmpx --with-gmp=/ssd/x86-64-gcc-toolchain/.build/x86_64-ubuntu16.04-linux-gnu/buildtools --with-mpfr=/ssd/x86-64-gcc-toolchain/.build/x86_64-ubuntu16.04-linux-gnu/buildtools --with-mpc=/ssd/x86-64-gcc-toolchain/.build/x86_64-ubuntu16.04-linux-gnu/buildtools --with-isl=/ssd/x86-64-gcc-toolchain/.build/x86_64-ubuntu16.04-linux-gnu/buildtools --enable-lto --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --enable-threads=posix --enable-target-optspace --disable-plugin --disable-nls --disable-multilib --with-local-prefix=/home/martino/x-tools/x86_64-ubuntu16.04-linux-gnu/x86_64-ubuntu16.04-linux-gnu/sysroot --enable-long-long
Thread model: posix
gcc version 7.2.0 (crosstool-NG crosstool-ng-1.23.0-242-g521d6c17)

ARM64 Linux

root@734521f95d89:~# /opt/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/opt/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu/bin/aarch64-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/opt/gcc-arm-8.3-2019.03-x86_64-aarch64-linux-gnu/bin/../libexec/gcc/aarch64-linux-gnu/8.3.0/lto-wrapper
Target: aarch64-linux-gnu
Configured with: /tmp/dgboter/bbs/rhev-vm8--rhe6x86_64/buildbot/rhe6x86_64--aarch64-linux-gnu/build/src/gcc/configure --target=aarch64-linux-gnu --prefix= --with-sysroot=/aarch64-linux-gnu/libc --with-build-sysroot=/tmp/dgboter/bbs/rhev-vm8--rhe6x86_64/buildbot/rhe6x86_64--aarch64-linux-gnu/build/build-aarch64-linux-gnu/install//aarch64-linux-gnu/libc --with-bugurl=https://bugs.linaro.org/ --enable-gnu-indirect-function --enable-shared --disable-libssp --disable-libmudflap --enable-checking=release --enable-languages=c,c++,fortran --with-gmp=/tmp/dgboter/bbs/rhev-vm8--rhe6x86_64/buildbot/rhe6x86_64--aarch64-linux-gnu/build/build-aarch64-linux-gnu/host-tools --with-mpfr=/tmp/dgboter/bbs/rhev-vm8--rhe6x86_64/buildbot/rhe6x86_64--aarch64-linux-gnu/build/build-aarch64-linux-gnu/host-tools --with-mpc=/tmp/dgboter/bbs/rhev-vm8--rhe6x86_64/buildbot/rhe6x86_64--aarch64-linux-gnu/build/build-aarch64-linux-gnu/host-tools --with-isl=/tmp/dgboter/bbs/rhev-vm8--rhe6x86_64/buildbot/rhe6x86_64--aarch64-linux-gnu/build/build-aarch64-linux-gnu/host-tools --enable-fix-cortex-a53-843419 --with-pkgversion='GNU Toolchain for the A-profile Architecture 8.3-2019.03 (arm-rel-8.36)'
Thread model: posix
gcc version 8.3.0 (GNU Toolchain for the A-profile Architecture 8.3-2019.03 (arm-rel-8.36))

ARM32 Linux

root@734521f95d89:~# /opt/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -v
Using built-in specs.
COLLECT_GCC=/opt/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc
COLLECT_LTO_WRAPPER=/opt/gcc-arm-8.3-2019.03-x86_64-arm-linux-gnueabihf/bin/../libexec/gcc/arm-linux-gnueabihf/8.3.0/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: /tmp/dgboter/bbs/rhev-vm8--rhe6x86_64/buildbot/rhe6x86_64--arm-linux-gnueabihf/build/src/gcc/configure --target=arm-linux-gnueabihf --prefix= --with-sysroot=/arm-linux-gnueabihf/libc --with-build-sysroot=/tmp/dgboter/bbs/rhev-vm8--rhe6x86_64/buildbot/rhe6x86_64--arm-linux-gnueabihf/build/build-arm-linux-gnueabihf/install//arm-linux-gnueabihf/libc --with-bugurl=https://bugs.linaro.org/ --enable-gnu-indirect-function --enable-shared --disable-libssp --disable-libmudflap --enable-checking=release --enable-languages=c,c++,fortran --with-gmp=/tmp/dgboter/bbs/rhev-vm8--rhe6x86_64/buildbot/rhe6x86_64--arm-linux-gnueabihf/build/build-arm-linux-gnueabihf/host-tools --with-mpfr=/tmp/dgboter/bbs/rhev-vm8--rhe6x86_64/buildbot/rhe6x86_64--arm-linux-gnueabihf/build/build-arm-linux-gnueabihf/host-tools --with-mpc=/tmp/dgboter/bbs/rhev-vm8--rhe6x86_64/buildbot/rhe6x86_64--arm-linux-gnueabihf/build/build-arm-linux-gnueabihf/host-tools --with-isl=/tmp/dgboter/bbs/rhev-vm8--rhe6x86_64/buildbot/rhe6x86_64--arm-linux-gnueabihf/build/build-arm-linux-gnueabihf/host-tools --with-arch=armv7-a --with-fpu=neon --with-float=hard --with-arch=armv7-a --with-pkgversion='GNU Toolchain for the A-profile Architecture 8.3-2019.03 (arm-rel-8.36)'
Thread model: posix
gcc version 8.3.0 (GNU Toolchain for the A-profile Architecture 8.3-2019.03 (arm-rel-8.36))

@avrfreak
Copy link

avrfreak commented Jan 7, 2024

@avrfreak

Please help to carry out the test under your Windows 7 machine to see if the output from test_c99.exe is the same as test.exe or not. Thanks.

G:\Jan7>test_c99
%zi format fails

G:\Jan7>test
%zi format fails

@mcuee
Copy link
Collaborator Author

mcuee commented Jan 7, 2024

@avrfreak
Please help to carry out the test under your Windows 7 machine to see if the output from test_c99.exe is the same as test.exe or not. Thanks.

G:\Jan7>test_c99
%zi format fails

G:\Jan7>test
%zi format fails

Thanks. I think that means the cross-compiler sucks and adding -std=c99 does not help. Or maybe the Windows 7 C runtime can not be helped in this case.

@stefanrueger
Just wondering if you have some other ideas to sort this out. Thanks.

@umbynos
Just wondering if the Ardino Crossbuild container can use a better 32bit Windows cross-compiler and not the default mingw64 one from Ubuntu. Thanks.

@stefanrueger
Copy link
Collaborator

adding -std=c99 does not help

Not necessarily; it could well be that the problem is the specific run-time library on @avrfreak's specific Windows 7 system. If that's broken, there is nothing that AVRDUDE can do. Mind you, we do not have a single independent other report of failing :a recognition under Windows 7.

@mcuee
Copy link
Collaborator Author

mcuee commented Jan 8, 2024

@avrfreak

Just want to make sure that MSYS2 mingw and MSVC version do not have the failing :a issue under your Windows 7 system, and only the Arduino version has the issue, please help to carry out the following test again.

Use the following command with -c dry-run without attaching any programmers or any AVR chip and post the outputs. Please do not use the log file. Just copy past the output.

avrdude -C avrdude.conf -c dryrun -p avr16EA28 -v -U flash:w:flash.hex:a

Three binaries to use: same as official avrdude git main.
https://github.com/mcuee/avrdude/releases/tag/snapshot_2024-01-06
https://github.com/mcuee/avrdude/releases/download/snapshot_2024-01-06/avrdude-mingw-x86_64.zip
https://github.com/mcuee/avrdude/releases/download/snapshot_2024-01-06/avrdude-msvc-x64.zip
https://github.com/mcuee/avrdude/releases/download/snapshot_2024-01-06/avrdude_main_Windows_32bit.tar.gz

@avrfreak
Copy link

avrfreak commented Jan 8, 2024

avrdude_main_Windows_32bit.txt
avrdude-mingw-x86_64.txt
avrdude-msvc-x64.txt

@mcuee
Copy link
Collaborator Author

mcuee commented Jan 8, 2024

avrdude_main_Windows_32bit.txt avrdude-mingw-x86_64.txt avrdude-msvc-x64.txt

@avrfreak

Thanks a lot for the quick updates. Now it is very clear that both MSVC build and MSYS2 mingw build are okay but the Arduino avrdude-packing build is not okay.

C:\avrdude_main_Windows_32bit>avrdude -C avrdude.conf
-c dryrun -p avr16EA28 -v -U flash:w:flash.hex:a

avrdude: Version 7.2-20240104 (03d786e)
         Copyright the AVRDUDE authors;
         see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

         System wide configuration file is
C:\avrdude_main_Windows_32bit\avrdude.conf

         Using programmer      : dryrun
avrdude update_dryrun() warning: cannot determine file format for flash.hex, spe
cify explicitly
         AVR Part              : AVR16EA28
         Programming modes     : UPDI, SPM
         Programmer Type       : Dryrun
         Description           : Emulates programming without a programmer
         Dryrun programmer for avr16EA28
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e9437 (probably avr16ea28)
avrdude: Note: flash memory has been specified, an erase cycle will be performed
.
         To disable this feature, specify the -D option.
avrdude: erasing chip

avrdude: processing -U flash:w:flash.hex:a
avrdude fileio_segments_normalise() error: cannot determine file format for flas
h.hex, specify explicitly
avrdude do_op() error: read from file flash.hex failed

avrdude done.  Thank you.

@mcuee
Copy link
Collaborator Author

mcuee commented Jan 8, 2024

Mind you, we do not have a single independent other report of failing :a recognition under Windows 7.

The Arduino avrdude-packing version has never been in the picture for avrdude project until recently. They are mainly used by the Arduino core users and :a is not used by Arduino.

@stefanrueger
Copy link
Collaborator

The Arduino avrdude-packing version has never been in the picture for avrdude project until recently.

So, we are responsible for fixing it (having made it part of the avrdude project).

@stefanrueger
Copy link
Collaborator

:a is not used by Arduino

That is only a symptom. We don't know what else goes wrong by not linking to a C99-conforming standard C library. We should fix the root of the problem (not only the symptom)

@mcuee
Copy link
Collaborator Author

mcuee commented Jan 8, 2024

The Arduino avrdude-packing version has never been in the picture for avrdude project until recently.

So, we are responsible for fixing it (having made it part of the avrdude project).

Fair enough. Hopefully PR #1608 will fix the issue or at least point out the direction.

Right now the following github action will only run after merging of PR #1608. Let's see if it fixes the issue (hex file type auto-recognition) or not.
https://github.com/avrdudes/avrdude/blob/main/.github/workflows/build.yml

@mcuee
Copy link
Collaborator Author

mcuee commented Jan 8, 2024

It doesn't work with the snap programmer. logfile.txt
This one I am using works with the snap programmer. Even earlier version 7.0 is working with my snap programmer. logfile.txt

@avrfreak

Good. So this is not a regression as the avrude 7.2 MSYS2 mingw build also has the same issue.

avrdude official Windows binaries for 7.0/7.1/7.2 all use MSVC build. https://github.com/avrdudes/avrdude/releases/tag/v7.2 https://github.com/avrdudes/avrdude/releases/tag/v7.1 https://github.com/avrdudes/avrdude/releases/tag/v7.0

@stefanrueger

Just wondering if you want to keep this issue (avrdude communication problem with AVR chip using SNAP) open or not. It is a bug of avrdude MSYS2 MinGW build under Windows 7, even though it is not a regression.

On the other hand, it is probably difficult to debug this issue as it might be related to MSYS2 mingw compiler.

@umbynos
Copy link
Contributor

umbynos commented Jan 8, 2024

Hello @mcuee

Arduino avrdude-packing build is not okay.

Is there something we can do?

Just wondering if the Ardino Crossbuild container can use a better 32bit Windows cross-compiler and not the default mingw64 one from Ubuntu. Thanks.

Do you have some suggestion?

They are pretty old but it is probably because of the desire to be compatible with older version of Linux.

That is correct

@stefanrueger
Copy link
Collaborator

stefanrueger commented Jan 8, 2024

@mcuee I predict PR #1608 will fix the symptom (:a processing) but not the issue (linked libraries are not C99). The latter should be apparent by a warning

pmsg_warning("Linked C library does not conform to C99; %s may not work as expected\n", progname);

The issue is fixed when the warning disappears

@stefanrueger
Copy link
Collaborator

@umbynos I understand that the Arduino build process either does not compile with at least C99 compatibility or does not link to libraries that are C99-compliant. This has caused problems and may harbour other (so far unknown) problems, because the AVRDUDE project has been relying on availability of C99 (which is 23 years old)

Can the Arduino-packaging be made to compile with C99 and link to C99 standard C libraries?

@mcuee
Copy link
Collaborator Author

mcuee commented Jan 8, 2024

Hello @mcuee

Arduino avrdude-packing build is not okay.

Is there something we can do?

Just wondering if the Ardino Crossbuild container can use a better 32bit Windows cross-compiler and not the default mingw64 one from Ubuntu. Thanks.

Do you have some suggestion?

Probably to upgrade to a new version, like the one from Debian Stable.
https://packages.debian.org/search?keywords=mingw-w64

Or better something similar to Fedora 38/39.
https://packages.fedoraproject.org/pkgs/mingw-gcc/mingw32-gcc/

@stefanrueger
Copy link
Collaborator

keep this issue (avrdude communication problem with AVR chip using SNAP)

I'd rather keep #1594 closed. When we receive new issue with a crisp error description that is reproducible by one of the maintainers then we can engage with it again.

@mcuee
Copy link
Collaborator Author

mcuee commented Jan 8, 2024

I predict PR #1608 will fix the symptom (:a processing) but not the issue (linked libraries are not C99). The latter should be apparent by a warning

pmsg_warning("Linked C library does not conform to C99; %s may not work as expected\n", progname);

The issue is fixed when the warning disappears

@avrfreak

Please help to test the dist version (Arduino avrdude-packing version) of git main with the following two commands under your Windows 7 machine to confirm that :a issuse is fixed in terms of symptom but not the unlerlying issue (the compiler or the Windows 7 C runtime).

avrdude -C avrdude.conf -c dryrun -p avr16EA28 -vv -U flash:w:flash.hex:a (no programmer needed)
avrdude -C avrdude.conf -c snap_updi -p avr16ea28 -vv -U flash:w:flash.hex:a -U eeprom:w:eep.hex:a

Binary to download: download dist.zip and then extract the Windows 32bit binary
https://github.com/avrdudes/avrdude/actions/runs/7445645003

@mcuee
Copy link
Collaborator Author

mcuee commented Jan 8, 2024

keep this issue (avrdude communication problem with AVR chip using SNAP)

I'd rather keep #1594 closed. When we receive new issue with a crisp error description that is reproducible by one of the maintainers then we can engage with it again.

Okay. The only problem is that it is only under Windows 7 and I am not so sure if any of the maintainers have access to Windows 7, which is no longer supported by Microsoft since 14 Jan 2020 (4 years ago).

@avrfreak
Copy link

avrfreak commented Jan 8, 2024

log1.txt
log2.txt

@mcuee
Copy link
Collaborator Author

mcuee commented Jan 8, 2024

log1.txt

The first log file proves that @stefanrueger is correct. The compiler or C runtime is the issue for your Windows 7 machine. PR #1608 indeed fixed the symptom.

C:\dist>avrdude -C avrdude.conf -c dryrun -p avr16EA28
 -vv -U flash:w:flash.hex:a

avrdude main() warning: Linked C library does not conform to C99; avrdude may not work as expected

avrdude: Version 7.2-20240108 (5b3c313)
         Copyright the AVRDUDE authors;
         see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

         System wide configuration file is 
C:\dist\avrdude.conf

         Using programmer      : dryrun
avrdude: input file flash.hex auto detected as Intel Hex
         AVR Part              : AVR16EA28
         Programming modes     : UPDI, SPM

         Memory            Size  Pg size    Offset
         -----------------------------------------
         eeprom             512        8    0x1400
         flash            16384       64  0x800000
         fuses               16        1    0x1050
         fuse0/wdtcfg         1        1    0x1050
         fuse1/bodcfg         1        1    0x1051
         fuse2/osccfg         1        1    0x1052
         fuse5/syscfg0        1        1    0x1055
         fuse6/syscfg1        1        1    0x1056
         fuse7/codesize       1        1    0x1057
         fuse8/bootsize       1        1    0x1058
         lock                 4        1    0x1040
         prodsig/sigrow     128      128    0x1100
         signature            3        1    0x1100
         tempsense            4        1    0x1104
         sernum              16        1    0x1110
         userrow/usersig     64       64    0x1080
         io                4160        1         0
         sram              2048        1    0x7800
         sib                 32        1         0

         Variants   Package  F max   T range         V range
         ----------------------------------------------------------
         AVR16EA28  SOIC28   20 MHz  [-40 C, 125 C]  [1.8 V, 5.5 V]

         Programmer Type       : Dryrun
         Description           : Emulates programming without a programmer
         Dryrun programmer for avr16EA28
avrdude: AVR device initialized and ready to accept instructions
Reading | ################################################## | 100% 0.00 s
avrdude: device signature = 0x1e9437 (probably avr16ea28)
avrdude: Note: flash memory has been specified, an erase cycle will be performed
.
         To disable this feature, specify the -D option.
avrdude: erasing chip

avrdude: processing -U flash:w:flash.hex:i
avrdude: reading input file flash.hex for flash
         with 1024 bytes in 1 section within [0, 0x3ff]
         using 16 pages and 0 pad bytes
avrdude: writing 1024 bytes flash ...
Writing | ################################################## | 100% 0.00 s
avrdude: 1024 bytes of flash written
avrdude: verifying flash memory against flash.hex
avrdude: reading on-chip flash data ...
Reading | ################################################## | 100% 0.00 s
avrdude: verifying ...
avrdude: 1024 bytes of flash verified

avrdude done.  Thank you.

@mcuee
Copy link
Collaborator Author

mcuee commented Jan 8, 2024

log2.txt

@avrfreak

Hmm, this still proves that @stefanrueger is right with regard to the C library, but then another issue pops up. Can you try with -B 4.0 (same as your original command) or -B 125kHz as per the avrdude prompt? Thanks.

C:\dist>avrdude -C avrdude.conf -c snap_updi -p avr16ea28 -vv -U flash:w:flash.hex:a -U eeprom:w:eep.hex:a

avrdude main() warning: Linked C library does not conform to C99; avrdude may not work as expected

avrdude: Version 7.2-20240108 (5b3c313)
         Copyright the AVRDUDE authors;
         see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

         System wide configuration file is C:\Users\user\Desktop\Jan7-2\dist\avr
dude.conf

         Using port            : usb
         Using programmer      : snap_updi
avrdude: jtag3_open_updi()
avrdude: HV UPDI support: 1
avrdude: found CMSIS-DAP compliant device, using EDBG protocol
avrdude: jtag3_edbg_prepare(): connection status 0x01
avrdude: sending sign-on command: 0x80 (3 bytes msg)
avrdude: input file flash.hex auto detected as Intel Hex
avrdude: input file eep.hex auto detected as Intel Hex
         AVR Part              : AVR16EA28
         Programming modes     : UPDI, SPM

         Memory            Size  Pg size    Offset
         -----------------------------------------
         eeprom             512        8    0x1400
         flash            16384       64  0x800000
         fuses               16        1    0x1050
         fuse0/wdtcfg         1        1    0x1050
         fuse1/bodcfg         1        1    0x1051
         fuse2/osccfg         1        1    0x1052
         fuse5/syscfg0        1        1    0x1055
         fuse6/syscfg1        1        1    0x1056
         fuse7/codesize       1        1    0x1057
         fuse8/bootsize       1        1    0x1058
         lock                 4        1    0x1040
         prodsig/sigrow     128      128    0x1100
         signature            3        1    0x1100
         tempsense            4        1    0x1104
         sernum              16        1    0x1110
         userrow/usersig     64       64    0x1080
         io                4160        1         0
         sram              2048        1    0x7800
         sib                 32        1         0

         Variants   Package  F max   T range         V range
         ----------------------------------------------------------
         AVR16EA28  SOIC28   20 MHz  [-40 C, 125 C]  [1.8 V, 5.5 V]

         Programmer Type       : JTAGICE3_UPDI
         Description           : MPLAB(R) SNAP in UPDI mode
avrdude: jtag3_getparm()
avrdude: sending get parameter (scope 0x01, section 0, parm 0) command: 0x84 (9
bytes msg)
         ICE HW version        : 1
         ICE FW version        : 1.10 (rel. 249)
         Serial number         : 
avrdude: jtag3_getparm()
avrdude: sending get parameter (scope 0x01, section 0, parm 1) command: 0x84 (6
bytes msg)
avrdude: jtag3_setparm()
avrdude: sending set parameter (scope 0x12, section 0, parm 0) command: 0x80 (3
bytes msg)
avrdude: jtag3_setparm()
avrdude: sending set parameter (scope 0x12, section 0, parm 1) command: 0x80 (3
bytes msg)
avrdude: jtag3_setparm()
avrdude: sending set parameter (scope 0x12, section 1, parm 0) command: 0x80 (3
bytes msg)
avrdude: jtag3_getparm()
avrdude: sending get parameter (scope 0x01, section 1, parm 0) command: 0x84 (6
bytes msg)
         Vtarget               : 0.59 V
avrdude: jtag3_getparm()
avrdude: sending get parameter (scope 0x12, section 1, parm 0) command: 0x84 (5
bytes msg)
avrdude: jtag3_getparm()
avrdude: sending get parameter (scope 0x12, section 0, parm 0) command: 0x84 (5
bytes msg)
avrdude: jtag3_getparm()
avrdude: sending get parameter (scope 0x12, section 1, parm 49) command: 0x84 (6
 bytes msg)
         PDI/UPDI clk          : 100 kHz

UPDI SET:
        xd->prog_base_msb=80
        xd->prog_base=0 0
        xd->flash_page_size_msb=0
        xd->flash_page_size=40
        xd->eeprom_page_size=8
        xd->nvmctrl=0 10
        xd->ocd=80 f
        xd->address_mode=1
avrdude: jtag3_setparm()
avrdude: sending set parameter (scope 0x12, section 2, parm 0) command: 0x80 (3
bytes msg)
avrdude: sending AVR sign-on command: 0xa0 (4 bytes msg)
avrdude: bad response to AVR sign-on command: 0xa0
avrdude: retrying with external reset applied
avrdude: sending AVR sign-on command: 0xa0 (4 bytes msg)
avrdude: bad response to AVR sign-on command: 0xa0
avrdude: retrying with external reset applied
avrdude main() error: initialization failed, rc=-1
        - double check the connections and try again
        - use -B to set lower the bit clock frequency, e.g. -B 125kHz
        - use -F to override this check
avrdude: jtag3_close()
avrdude: sending AVR sign-off command: 0x80 (3 bytes msg)
avrdude: sending sign-off command: 0x80 (3 bytes msg)

avrdude done.  Thank you.

@avrfreak
Copy link

avrfreak commented Jan 8, 2024

It's the same thing. -B 4.0 (if I am not mistaken) refers to the SPI SCK rate. This has nothing to do with a UPDI device nor does it have to do with the USB communication between the snap programmer and the PC.
I will be away today (my real job).
I will be available in 10 hours if you require more tests,
Thank you

@mcuee
Copy link
Collaborator Author

mcuee commented Jan 8, 2024

It's the same thing. -B 4.0 (if I am not mistaken) refers to the SPI SCK rate. This has nothing to do with a UPDI device nor does it have to do with the USB communication between the snap programmer and the PC. I will be away today (my real job). I will be available in 10 hours if you require more tests, Thank you

Thanks a lot for your help. Take your time.

For this issue, please help to test the MinGW and MSVC build to see if the compiler plays a part, when you got the time.

To make it easier, I have the snapshot here. Please try the following three binaries and the command.

C:\dist>avrdude -C avrdude.conf -c snap_updi -p avr16ea28 -vvvv -U flash:w:flash.hex:a -U eeprom:w:eep.hex:a

https://github.com/mcuee/avrdude/releases/tag/snapshot_2024-01-08
https://github.com/mcuee/avrdude/releases/download/snapshot_2024-01-08/avrdude-mingw-x86_64.zip
https://github.com/mcuee/avrdude/releases/download/snapshot_2024-01-08/avrdude-msvc-x64.zip
https://github.com/mcuee/avrdude/releases/download/snapshot_2024-01-08/avrdude-mingw-ucrt-x86_64.zip

@mcuee
Copy link
Collaborator Author

mcuee commented Jan 8, 2024

It's the same thing. -B 4.0 (if I am not mistaken) refers to the SPI SCK rate. This has nothing to do with a UPDI device

@MCUdude
I am not so sure about this. Is it correct to say that -B bit clock has nothing to do with UPDI devices?

nor does it have to do with the USB communication between the snap programmer and the PC.

This should be correct.

@MCUdude
Copy link
Collaborator

MCUdude commented Jan 8, 2024

-B should affect the UPDI clock speed. IIRC you can check the actual UPDI clock speed (in kHz) by using Avrdude in verbose mode (-v). It should change if you change the -B value.

@mcuee
Copy link
Collaborator Author

mcuee commented Jan 8, 2024

@stefanrueger and @MCUdude

One possibilty to sort out the old Arduino Crossbuild MinGW cross compiler issue, is to give up on the MinGW cross build (we can easily remove it from github action). We anyway recommend people to use the MSVC build first and then MinGW build if the MSVC build does not work. The original intention is anyway to provide static linked version for Linux and macOS users.

For the use case of Arduino Core, I think the MSVC build should work pretty well since the limitations do not normally affect Arduino Core users. Or we can use the MinGW build as well.

Reference:
https://github.com/avrdudes/avrdude/wiki/Getting-Nightly-Builds-for-AVRDUDE

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

Successfully merging a pull request may close this issue.

5 participants