avrdudes / avrdude

AVRDUDE is a utility to program AVR microcontrollers
GNU General Public License v2.0
696 stars 136 forks source link

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

Closed mcuee closed 8 months ago

mcuee commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

@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 commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

@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.

avrfreak commented 8 months ago

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 commented 8 months ago

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

mcuee commented 8 months ago

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 commented 8 months ago

@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 commented 8 months ago

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 commented 8 months ago

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

avrfreak commented 8 months ago

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

logfile.txt

avrfreak commented 8 months ago

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

stefanrueger commented 8 months ago

@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 commented 8 months ago

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

avrfreak commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

@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 commented 8 months ago

@Youw

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

avrfreak commented 8 months ago

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 commented 8 months ago

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 commented 8 months ago

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).

avrfreak commented 8 months ago

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.

Yes I can help. The PC that does not work is a W7 x64 machine. I have tested it on a laptop with W10 it appears to be working.

Again, previous avrdude versions before this are working so something must have changed in avrdude.

stefanrueger commented 8 months ago

The PC that does not work is a W7 x64 machine.

@mcuee Is that something you can confirm?

mcuee commented 8 months ago

The PC that does not work is a W7 x64 machine.

@mcuee Is that something you can confirm?

Unfortunately I do not have legacy Windows installations (Windows 7/8/8.1). I only have Windows 10/11. Hopefully someone else with Windows 7 machine can chime in and help. I do not think Windows 7 is the real issue here though as HIDAPI should work fine under Windows 7 (it may even work in older version of Windows as it has not dropped the support of Windows XP yet).

@avrfreak

Still I do not think Windows 7 is the real issue. If possible, please test in another Windows 7 machine.

avrfreak commented 8 months ago

I tested in another windows 7 machine, still not working, however Avrdude v7.2 is working. Something must have changed in the newer version of avrdude.

avrfreak commented 8 months ago

ok so you edited my post and changed the title of the thread. The main subject was dealing with the SNAP programmer in avrdude which was working until the newest beta release. The problem is NOT with windows 7, it is with avrdude.

mcuee commented 8 months ago

ok so you edited my post and changed the title of the thread. The main subject was dealing with the SNAP programmer in avrdude which was working until the newest beta release. The problem is NOT with windows 7, it is with avrdude.

The problem is avrdude under Windows 7.

But if you also encounter problems under Windows 10 or Windows 11, let me know and I will change the title back.

I edit your post to properly use the code tag (three "`"). But somehow you delete your post. Please help to post again. Thanks.

This is an example.
mcuee commented 8 months ago

Anyway, I can post your deleted post back here.

Yes it is correct that AVR EBs are not supported by PICKit 4 and SNAP yet. Please refer to the comment below.

Tested avrdude on a PC with windows 10 using the snap programmer with an AVR16EB32. Not working. Using the logic analyzer, it appears that the SIB is read but then it stops. Here is a verbose log:

https://github.com/avrdudes/avrdude/files/13830505/logfile.txt

Another note, I can't seem to make the code tags work on this forum (when trying to post the log text) It formats only the first portion. Is this a bug or maybe I am doing something wrong? here is how the log appears:

