avrdudes / avrdude

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

avrftdi ISP issue #1326

Closed mcuee closed 1 year ago

mcuee commented 1 year ago

This needs confirmation to see if there is a real issue or not.

From @mariusgreuel https://github.com/avrdudes/avrdude/pull/1324#issuecomment-1478631446 SUCCESS: MSVC with custom avrdude-libftdi/FTDI driver, FT232H via ISP FAILED: MinGW64 with stock libftdi/libusb0 driver, FT232H via ISP FAILED: Linux/Ubuntu 22.04 with usbipd-win, FT232H via ISP

From myself using JTAGKey 2 and another FT2232H breakout board https://github.com/avrdudes/avrdude/pull/1324#issuecomment-1480422098

Test 1 FAILED: MSVC with custom avrdude-libftdi/FTDI driver, JTAGKey2 via ISP FAILED: MinGW64 with stock libftdi-1.0/libusb-1.0/WinUSB driver, JTAGKey2 via ISP

PS C:\work\avr\avrdude_test\avrdude_bin> .\avrdude_git_msvc -c jtagkey -p m328pb

E avrftdi_program_enable(874): Device is not responding to program enable. Check connection.
avrdude_git_msvc 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_git_msvc done.  Thank you.

PS C:\work\avr\avrdude_test\avrdude_bin> .\avrdude_git -c jtagkey -p m328pb

E avrftdi_program_enable(874): Device is not responding to program enable. Check connection.
avrdude_git 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_git done.  Thank you.

Debug log for the MSVC version.

