microchip-pic-avr-tools / pymcuprog

a Python utility for programming various Microchip MCU devices using Microchip CMSIS-DAP based debuggers
MIT License
98 stars 22 forks source link

Strange Attiny424 HV programming issue #48

Open lsellens opened 2 months ago

lsellens commented 2 months ago

I grabbed a HV Programmer to play around with some fuse settings and I'm having an issue with one particular chip. It's a attiny424. It will not program with pymcuprog in HV mode. I can read/write fuses and upload code with avrdude using this same HV programmer but anytime I try to use pymcuprog I get this error

raise PymcuprogError("Unexpected number of bytes in response: "
pymcuprog.pymcuprog_errors.PymcuprogError: Unexpected number of bytes in response: 0 byte(s) expected 1 byte(s)
Failed programming: uploading error: exit status 1

I can read/write other chips with this same HV programmer and pymcuprog just fine. I can also read/write to this chip with pymcuprog with a non HV programmer with no issues. It's just something particular about the combination of this chip with pymcuprog and HV programming. I'm thoroughly confused.

xedbg commented 1 month ago

@lsellens - using SerialUPDI with HV activation is tricky. It looks like the device is not responding to a LDCS request, in other words UPDI is probably not enabled. Although these tiny devices are very similar, there have been changes to the UPDI activation (check errata / datasheet clarifications) which might be affecting timing. AvrDude could have a plausible advantage with timing constraints over Python solutions like pymcuprog.