avrdude: Version 7.2-20231218 ([67792ca](https://github.com/avrdudes/avrdude/commit/67792ca8c6da78fd13d6eb82f5e72d8647b0d71a))
Copyright the AVRDUDE authors;
see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

     System wide configuration file is G:\avrdude\msvc\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
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
avrdude: input file flash.hex auto detected as Intel Hex
avrdude: input file eep.hex auto detected as Intel Hex
AVR Part : AVR16EB32
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 
     fusea/pdicfg         2        1    0x105a 
     lock                 4        1    0x1040 
     prodsig/sigrow     128      128    0x1080 
     signature            3        1    0x1080 
     tempsense            4        1    0x1084 
     sernum              16        1    0x1090 
     bootrow             64       64    0x1100 
     userrow/usersig     64       64    0x1200 
     io                4160        1         0 
     sram              2048        1    0x7800 
     sib                 32        1         0 

     Variants             Package  F max   T range         V range       
     --------------------------------------------------------------------
     AVR16EB32-VQFN/TQFP  VQFN32   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:
avrdude: jtag3_edbg_send(): sending 6 bytes
avrdude: jtag3_edbg_recv():
avrdude: 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 :
avrdude: jtag3_getparm()
avrdude: sending get parameter (scope 0x01, section 0, parm 1) command:
avrdude: jtag3_edbg_send(): sending 6 bytes
avrdude: jtag3_edbg_recv():
avrdude: 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: jtag3_setparm()
avrdude: sending set parameter (scope 0x12, section 0, parm 0) command:
avrdude: jtag3_edbg_send(): sending 7 bytes
avrdude: jtag3_edbg_recv():
avrdude: jtag3_recv(): Got message seqno 3 (command_sequence == 3)

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

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

Raw message:
12 80 00
[AVR] OK
avrdude: jtag3_initialize(): trying to set JTAG clock to 250 kHz
avrdude: jtag3_setparm()
avrdude: sending set parameter (scope 0x12, section 1, parm 49) command:
avrdude: jtag3_edbg_send(): sending 8 bytes
avrdude: jtag3_edbg_recv():
avrdude: jtag3_recv(): Got message seqno 6 (command_sequence == 6)

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

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

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

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

Raw message:
12 84 00 fa 00 00
[AVR] Data returned:
0x00 0xfa 0x00 0x00
PDI/UPDI clk : 250 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:
avrdude: jtag3_edbg_send(): sending 54 bytes
avrdude: jtag3_edbg_recv():
avrdude: jtag3_recv(): Got message seqno 11 (command_sequence == 11)

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

Raw message:
12 a0 00 33
[AVR] FAILED, reason: 0x33
avrdude: bad response to AVR sign-on command: 0xa0
avrdude: retrying with external reset applied
avrdude: sending AVR sign-on command:
avrdude: jtag3_edbg_send(): sending 4 bytes
avrdude: jtag3_edbg_recv():
avrdude: jtag3_recv(): Got message seqno 13 (command_sequence == 13)

Raw message:
12 a0 00 33
[AVR] FAILED, reason: 0x33
avrdude: bad response to AVR sign-on command: 0xa0
avrdude: retrying with external reset applied
avrdude main() [main.c:1523] 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:
avrdude: jtag3_edbg_send(): sending 3 bytes
avrdude: jtag3_edbg_recv():
avrdude: jtag3_recv(): Got message seqno 14 (command_sequence == 14)

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

Raw message:
01 80 00
[general] OK

avrdude: jtag3_edbg_signoff()

avrdude done. Thank you.
mcuee commented 8 months ago

@avrfreak

Please help to try the mingw32 Windows 32bit binary from the following github action build under your Windows 7 machines. The binary is inside the file dist.zip. https://github.com/avrdudes/avrdude/actions/runs/7397687787

avrfreak commented 8 months ago

@avrfreak

Please help to try the mingw32 Windows 32bit binary from the following github action build under your Windows 7 machines. The binary is inside the file dist.zip. https://github.com/avrdudes/avrdude/actions/runs/7397687787

Code tages are not working for me on this forum! I am using the same hex files for testing as always.

G:\Jan4>avrdude -C avrdude.conf -c snap_
updi -p avr64EA28 -B 4.0 -e -U flash:w:flash.hex:a -U eeprom:w:eep.hex:a

avrdude warning: cannot determine file format for flash.hex, specify explicitly
avrdude warning: cannot determine file format for eep.hex, specify explicitly
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e9620 (probably avr64ea28)
avrdude: erasing chip

avrdude: processing -U flash:w:flash.hex:a
avrdude error: cannot determine file format for flash.hex, specify explicitly
avrdude error: read from file flash.hex failed

avrdude done.  Thank you.
`

here is the same setup using previous version of avrdude with the same hex files, same programmer, etc..

`
G:\avrdude-v7.2>avrdude -C avrdude.conf -c snap_updi -p
avr64EA28 -B 4.0 -e -U flash:w:flash.hex:a -U eeprom:w:eep.hex:a
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e9620 (probably avr64ea28)
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 8 pages and 0 pad bytes
avrdude: writing 1024 bytes flash ...
Writing | ################################################## | 100% 0.20 s
avrdude: 1024 bytes of flash written
avrdude: verifying flash memory against flash.hex
Reading | ################################################## | 100% 0.09 s
avrdude: 1024 bytes of flash verified

avrdude: processing -U eeprom:w:eep.hex:i
avrdude: reading input file eep.hex for eeprom
         with 512 bytes in 1 section within [0, 0x1ff]
         using 64 pages and 0 pad bytes
avrdude: writing 512 bytes eeprom ...
Writing | ################################################## | 100% 0.70 s
avrdude: 512 bytes of eeprom written
avrdude: verifying eeprom memory against eep.hex
Reading | ################################################## | 100% 0.21 s
avrdude: 512 bytes of eeprom verified

avrdude done.  Thank you.
mcuee commented 8 months ago

@avrfreak

The code tag works -- you have to use triple ` and not single `.

I have edited your post to show that it works. You can edit it again to see how I use the code tag.

mcuee commented 8 months ago

@avrfreak

Please post the hex files. Thanks.

Your latest issue is totally different from the previous posted error logs.

This time the error is with the hex files (flash.hex and eep.hex) but the communication with the SNAP and the Chip are both working.

Previously the communication with the SNAP seems to work but not the chip as per the log file.

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

     System wide configuration file is G:\avrdude7.3_beta\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 avrdude: sending sign-on command: avrdude: jtag3_edbg_send(): sending 3 bytes avrdude: Version 7.2-20231218 (67792ca) Copyright the AVRDUDE authors; see https://github.com/avrdudes/avrdude/blob/main/AUTHORS

     System wide configuration file is G:\avrdude7.3_beta\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 avrdude: sending sign-on command: avrdude: jtag3_edbg_send(): sending 3 bytes

stefanrueger commented 8 months ago

avrdude warning: cannot determine file format for flash.hex, specify explicitly

Is the problem that when compiled under Windows 7 avrdude can no longer recognise Intel Hex files? OK, this is info we can work with. OK, first of all you could do what avrdude suggests: specify the file type explicitly. Use :i instead of :a.

So, perhaps The Windows 7 compiler does not understand the "%2zx" scanf format (z means the variable to be set is of type size_t)? Has been around for a long time.

mcuee commented 8 months ago

@avrfreak and @stefanrueger

The situation about Windows binaries is a bit complicated. We have three types of Windows binary from github actions, for latest git main.

1) MSVC build (using VS2022, x86, x64 and arm64 build), without libserialport, using avrdude's own libusb/libftdi, using avrdude's own readline wrapper, using hidapi 0.13.0 release https://github.com/avrdudes/avrdude/blob/main/.github/workflows/build.yml https://github.com/avrdudes/avrdude/wiki/Getting-Nightly-Builds-for-AVRDUDE#windows-static-linking-to-dependancies (latest run for git main)

2) MSYS2 mingw32/64 (x86 and x64 build), with libserialport, with GNU Readline, with libusb-1.0.26 and libusb-compat-0.1, with libftdi1, with hidapi 0.14.0. https://github.com/avrdudes/avrdude/blob/main/.github/workflows/build.yml https://github.com/avrdudes/avrdude/wiki/Getting-Nightly-Builds-for-AVRDUDE#windows-static-linking-to-dependancies (latest run for git main)

