SpenceKonde / AVR-Guidance

A guide to best practices when using the Arduino IDE to program AVR microcontrollers
142 stars 21 forks source link

Can't burn bootloader #20

Closed avandalen closed 3 months ago

avandalen commented 3 months ago

I have been trying to burn a bootloader into an ATtiny3217 for quite some time now. It does not work. With an unprogrammed, new ATtiny3217, I can burn the bootloader, without an error message, but it does not work, there is no RX communication back from the ATtiny. The UPDI pin was set as reset.

Now I want to burn a bootloader again in the ATtiny3217 with a HV programmer (because the UPDI pin was reset), this doesn't work either. Here are the settings:

Burn bootloader Settings ATtiny3217 with optiboot

This is the error message when burning the bootloader:

SerialUPDI UPDI programming for Arduino using a serial adapter Based on pymcuprog, with significant modifications By Quentin Bolsee and Spence Konde Version 1.2.3 - Jan 2022 Using serial port COM4 at 57600 baud. Target: attiny3217 Set fuses: ['0:0x00', '1:0x00', '2:0x01', '5:0b11000100', '6:0x04', '7:0x00', '8:0x02'] Action: write File: C:\Users\Albert\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.10/bootloaders/hex/optiboot_txyz_all8sec.hex Traceback (most recent call last): File "C:\Users\Albert\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.10/tools/prog.py", line 286, in <module> main() File "C:\Users\Albert\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.10/tools/prog.py", line 128, in main return_code = pymcuprog_basic(args, fuses_dict) File "C:\Users\Albert\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.10/tools/prog.py", line 201, in pymcuprog_basic args_start) File "C:\Users\Albert\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.10\tools\libs\pymcuprog\pymcuprog_main.py", line 545, in _start_session backend.start_session(sessionconfig) File "C:\Users\Albert\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.10\tools\libs\pymcuprog\backend.py", line 362, in start_session sessionconfig.interface_speed) File "C:\Users\Albert\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.10\tools\libs\pymcuprog\programmer.py", line 83, in setup_device options=self.options) File "C:\Users\Albert\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.10\tools\libs\pymcuprog\nvm.py", line 42, in get_nvm_access_provider accessprovider = NvmAccessProviderSerial(transport, device_info, baud=frequency, options=options) File "C:\Users\Albert\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.10\tools\libs\pymcuprog\nvmserialupdi.py", line 57, in __init__ self.avr.read_device_info() File "C:\Users\Albert\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.10\tools\libs\pymcuprog\serialupdi\application.py", line 125, in read_device_info self.logger.info("PDI revision = 0x%02X", self.readwrite.read_cs(constants.UPDI_CS_STATUSA) >> 4) File "C:\Users\Albert\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.10\tools\libs\pymcuprog\serialupdi\readwrite.py", line 25, in read_cs return self.datalink.ldcs(address) File "C:\Users\Albert\AppData\Local\Arduino15\packages\megaTinyCore\hardware\megaavr\2.6.10\tools\libs\pymcuprog\serialupdi\link.py", line 88, in ldcs "{} byte(s) expected {} byte(s)".format(numbytes_received, self.LDCS_RESPONSE_BYTES)) pymcuprog.pymcuprog_errors.PymcuprogError: Unexpected number of bytes in response: 0 byte(s) expected 1 byte(s) Error while burning bootloader.

This is the HV puls and the DTR signal on the scope:

Scope HV pulse and DTR RigolDS3

In 2020, burning the bootloader worked fine and I wrote an article about it: https://avdweb.nl/arduino/attiny3217/bootloader-attiny3217

avandalen commented 3 months ago

This issue was posted an a wrong location