full debug log when using MSVC version FTDI driver, latest git main ``` PS C:\work\avr\avrdude_test\avrdude_bin> .\avrdude_git_msvc -c jtagkey -p m328pb -vvvv avrdude_git_msvc: Version 7.1-20230322 (7a8d257) 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 Using Port : usb Using Programmer : jtagkey I avrftdi_open(703): Using device VID:PID 0403:cff8 and SN '(null)' on interface A. D write_flush(472): Setting pin direction (0x0000) and value (0x0000) T write_flush(484): Set pins command: 80 00 00 82 00 00 I set_frequency(206): Using frequency: 150000 I set_frequency(207): Clock divisor: 0x0027 D avrftdi_check_pins_mpsse(562): Using valid mask mpsse: 0x0000fff8 avrdude_git_msvc: : pin is OK avrdude_git_msvc: VCC: pin is OK avrdude_git_msvc: BUFF: pin is OK avrdude_git_msvc: RESET: pin is OK avrdude_git_msvc: SCK: pin is OK avrdude_git_msvc: SDO: pin is OK avrdude_git_msvc: SDI: pin is OK avrdude_git_msvc: ERRLED: pin is OK avrdude_git_msvc: RDYLED: pin is OK avrdude_git_msvc: PGMLED: pin is OK avrdude_git_msvc: VFYLED: pin is OK D avrftdi_check_pins_bb(527): Using valid mask bitbanging: 0x0000ffff avrdude_git_msvc: : pin is OK avrdude_git_msvc: VCC: pin is OK avrdude_git_msvc: BUFF: pin is OK avrdude_git_msvc: RESET: pin is OK avrdude_git_msvc: SCK: pin is OK avrdude_git_msvc: SDO: pin is OK avrdude_git_msvc: SDI: pin is OK avrdude_git_msvc: ERRLED: pin is OK avrdude_git_msvc: RDYLED: pin is OK avrdude_git_msvc: PGMLED: pin is OK avrdude_git_msvc: VFYLED: pin is OK I avrftdi_pin_setup(636): Pin direction mask: 001b I avrftdi_pin_setup(637): Pin value mask: 0010 AVR Part : ATmega328PB Chip Erase delay : 10500 us PAGEL : PD7 BS2 : PC2 RESET disposition : possible i/o RETRY pulse : SCK Serial program mode : yes Parallel program mode : yes Timeout : 200 StabDelay : 100 CmdexeDelay : 25 SyncLoops : 32 PollIndex : 3 PollValue : 0x53 Memory Detail : Block Poll Page Polled Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- eeprom 65 20 4 0 no 1024 4 0 3600 3600 0x00 0x00 Block Poll Page Polled Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- flash 65 10 128 0 yes 32768 128 256 4500 4500 0x00 0x00 Block Poll Page Polled Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- lfuse 0 0 0 0 no 1 1 0 4500 4500 0x00 0x00 Block Poll Page Polled Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- hfuse 0 0 0 0 no 1 1 0 4500 4500 0x00 0x00 Block Poll Page Polled Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- efuse 0 0 0 0 no 1 1 0 4500 4500 0x00 0x00 Block Poll Page Polled Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- lock 0 0 0 0 no 1 1 0 4500 4500 0x00 0x00 Block Poll Page Polled Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- signature 0 0 0 0 no 3 1 0 0 0 0x00 0x00 Block Poll Page Polled Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- calibration 0 0 0 0 no 1 1 0 0 0 0x00 0x00 Programmer Type : avrftdi Description : Amontec JTAGKey, JTAGKey-Tiny and JTAGKey2 D set_pin(241): Setting pin 4 (ADBUS4) as BUFF: high (low active) D write_flush(472): Setting pin direction (0x001b) and value (0x0000) T write_flush(484): Set pins command: 80 00 1b 82 00 00 D set_pin(241): Setting pin 3 (ADBUS3) as RESET: low (high active) D write_flush(472): Setting pin direction (0x001b) and value (0x0000) T write_flush(484): Set pins command: 80 00 1b 82 00 00 D set_pin(241): Setting pin 0 (ADBUS0) as SCK: low (high active) D write_flush(472): Setting pin direction (0x001b) and value (0x0000) T write_flush(484): Set pins command: 80 00 1b 82 00 00 D set_pin(241): Setting pin 3 (ADBUS3) as RESET: high (high active) D write_flush(472): Setting pin direction (0x001b) and value (0x0008) T write_flush(484): Set pins command: 80 08 1b 82 00 00 D set_pin(241): Setting pin 3 (ADBUS3) as RESET: low (high active) D write_flush(472): Setting pin direction (0x001b) and value (0x0000) T write_flush(484): Set pins command: 80 00 1b 82 00 00 W avrftdi_program_enable(865): Program enable command not successful. Retrying. D set_pin(241): Setting pin 3 (ADBUS3) as RESET: high (high active) D write_flush(472): Setting pin direction (0x001b) and value (0x0008) T write_flush(484): Set pins command: 80 08 1b 82 00 00 D set_pin(241): Setting pin 3 (ADBUS3) as RESET: low (high active) D write_flush(472): Setting pin direction (0x001b) and value (0x0000) T write_flush(484): Set pins command: 80 00 1b 82 00 00 W avrftdi_program_enable(865): Program enable command not successful. Retrying. D set_pin(241): Setting pin 3 (ADBUS3) as RESET: high (high active) D write_flush(472): Setting pin direction (0x001b) and value (0x0008) T write_flush(484): Set pins command: 80 08 1b 82 00 00 D set_pin(241): Setting pin 3 (ADBUS3) as RESET: low (high active) D write_flush(472): Setting pin direction (0x001b) and value (0x0000) T write_flush(484): Set pins command: 80 00 1b 82 00 00 W avrftdi_program_enable(865): Program enable command not successful. Retrying. D set_pin(241): Setting pin 3 (ADBUS3) as RESET: high (high active) D write_flush(472): Setting pin direction (0x001b) and value (0x0008) T write_flush(484): Set pins command: 80 08 1b 82 00 00 D set_pin(241): Setting pin 3 (ADBUS3) as RESET: low (high active) D write_flush(472): Setting pin direction (0x001b) and value (0x0000) T write_flush(484): Set pins command: 80 00 1b 82 00 00 W avrftdi_program_enable(865): Program enable command not successful. Retrying. D set_pin(241): Setting pin 3 (ADBUS3) as RESET: high (high active) D write_flush(472): Setting pin direction (0x001b) and value (0x0008) T write_flush(484): Set pins command: 80 08 1b 82 00 00 D set_pin(241): Setting pin 3 (ADBUS3) as RESET: low (high active) D write_flush(472): Setting pin direction (0x001b) and value (0x0000) T write_flush(484): Set pins command: 80 00 1b 82 00 00 E avrftdi_program_enable(874): Device is not responding to program enable. Check connection. avrdude_git_msvc main() [main.c:1252] 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 D set_pin(241): Setting pin 4 (ADBUS4) as BUFF: low (low active) D write_flush(472): Setting pin direction (0x001b) and value (0x0010) T write_flush(484): Set pins command: 80 10 1b 82 00 00 D set_pin(241): Setting pin 3 (ADBUS3) as RESET: high (high active) D write_flush(472): Setting pin direction (0x001b) and value (0x0018) T write_flush(484): Set pins command: 80 18 1b 82 00 00 I avrftdi_close(796): LED Mask=0x0000 value =0x0018 &=0x0000 D write_flush(472): Setting pin direction (0x0000) and value (0x0000) T write_flush(484): Set pins command: 80 00 00 82 00 00 avrdude_git_msvc done. Thank you. ```
mcuee commented 1 year ago