3) using Arduino avrdude-packing script (32bit x86 build only), using a Linux container with cross compiler, without libserialport, with libusb-1.0.26 and libusb-compat-0.1.7, libftdi1-1.4, hidapi 0.12.0, GNU Readline 8.0. https://github.com/avrdudes/avrdude/blob/main/.github/workflows/arduino_packing.yml https://github.com/avrdudes/avrdude/wiki/Getting-Nightly-Builds-for-AVRDUDE#linux-macos-and-windows-static-linking-to-dependancies (latets run for git main)

More info about the docker container and cross compiler as well as the libraries used https://github.com/arduino/crossbuild/blob/main/Dockerfile https://github.com/arduino/crossbuild/tree/main/deps

mcuee commented 8 months ago

@avrfreak

Please try the other two Windows binaries on your Windows 7 machine as well to see if there are behavior differences. To make it more consistent, please use the 32bit x86 MSVC build and MSYS2 mingw32 build.

https://github.com/avrdudes/avrdude/wiki/Getting-Nightly-Builds-for-AVRDUDE File names: 1) avrdude-msvc-x86.zip 2) avrdude-mingw-i686.zip 3) dist.zip (avrdude_main_Windows_32bit.tar.gz) --> Arduino avrdude-packing binary, you already tried under Windows 7