Test 2:

FAILED: MSVC with custom avrdude-libftdi/FTDI driver, FT2232H via ISP

C:\work\avr\avrdude_test\avrdude_bin> .\avrdude71 -C avrdude71.conf -c avrftdi -p m328p

E avrftdi_program_enable(874): Device is not responding to program enable. Check connection.
avrdude71 error: initialization failed, rc=-1
          - double check the connections and try again
          - use -B to set lower ISP clock frequency, e.g. -B 125kHz
          - use -F to override this check

avrdude71 done.  Thank you.

C:\work\avr\avrdude_test\avrdude_bin> .\avrdude7 -C avrdude7.conf -c avrftdi -p m328p

E avrftdi_program_enable(889): Device is not responding to program enable. Check connection.
avrdude7.exe: initialization failed, rc=-1
              Double check connections and try again, or use -F to override
              this check.

avrdude7.exe done.  Thank you.

C:\work\avr\avrdude_test\avrdude_bin> .\avrdude_git_msvc -C avrdude_git_msvc.conf -c avrftdi -p m328p

E avrftdi_program_enable(874): Device is not responding to program enable. Check connection.
avrdude_git_msvc 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_git_msvc done.  Thank you.

Full debug log for the last run.

Debug log for the MSVC version.

full debug log when using MSVC version FTDI driver, latest git main ``` C:\work\avr\avrdude_test\avrdude_bin> .\avrdude_git_msvc -C avrdude_git_msvc.conf -c avrftdi -p m328p -vvvv avrdude_git_msvc: Version 7.1-20230322 (7a8d257) 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_git_msvc.conf Using Port : usb Using Programmer : avrftdi I avrftdi_open(703): Using device VID:PID 0403:6010 and SN '(null)' on interface A. D write_flush(472): Setting pin direction (0x0000) and value (0x0000) T write_flush(484): Set pins command: 80 00 00 82 00 00 I set_frequency(206): Using frequency: 150000 I set_frequency(207): Clock divisor: 0x0027 D avrftdi_check_pins_mpsse(562): Using valid mask mpsse: 0x0000fff8 avrdude_git_msvc: : pin is OK avrdude_git_msvc: VCC: pin is OK avrdude_git_msvc: BUFF: pin is OK avrdude_git_msvc: RESET: pin is OK avrdude_git_msvc: SCK: pin is OK avrdude_git_msvc: SDO: pin is OK avrdude_git_msvc: SDI: pin is OK avrdude_git_msvc: ERRLED: pin is OK avrdude_git_msvc: RDYLED: pin is OK avrdude_git_msvc: PGMLED: pin is OK avrdude_git_msvc: VFYLED: pin is OK D avrftdi_check_pins_bb(527): Using valid mask bitbanging: 0x0000ffff avrdude_git_msvc: : pin is OK avrdude_git_msvc: VCC: pin is OK avrdude_git_msvc: BUFF: pin is OK avrdude_git_msvc: RESET: pin is OK avrdude_git_msvc: SCK: pin is OK avrdude_git_msvc: SDO: pin is OK avrdude_git_msvc: SDI: pin is OK avrdude_git_msvc: ERRLED: pin is OK avrdude_git_msvc: RDYLED: pin is OK avrdude_git_msvc: PGMLED: pin is OK avrdude_git_msvc: VFYLED: pin is OK I avrftdi_pin_setup(636): Pin direction mask: 000b I avrftdi_pin_setup(637): Pin value mask: 0000 AVR Part : ATmega328P Chip Erase delay : 9000 us PAGEL : PD7 BS2 : PC2 RESET disposition : possible i/o RETRY pulse : SCK Serial program mode : yes Parallel program mode : yes Timeout : 200 StabDelay : 100 CmdexeDelay : 25 SyncLoops : 32 PollIndex : 3 PollValue : 0x53 Memory Detail : Block Poll Page Polled Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- eeprom 65 20 4 0 no 1024 4 0 3600 3600 0x00 0x00 Block Poll Page Polled Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- flash 65 10 128 0 yes 32768 128 256 4500 4500 0x00 0x00 Block Poll Page Polled Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- lfuse 0 0 0 0 no 1 1 0 4500 4500 0x00 0x00 Block Poll Page Polled Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- hfuse 0 0 0 0 no 1 1 0 4500 4500 0x00 0x00 Block Poll Page Polled Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- efuse 0 0 0 0 no 1 1 0 4500 4500 0x00 0x00 Block Poll Page Polled Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- lock 0 0 0 0 no 1 1 0 4500 4500 0x00 0x00 Block Poll Page Polled Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- signature 0 0 0 0 no 3 1 0 0 0 0x00 0x00 Block Poll Page Polled Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- calibration 0 0 0 0 no 1 1 0 0 0 0x00 0x00 Programmer Type : avrftdi Description : FT2232D based generic programmer D set_pin(241): Setting pin 3 (ADBUS3) as RESET: low (high active) D write_flush(472): Setting pin direction (0x000b) and value (0x0000) T write_flush(484): Set pins command: 80 00 0b 82 00 00 D set_pin(241): Setting pin 0 (ADBUS0) as SCK: low (high active) D write_flush(472): Setting pin direction (0x000b) and value (0x0000) T write_flush(484): Set pins command: 80 00 0b 82 00 00 D set_pin(241): Setting pin 3 (ADBUS3) as RESET: high (high active) D write_flush(472): Setting pin direction (0x000b) and value (0x0008) T write_flush(484): Set pins command: 80 08 0b 82 00 00 D set_pin(241): Setting pin 3 (ADBUS3) as RESET: low (high active) D write_flush(472): Setting pin direction (0x000b) and value (0x0000) T write_flush(484): Set pins command: 80 00 0b 82 00 00 W avrftdi_program_enable(865): Program enable command not successful. Retrying. D set_pin(241): Setting pin 3 (ADBUS3) as RESET: high (high active) D write_flush(472): Setting pin direction (0x000b) and value (0x0008) T write_flush(484): Set pins command: 80 08 0b 82 00 00 D set_pin(241): Setting pin 3 (ADBUS3) as RESET: low (high active) D write_flush(472): Setting pin direction (0x000b) and value (0x0000) T write_flush(484): Set pins command: 80 00 0b 82 00 00 W avrftdi_program_enable(865): Program enable command not successful. Retrying. D set_pin(241): Setting pin 3 (ADBUS3) as RESET: high (high active) D write_flush(472): Setting pin direction (0x000b) and value (0x0008) T write_flush(484): Set pins command: 80 08 0b 82 00 00 D set_pin(241): Setting pin 3 (ADBUS3) as RESET: low (high active) D write_flush(472): Setting pin direction (0x000b) and value (0x0000) T write_flush(484): Set pins command: 80 00 0b 82 00 00 W avrftdi_program_enable(865): Program enable command not successful. Retrying. D set_pin(241): Setting pin 3 (ADBUS3) as RESET: high (high active) D write_flush(472): Setting pin direction (0x000b) and value (0x0008) T write_flush(484): Set pins command: 80 08 0b 82 00 00 D set_pin(241): Setting pin 3 (ADBUS3) as RESET: low (high active) D write_flush(472): Setting pin direction (0x000b) and value (0x0000) T write_flush(484): Set pins command: 80 00 0b 82 00 00 W avrftdi_program_enable(865): Program enable command not successful. Retrying. D set_pin(241): Setting pin 3 (ADBUS3) as RESET: high (high active) D write_flush(472): Setting pin direction (0x000b) and value (0x0008) T write_flush(484): Set pins command: 80 08 0b 82 00 00 D set_pin(241): Setting pin 3 (ADBUS3) as RESET: low (high active) D write_flush(472): Setting pin direction (0x000b) and value (0x0000) T write_flush(484): Set pins command: 80 00 0b 82 00 00 E avrftdi_program_enable(874): Device is not responding to program enable. Check connection. avrdude_git_msvc main() [main.c:1252] 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 D set_pin(241): Setting pin 3 (ADBUS3) as RESET: high (high active) D write_flush(472): Setting pin direction (0x000b) and value (0x0008) T write_flush(484): Set pins command: 80 08 0b 82 00 00 I avrftdi_close(796): LED Mask=0x0000 value =0x0008 &=0x0000 D write_flush(472): Setting pin direction (0x0000) and value (0x0000) T write_flush(484): Set pins command: 80 00 00 82 00 00 avrdude_git_msvc done. Thank you. ```