Then please try all three binaries under your Windows 10 machine as well to see if they all work or not.

And please use the following command line if you encounter issue with :a.

avrdude -C avrdude.conf -c snap_updi -p avr64EA28 -B 4.0 -e 
-U flash:w:flash.hex:i -U eeprom:w:eep.hex:i
stefanrueger commented 8 months ago

situation about Windows

I suspect the observed problem where avrdude fails to recognise the INtel hex file stems from a missing C99 flag (or the compiler not implementing ANSI C standard C99) when compiling for Windows 7.

Test with the following C file

#include <stdio.h>

int main() {
  size_t n;

  printf("type a number\n");
  if(1 == scanf("%zi", &n))
    printf("you entered %zu\n", n);
  else
    printf("cannot process %%zi format\n");
}

Compile above to and test with echo 42 | a.out.

stefanrueger commented 8 months ago

@avrfreak Thanks for reporting a problem you observed. Pro tips:

avrfreak commented 8 months ago

It was the ":a" in the command line. I changed it to ":i" and it works. I have used :a all along with no problems. I just copied the command line (with the ":a") from an avrdude GUI I used. I have been using this for years without problems.

If I get some time I will try the other binaries. Thank you

mcuee commented 8 months ago

@avrfreak

Thanks for the update.

So at least the Arduino_packing 32bit Windows binary works under Windows 7 now once you use :i and not :a. Please try the other two binaries as well under Windows 7 when you got the time.

@stefanrueger can probably fix this hex file issue with :a under Windows 7.

mcuee commented 8 months ago

Thanks for reporting a problem you observed. Pro tips:

  • Create a separate issue for each problem
  • Tell us what exactly the problem is and how you came to experience it

    • OS
    • Programmer
    • Part
    • How connected/rigged up
    • AVRDUDE command line
    • Output of the command
    • Sometimes it also helps us if you upload a file with the -vv or -vvv output
    • What you would have expected to happen

I have included this in the FAQ with minor addition. Feel free to update. https://github.com/avrdudes/avrdude/wiki/FAQ#how-to-report-an-issue-to-avrdude-project

stefanrueger commented 8 months ago

It is not clear to me what went wrong. I suspect the format "%zx" does not work as intended in the function couldbe(). The z length modifier was introduced in C99 (ie, made standard in 2000).

@mcuee can you find out using the CI whether this is so? Either compile the following C source and execute the a.out in the CI or add the body of main() to AVRDUDE's main() and execute avrdude in Windows 7; maybe @avrfreak could help and try this out, too.

#include <stdio.h>

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

If that turns out to be the problem then there could be several reasons:

It could still be a different reason why @avrfreak observes this behaviour.

mcuee commented 8 months ago

@stefanrueger

As mentioned, there are three scenarios for the Windows avrdude binaries -- different compiler toolchain and different libraries used.

1) MSVC toolchain in CI -- pretty up-to-date VS2022 v143 toolchain

Dependancies under my Windows 11 machine.

MINGW64 /c/work/avr/avrdude_test/avrdude_bin/github_bin/avrdude-msvc-x64
$ ldd avrdude.exe
        ntdll.dll => /c/WINDOWS/SYSTEM32/ntdll.dll (0x7ff8efaf0000)
        KERNEL32.DLL => /c/WINDOWS/System32/KERNEL32.DLL (0x7ff8ef260000)
        KERNELBASE.dll => /c/WINDOWS/System32/KERNELBASE.dll (0x7ff8ed1d0000)
        apphelp.dll => /c/WINDOWS/SYSTEM32/apphelp.dll (0x7ff8e9df0000)
        SETUPAPI.dll => /c/WINDOWS/System32/SETUPAPI.dll (0x7ff8ee030000)
        msvcrt.dll => /c/WINDOWS/System32/msvcrt.dll (0x7ff8edf80000)
        WS2_32.dll => /c/WINDOWS/System32/WS2_32.dll (0x7ff8edad0000)
        RPCRT4.dll => /c/WINDOWS/System32/RPCRT4.dll (0x7ff8ef7e0000)
        HID.DLL => /c/WINDOWS/SYSTEM32/HID.DLL (0x7ff8eb630000)
        WINMM.dll => /c/WINDOWS/SYSTEM32/WINMM.dll (0x7ff8de3f0000)
        WINUSB.DLL => /c/WINDOWS/SYSTEM32/WINUSB.DLL (0x7ff8e46e0000)
        ucrtbase.dll => /c/WINDOWS/System32/ucrtbase.dll (0x7ff8ed040000)