Test 3: FAILED: MinGW64 with stock libftdi-1.0/libusb-1.0/WinUSB driver, FT2232H via ISP

C:\work\avr\avrdude_test\avrdude_bin> .\avrdude_git -c ft2232h -p m328p

E avrftdi_program_enable(874): Device is not responding to program enable. Check connection.
avrdude_git 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_git done.  Thank you.

Debug log for MinGW version.

full debug log when using MinGW version with libftdi-1.0 and WinUSB driver, latest git main ``` C:\work\avr\avrdude_test\avrdude_bin> .\avrdude_git -c ft2232h -p m328p -vvvv avrdude_git: Version 7.1-20230322 (7a8d257) 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 Using Port : usb Using Programmer : ft2232h I avrftdi_open(702): Using device VID:PID 0403:6010 and SN '(null)' on interface A. D write_flush(471): Setting pin direction (0x0000) and value (0x0000) T write_flush(483): Set pins command: 80 00 00 82 00 00 I set_frequency(206): Using frequency: 150000 I set_frequency(207): Clock divisor: 0x0027 D avrftdi_check_pins_mpsse(562): Using valid mask mpsse: 0x0000fff8 avrdude_git: : pin is OK avrdude_git: VCC: pin is OK avrdude_git: BUFF: pin is OK avrdude_git: RESET: pin is OK avrdude_git: SCK: pin is OK avrdude_git: SDO: pin is OK avrdude_git: SDI: pin is OK avrdude_git: ERRLED: pin is OK avrdude_git: RDYLED: pin is OK avrdude_git: PGMLED: pin is OK avrdude_git: VFYLED: pin is OK D avrftdi_check_pins_bb(527): Using valid mask bitbanging: 0x0000ffff avrdude_git: : pin is OK avrdude_git: VCC: pin is OK avrdude_git: BUFF: pin is OK avrdude_git: RESET: pin is OK avrdude_git: SCK: pin is OK avrdude_git: SDO: pin is OK avrdude_git: SDI: pin is OK avrdude_git: ERRLED: pin is OK avrdude_git: RDYLED: pin is OK avrdude_git: PGMLED: pin is OK avrdude_git: VFYLED: pin is OK I avrftdi_pin_setup(636): Pin direction mask: 000b I avrftdi_pin_setup(637): Pin value mask: 0000 AVR Part : ATmega328P Chip Erase delay : 9000 us PAGEL : PD7 BS2 : PC2 RESET disposition : possible i/o RETRY pulse : SCK Serial program mode : yes Parallel program mode : yes Timeout : 200 StabDelay : 100 CmdexeDelay : 25 SyncLoops : 32 PollIndex : 3 PollValue : 0x53 Memory Detail : Block Poll Page Polled Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- eeprom 65 20 4 0 no 1024 4 0 3600 3600 0x00 0x00 Block Poll Page Polled Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- flash 65 10 128 0 yes 32768 128 256 4500 4500 0x00 0x00 Block Poll Page Polled Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- lfuse 0 0 0 0 no 1 1 0 4500 4500 0x00 0x00 Block Poll Page Polled Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- hfuse 0 0 0 0 no 1 1 0 4500 4500 0x00 0x00 Block Poll Page Polled Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- efuse 0 0 0 0 no 1 1 0 4500 4500 0x00 0x00 Block Poll Page Polled Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- lock 0 0 0 0 no 1 1 0 4500 4500 0x00 0x00 Block Poll Page Polled Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- signature 0 0 0 0 no 3 1 0 0 0 0x00 0x00 Block Poll Page Polled Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- --------- calibration 0 0 0 0 no 1 1 0 0 0 0x00 0x00 Programmer Type : avrftdi Description : FT2232H based generic programmer D set_pin(238): Setting pin 3 (ADBUS3) as RESET: low (high active) D write_flush(471): Setting pin direction (0x000b) and value (0x0000) T write_flush(483): Set pins command: 80 00 0b 82 00 00 D set_pin(238): Setting pin 0 (ADBUS0) as SCK: low (high active) D write_flush(471): Setting pin direction (0x000b) and value (0x0000) T write_flush(483): Set pins command: 80 00 0b 82 00 00 D set_pin(238): Setting pin 3 (ADBUS3) as RESET: high (high active) D write_flush(471): Setting pin direction (0x000b) and value (0x0008) T write_flush(483): Set pins command: 80 08 0b 82 00 00 D set_pin(238): Setting pin 3 (ADBUS3) as RESET: low (high active) D write_flush(471): Setting pin direction (0x000b) and value (0x0000) T write_flush(483): Set pins command: 80 00 0b 82 00 00 W avrftdi_program_enable(865): Program enable command not successful. Retrying. D set_pin(238): Setting pin 3 (ADBUS3) as RESET: high (high active) D write_flush(471): Setting pin direction (0x000b) and value (0x0008) T write_flush(483): Set pins command: 80 08 0b 82 00 00 D set_pin(238): Setting pin 3 (ADBUS3) as RESET: low (high active) D write_flush(471): Setting pin direction (0x000b) and value (0x0000) T write_flush(483): Set pins command: 80 00 0b 82 00 00 W avrftdi_program_enable(865): Program enable command not successful. Retrying. D set_pin(238): Setting pin 3 (ADBUS3) as RESET: high (high active) D write_flush(471): Setting pin direction (0x000b) and value (0x0008) T write_flush(483): Set pins command: 80 08 0b 82 00 00 D set_pin(238): Setting pin 3 (ADBUS3) as RESET: low (high active) D write_flush(471): Setting pin direction (0x000b) and value (0x0000) T write_flush(483): Set pins command: 80 00 0b 82 00 00 W avrftdi_program_enable(865): Program enable command not successful. Retrying. D set_pin(238): Setting pin 3 (ADBUS3) as RESET: high (high active) D write_flush(471): Setting pin direction (0x000b) and value (0x0008) T write_flush(483): Set pins command: 80 08 0b 82 00 00 D set_pin(238): Setting pin 3 (ADBUS3) as RESET: low (high active) D write_flush(471): Setting pin direction (0x000b) and value (0x0000) T write_flush(483): Set pins command: 80 00 0b 82 00 00 W avrftdi_program_enable(865): Program enable command not successful. Retrying. D set_pin(238): Setting pin 3 (ADBUS3) as RESET: high (high active) D write_flush(471): Setting pin direction (0x000b) and value (0x0008) T write_flush(483): Set pins command: 80 08 0b 82 00 00 D set_pin(238): Setting pin 3 (ADBUS3) as RESET: low (high active) D write_flush(471): Setting pin direction (0x000b) and value (0x0000) T write_flush(483): Set pins command: 80 00 0b 82 00 00 E avrftdi_program_enable(874): Device is not responding to program enable. Check connection. avrdude_git main() [main.c:1252] 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 D set_pin(238): Setting pin 3 (ADBUS3) as RESET: high (high active) D write_flush(471): Setting pin direction (0x000b) and value (0x0008) T write_flush(483): Set pins command: 80 08 0b 82 00 00 I avrftdi_close(795): LED Mask=0x0000 value =0x0008 &=0x0000 D write_flush(471): Setting pin direction (0x0000) and value (0x0000) T write_flush(483): Set pins command: 80 00 00 82 00 00 avrdude_git done. Thank you. ```
mcuee commented 1 year ago

Oops, this is invalid. I reversed SDI and SDO port. I am still used to the MISO and MOSI naming convention.

Note to myself: MOSI is called SDO in avrdude; MISO is called SDI.

@mariusgreuel

After fixing this problem, I can use my FT2232H or similar adapters for ISP, either with the MSVC version (FTDI driver) or MinGW version (WinUSB driver).

1)  WinUSB driver, MinGW, libftdi-1.0
C:\work\avr\avrdude_test\avrdude_bin> .\avrdude_git -c ft4232h -p m328p

avrdude_git: AVR device initialized and ready to accept instructions
avrdude_git: device signature = 0x1e950f (probably m328p)

avrdude_git done.  Thank you.

C:\work\avr\avrdude_test\avrdude_bin> .\avrdude_git -c jtagkey -p m328p

avrdude_git: AVR device initialized and ready to accept instructions
avrdude_git: device signature = 0x1e950f (probably m328p)

avrdude_git done.  Thank you.

2) FTDI vendor driver, MSVC version, avrdude-libftdi
C:\work\avr\avrdude_test\avrdude_bin> .\avrdude_git_msvc -c ft4232h -p m328p

avrdude_git_msvc: AVR device initialized and ready to accept instructions
avrdude_git_msvc: device signature = 0x1e950f (probably m328p)