$ objdump -p ./avrdude.exe | grep 'DLL Name:'
        DLL Name: SETUPAPI.dll
        DLL Name: HID.DLL
        DLL Name: WS2_32.dll
        DLL Name: KERNEL32.dll
        DLL Name: WINMM.dll
        DLL Name: WINUSB.DLL

2) MSYS2 mingw toolchin in CI -- pretty up-to-date MinGW GCC toolchain Dependancies under my Windows 11 machine.

MINGW64 /c/work/avr/avrdude_test/avrdude_bin/github_bin/avrdude-mingw-x86_64
$ ldd avrdude.exe
        ntdll.dll => /c/WINDOWS/SYSTEM32/ntdll.dll (0x7ff8efaf0000)
        KERNEL32.DLL => /c/WINDOWS/System32/KERNEL32.DLL (0x7ff8ef260000)
        KERNELBASE.dll => /c/WINDOWS/System32/KERNELBASE.dll (0x7ff8ed1d0000)
        ADVAPI32.dll => /c/WINDOWS/System32/ADVAPI32.dll (0x7ff8ee4e0000)
        msvcrt.dll => /c/WINDOWS/System32/msvcrt.dll (0x7ff8edf80000)
        sechost.dll => /c/WINDOWS/System32/sechost.dll (0x7ff8eded0000)
        RPCRT4.dll => /c/WINDOWS/System32/RPCRT4.dll (0x7ff8ef7e0000)
        SETUPAPI.dll => /c/WINDOWS/System32/SETUPAPI.dll (0x7ff8ee030000)
        USER32.dll => /c/WINDOWS/System32/USER32.dll (0x7ff8ef0b0000)
        win32u.dll => /c/WINDOWS/System32/win32u.dll (0x7ff8ed600000)
        HID.DLL => /c/WINDOWS/SYSTEM32/HID.DLL (0x7ff8eb630000)
        GDI32.dll => /c/WINDOWS/System32/GDI32.dll (0x7ff8ee4b0000)
        gdi32full.dll => /c/WINDOWS/System32/gdi32full.dll (0x7ff8ece60000)
        msvcp_win.dll => /c/WINDOWS/System32/msvcp_win.dll (0x7ff8ed630000)
        ucrtbase.dll => /c/WINDOWS/System32/ucrtbase.dll (0x7ff8ed040000)
        WS2_32.dll => /c/WINDOWS/System32/WS2_32.dll (0x7ff8edad0000)
        cfgmgr32.DLL => /c/WINDOWS/SYSTEM32/cfgmgr32.DLL (0x7ff8ecad0000)

$ objdump -p ./avrdude.exe | grep 'DLL Name:'
        DLL Name: ADVAPI32.dll
        DLL Name: HID.DLL
        DLL Name: KERNEL32.dll
        DLL Name: msvcrt.dll
        DLL Name: SETUPAPI.dll
        DLL Name: USER32.dll
        DLL Name: WS2_32.dll

3) MinGW 32bit toolchain using cross-compile in CI -- this one is using a bit older MinGW GCC version

Unfortunately I do not know how to check the dependancies here for the 32bit binary properly using ldd.

MINGW64 /c/work/avr/avrdude_test/avrdude_bin/github_bin/dist/avrdude_Windows_32bit/bin
$ ldd avrdude.exe
        ntdll.dll => /c/WINDOWS/SYSTEM32/ntdll.dll (0x7ff8efaf0000)
        ntdll.dll => /c/Windows/SysWOW64/ntdll.dll (0x77c60000)
        wow64.dll => /c/WINDOWS/System32/wow64.dll (0x7ff8ef3e0000)
        wow64base.dll => /c/WINDOWS/System32/wow64base.dll (0x7ff8edde0000)
        wow64win.dll => /c/WINDOWS/System32/wow64win.dll (0x7ff8ef020000)
        wow64con.dll => /c/WINDOWS/System32/wow64con.dll (0x7ff8ef000000)