avrdude_git_msvc done.  Thank you.

C:\work\avr\avrdude_test\avrdude_bin> .\avrdude_git_msvc -c jtagkey -p m328p

avrdude_git_msvc: AVR device initialized and ready to accept instructions
avrdude_git_msvc: device signature = 0x1e950f (probably m328p)

avrdude_git_msvc done.  Thank you.
mcuee commented 1 year ago

No issues with an ATmega32A as well.

PS C:\work\avr\avrdude_test\avrdude_bin> .\avrdude_pr1324v1 -C .\avrdude_pr1324v1.conf -p m32a -c ft4232h -v

avrdude_pr1324v1: Version 7.1-20230320 (6793305)
                  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_pr1324v1.conf

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

                                                    Block Poll               Page                       Polled
                    Memory Type Alias    Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
                    ----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
                    eeprom                  4    20    64    0 no       1024    4      0  9000  9000 0xff 0xff
                    flash                  33    10    64    0 yes     32768  128    256  4500  4500 0xff 0x00
                    lfuse                   0     0     0    0 no          1    1      0  2000  2000 0x00 0x00
                    hfuse                   0     0     0    0 no          1    1      0  2000  2000 0x00 0x00
                    lock                    0     0     0    0 no          1    1      0  2000  2000 0x00 0x00
                    signature               0     0     0    0 no          3    1      0     0     0 0x00 0x00
                    calibration             0     0     0    0 no          4    1      0     0     0 0x00 0x00

                  Programmer Type : avrftdi
                  Description     : FT4232H based generic programmer
                  Pin assignment  : 0..7 = DBUS0..7, 8..15 = CBUS0..7
                    VCC     =  (not used)
                    BUFF    =  (not used)
                    RESET   =  3
                    SCK     =  0
                    SDO     =  1
                    SDI     =  2
                    ERR LED =  (not used)
                    RDY LED =  (not used)
                    PGM LED =  (not used)
                    VFY LED =  (not used)

avrdude_pr1324v1: AVR device initialized and ready to accept instructions
avrdude_pr1324v1: device signature = 0x1e9502 (probably m32a)

avrdude_pr1324v1 done.  Thank you.