$ objdump -p avrdude.exe    | grep 'DLL Name:'
        DLL Name: hid.dll
        DLL Name: KERNEL32.dll
        DLL Name: msvcrt.dll
        DLL Name: SETUPAPI.dll
        DLL Name: USER32.dll
        DLL Name: WS2_32.dll

I tend to think all three toolchains will have no issues with C99, but maybe the last one can be a potential issue. Based on the last report, the last one (MinGW cross-compiler) seems to have a problem with the auto-recognition of hex file format.

The C runtime library (msvcrt.dll) inside Windows 7 can potentially be the problem as well. But if it has a problem, then I tend to think all three binaries would have the same problem. Let's wait for the test results of @avrfreak using the three different binaries.

mcuee commented 8 months ago

There are two issues reported by @avrfreak here.

1) avrdude can not communicate with the chip under Windows 7. This one is rather strange. I have no idea how it happens. But if the three binaries perform differently, then the issue could be the hidapi version used.

2) avrdude can not automatically recognize the hex file format with :a, also under Windows 7. This is also strange but at least @stefanrueger has some ideas why it happens.

avrfreak commented 8 months ago

OK here are some results of my testing: I tested avrdude-mingw-i686 under windows 7 x64. This version does not work with the snap programmer. It does work with a serialupdi cable. The hex files are accepted using ":a". avrdude -C avrdude.conf -c snap_updi -p avr16EA28 -vvvv -l logfile.txt -e -U flash:w:flash.hex:a -U eeprom:w:eep.hex:a SNAP_logfile.txt

avrdude -C avrdude.conf -c serialupdi -P COM7 -vvvv -l logfile.txt -b 230400 -p avr16EA28 -e -U flash:w:flash.hex:a -U eeprom:w:eep.hex:a Serial_UPDI_logfile.txt

avrfreak commented 8 months ago

Here is the output from testing avrdude-msvc-x86 in windows 7 x64. This one works with my snap programmer. The hex files area accepted using ":a". SNAP_logfile.txt Serialupdi_logfile.txt

avrfreak commented 8 months ago

Here is the output from dist.zip using both snap programmer and serialupdi. The serial cable is a ch340G cable with the diode and resistor mod. Serialupdi_LOG.txt SNAP_logfile.txt this is what happens when ":a" is used for the hex files in the command line: SNAP_logfile2.txt

All working well!. I will working today. I will be available for more testing the next few days. Thank you

mcuee commented 8 months ago

@avrfreak

Thanks a lot for the updates.

Please help to carry out the same tests under Windows 10 to see if the behavior is the same or not.

mcuee commented 8 months ago

1) This is the version we recommend to the user under Windows.

MSVC build (using VS2022, x86, x64 and arm64 build), without libserialport, using avrdude's own libusb/libftdi, using avrdude's own readline wrapper, using hidapi 0.13.0 release https://github.com/avrdudes/avrdude/blob/main/.github/workflows/build.yml https://github.com/avrdudes/avrdude/wiki/Getting-Nightly-Builds-for-AVRDUDE#windows-static-linking-to-dependancies (latest run for git main)

Known Issues for this version:

2) This is the second choice for Windows users.

MSYS2 mingw32/64 (x86 and x64 build), with libserialport, with GNU Readline, with libusb-1.0.26 and libusb-compat-0.1, with libftdi1, with hidapi 0.14.0. https://github.com/avrdudes/avrdude/blob/main/.github/workflows/build.yml https://github.com/avrdudes/avrdude/wiki/Getting-Nightly-Builds-for-AVRDUDE#windows-static-linking-to-dependancies (latest run for git main)

Known limitation of this build

3) This is likely to be used by Arduino distributions under Windows, Linux and macOS.

using Arduino avrdude-packing script (32bit x86 build only), using a Linux container with cross compiler, without libserialport, with libusb-1.0.26 and libusb-compat-0.1.7, libftdi1-1.4, hidapi 0.12.0, GNU Readline 8.0. https://github.com/avrdudes/avrdude/blob/main/.github/workflows/arduino_packing.yml https://github.com/avrdudes/avrdude/wiki/Getting-Nightly-Builds-for-AVRDUDE#linux-macos-and-windows-static-linking-to-dependancies (latets run for git main)

Known limitation of this build