avrdude
avrdude copied to clipboard
[bug #59667] verification error; content mismatch
Johan Olin [email protected] Sat 12 Dec 2020 08:33:30 PM UTC Programmer hardware: avrisp MKII Device type: ATTiny15
avrdude -p t15 -c avrispmkii -U flash:w:file.hex
Results in the dreaded 'verification error; content mismatch' error ...
Seems like only the high byte gets written ?
Reading back gives
Writing to eeprom seems to work fine !
And v6.3 works perfect with a Mega168.
Had to install avrdude 6.1 to program the Tiny15. Tried 6.2 which also failed ...
This issue was migrated from https://savannah.nongnu.org/bugs/?59667
Hopefully someone has an ATtiny15 to test this out as this is reported as a regression (avrdude 6.1 works but not 6.2/6.3).
I have some exotic stuff like an ATtiny11 (HVSP only device :-o ) and ATtiny22L, but no '15 over here.
Found a Polish seller on ebay, ordered some.
I can basically confirm that the current stk500v2 code has issues with these old chips. I do not get any programming communication at all with either an STK500v2 (+ USB adapter), or an AVRISPmkII – all result in USB receive timeouts. Using an FT245R bitbang adapter, I can successfully program the ATtiny15 though.
This is probably a similar case from AT90S part as ATtiny15L is obsolete too.
Ref: https://www.avrfreaks.net/forum/many-attinys-discontinued (post in 2007)
The ATtiny11 and ATtiny12 were both replaced by the more feature-rich, pin-compatible ATtiny13. The ATtiny15 was replaced by the ATtiny25 in a special compatibility mode. The ATtiny25 is part of a new, more feature-rich sub-family including the ATtiny45 and ATtiny85. The ATtiny26 was replaced by the more feature-rich and pin-compatible ATtiny261/ATtiny461/ATtiny861 sub-family.
ATtiny22L is probably replaced by ATtiny25 as well.
I just spent a bit more time on it: it works up to release 6.3. Starting with 6.4, it broke.
Unfortunately, it's a long period of time between both.
Sorry, I didn't look correctly.
Indeed, v6.3 causes that "verification error".
(With v6.4, the entire communication broke then.)
v6.2 is also broken.
Given that the major change in v6.2 in the stk500v2 implementation was the demission of the SPI_MULTI
command, I guess that's where the breakage was introduced.
This gets a bit complicated.
The older AVRs that don't have paged flash used to have a single "write program memory" low-level ISP command where the low and high bytes of flash memory could be written individually. This was used up to v6.2 with the SPI_MULTI
command (ISP passthrough).
However, the STK500v2 protocol only offers CMD_PROGRAM_FLASH_ISP
which assumes a prior CMD_LOAD_ADDRESS
command to describe the address. For word-oriented flash, this address is a 16-bit word address though, so there's no option to individually address single (odd) bytes in flash that way.
However, AVRDUDE can right now only distinguish between "paged mode" and "byte mode" - there is no 16-bit word mode at all inside.
Looks like #433 and #500 have the same root cause (old AT90S8115 and AT90S8535)
- #433
- #500
Maybe @stefanrueger can have a look at this? I know I have an ATtiny15 somewhere, so I can help out with testing.
@MCUdude Is that still a problem? A lot has changed since September. I'd hazard a guess that it works now.
I'm occasionally able to read the device signature and flash memory. However, I'm not able to write anything using an AVRISPmkII.
I've double-checked with a USBasp programmer, and the chip isn't defective.
(Here I've written 256 0xAA's using the USBasp programmer before dumping the flash contents).
$ ./avrdude -cavrispmkii -pattiny15 -Uflash:r:-:I
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e9006 (probably t15)
avrdude: reading flash memory ...
Reading | ################################################## | 100% 0.56 s
avrdude: writing output file <stdout>
:20000000AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA0 // 00000> ********************************
:20002000AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA80 // 00020> ********************************
:20004000AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA60 // 00040> ********************************
:20006000AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA40 // 00060> ********************************
:20008000AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA20 // 00080> ********************************
:2000A000AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA00 // 000a0> ********************************
:2000C000AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAE0 // 000c0> ********************************
:2000E000AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAC0 // 000e0> ********************************
:00000001FF
avrdude done. Thank you.
$ ./avrdude -cavrispmkii -pattiny15 -Uflash:w:0x55_256b.hex:i
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e9006 (probably t15)
avrdude: Note: flash memory has been specified, an erase cycle will be performed.
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: reading input file 0x55_256b.hex for flash
with 256 bytes in 1 section within [0, 0xff]
avrdude: writing 256 bytes flash ...
Writing | -------------------------------------------------- | 0% 10.00 s
avrdude error: unable to receive from USB
^C
So unable to reproduce the original problem right now (only high bytes are written) and unable to check whether numerous updates in the last 6 months have sorted this issue (never mind the unable to receive from USB which seems unrelated).
Here are the output logs when uploading using -vvvv.
BTW, the schematic for the test board I'm using is this. I've removed R7 and R11, and is powering the board via USB. MicroCore development board R2 schematic
ATtiny15 AVRISPmkII upload attempt (-vvvv)
$ ./avrdude -cavrispmkii -pattiny15 -Uflash:w:test_avrdude_info_1k.hex:i -vvvv
avrdude: Version 7.1-20230108
Copyright the AVRDUDE authors;
see https://github.com/avrdudes/avrdude/blob/main/AUTHORS
System wide configuration file is /Users/hans/Downloads/avrdude/src/avrdude.conf
User configuration file is /Users/hans/.avrduderc
Using Port : usb
Using Programmer : avrispmkii
avrdude: usbdev_open(): found AVRISP mkII, serno: 000200124552
avrdude: sent: . [01]
avrdude: recv: . [01] . [00] . [0a] A [41] V [56] R [52] I [49] S [53] P [50] _ [5f] M [4d] K [4b] 2 [32]
avrdude: stk500v2_getsync(): found AVRISP mkII programmer
AVR Part : ATtiny15
Chip Erase delay : 8200 us
RESET disposition : dedicated
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 64 1 0 8200 8200 0xff 0xff
Block Poll Page Polled
Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
flash 4 10 128 0 no 1024 1 0 4100 4100 0xff 0x00
Block Poll Page Polled
Memory Type Alias Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
----------- -------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
fuse 0 0 0 0 no 1 1 0 9000 9000 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 9000 9000 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 : STK500V2
Description : Atmel AVR ISP mkII
Programmer Model: AVRISP mkII
avrdude: sent: . [03] . [90]
avrdude: recv: . [03] . [00] . [01]
avrdude: sent: . [03] . [91]
avrdude: recv: . [03] . [00] . [01]
avrdude: sent: . [03] . [92]
avrdude: recv: . [03] . [00] . [18]
Hardware Version: 1
Serial number : 000200124552
Firmware Version Controller : 1.24
avrdude: sent: . [03] . [94]
avrdude: recv: . [03] . [00] 6 [36]
Vtarget : 5.4 V
avrdude: sent: . [03] . [98]
avrdude: recv: . [03] . [00] . [06]
SCK period : 8.00 us
avrdude: sent: . [10] . [c8] d [64] . [19] [20] . [00] S [53] . [03] . [ac] S [53] . [00] . [00]
avrdude: recv: . [10] . [00]
avrdude: AVR device initialized and ready to accept instructions
Reading | | 0% 0.00 s avrdude: stk500isp_read_byte(.., signature, 0x0, ...)
avrdude: stk500isp_read_byte(): sending read memory command: avrdude: sent: . [1b] . [04] 0 [30] . [00] . [00] . [00]
avrdude: recv: . [1b] . [00] . [1e] . [00]
avrdude: stk500isp_read_byte(.., signature, 0x1, ...)
avrdude: stk500isp_read_byte(): sending read memory command: avrdude: sent: . [1b] . [04] 0 [30] . [00] . [01] . [00]
avrdude: recv: . [1b] . [00] . [90] . [00]
Reading | ################# | 33% 0.00 s avrdude: stk500isp_read_byte(.., signature, 0x2, ...)
avrdude: stk500isp_read_byte(): sending read memory command: avrdude: sent: . [1b] . [04] 0 [30] . [00] . [02] . [00]
avrdude: recv: . [1b] . [00] . [06] . [00]
Reading | ################################################## | 100% 0.00 s
avrdude: device signature = 0x1e9006 (probably t15)
avrdude: Note: flash memory has been specified, an erase cycle will be performed.
To disable this feature, specify the -D option.
avrdude: erasing chip
avrdude: sent: . [12] . [08] . [00] . [ac] . [80] . [00] . [00]
avrdude: recv: . [12] . [00]
avrdude: sent: . [10] . [c8] d [64] . [19] [20] . [00] S [53] . [03] . [ac] S [53] . [00] . [00]
avrdude: recv: . [10] . [00]
avrdude: reading input file test_avrdude_info_1k.hex for flash
with 524 bytes in 1 section within [0, 0x20b]
avrdude: writing 524 bytes flash ...
Writing | | 0% 0.00 s avrdude: stk500isp_write_byte(.., flash, 0x0, ...)
avrdude: sent: . [06] . [00] . [00] . [00] . [00]
avrdude: recv: . [06] . [00]
avrdude: sent: . [14] . [00] . [01] [20]
avrdude: usbdev_recv_frame(): usb_bulk_read(): Operation timed out
Writing | -------------------------------------------------- | 0% 10.00 s
avrdude stk500v2_recv_mk2() [stk500v2.c:517] error: unable to receive from USB
avrdude: sent: . [01]
avrdude: usbdev_recv_frame(): usb_bulk_read(): Operation timed out
avrdude stk500v2_recv_mk2() [stk500v2.c:517] error: unable to receive from USB
avrdude: sent: . [01]
avrdude: usbdev_recv_frame(): usb_bulk_read(): Operation timed out
avrdude stk500v2_recv_mk2() [stk500v2.c:517] error: unable to receive from USB
avrdude: sent: . [01]
avrdude: usbdev_recv_frame(): usb_bulk_read(): Operation timed out
avrdude stk500v2_recv_mk2() [stk500v2.c:517] error: unable to receive from USB
avrdude: sent: . [01]
avrdude: usbdev_recv_frame(): usb_bulk_read(): Operation timed out
avrdude stk500v2_recv_mk2() [stk500v2.c:517] error: unable to receive from USB
avrdude: sent: . [01]
avrdude: usbdev_recv_frame(): usb_bulk_read(): Operation timed out
avrdude stk500v2_recv_mk2() [stk500v2.c:517] error: unable to receive from USB
avrdude: sent: . [01]
avrdude: usbdev_recv_frame(): usb_bulk_read(): Operation timed out
avrdude stk500v2_recv_mk2() [stk500v2.c:517] error: unable to receive from USB
avrdude stk500v2_getsync() [stk500v2.c:764] error: timeout communicating with programmer
avrdude: sent: . [14] . [00] . [01] [20]
avrdude: usbdev_recv_frame(): usb_bulk_read(): Operation timed out
avrdude stk500v2_recv_mk2() [stk500v2.c:517] error: unable to receive from USB
avrdude: sent: . [01]
avrdude: usbdev_recv_frame(): usb_bulk_read(): Operation timed out
avrdude stk500v2_recv_mk2() [stk500v2.c:517] error: unable to receive from USB
avrdude: sent: . [01]
avrdude: usbdev_recv_frame(): usb_bulk_read(): Operation timed out
avrdude stk500v2_recv_mk2() [stk500v2.c:517] error: unable to receive from USB
avrdude: sent: . [01]
avrdude: usbdev_recv_frame(): usb_bulk_read(): Operation timed out
avrdude stk500v2_recv_mk2() [stk500v2.c:517] error: unable to receive from USB
avrdude: sent: . [01]
avrdude: usbdev_recv_frame(): usb_bulk_read(): Operation timed out
avrdude stk500v2_recv_mk2() [stk500v2.c:517] error: unable to receive from USB
avrdude: sent: . [01]
avrdude: usbdev_recv_frame(): usb_bulk_read(): Operation timed out
avrdude stk500v2_recv_mk2() [stk500v2.c:517] error: unable to receive from USB
avrdude: sent: . [01]
avrdude: usbdev_recv_frame(): usb_bulk_read(): Operation timed out
avrdude stk500v2_recv_mk2() [stk500v2.c:517] error: unable to receive from USB
avrdude stk500v2_getsync() [stk500v2.c:764] error: timeout communicating with programmer
avrdude: sent: . [14] . [00] . [01] [20]
avrdude: usbdev_recv_frame(): usb_bulk_read(): Operation timed out
avrdude stk500v2_recv_mk2() [stk500v2.c:517] error: unable to receive from USB
avrdude: sent: . [01]
avrdude: usbdev_recv_frame(): usb_bulk_read(): Operation timed out
avrdude stk500v2_recv_mk2() [stk500v2.c:517] error: unable to receive from USB
avrdude: sent: . [01]
avrdude: usbdev_recv_frame(): usb_bulk_read(): Operation timed out
avrdude stk500v2_recv_mk2() [stk500v2.c:517] error: unable to receive from USB
avrdude: sent: . [01]
avrdude: usbdev_recv_frame(): usb_bulk_read(): Operation timed out
avrdude stk500v2_recv_mk2() [stk500v2.c:517] error: unable to receive from USB
avrdude: sent: . [01]
avrdude: usbdev_recv_frame(): usb_bulk_read(): Operation timed out
avrdude stk500v2_recv_mk2() [stk500v2.c:517] error: unable to receive from USB
avrdude: sent: . [01]
avrdude: usbdev_recv_frame(): usb_bulk_read(): Operation timed out
avrdude stk500v2_recv_mk2() [stk500v2.c:517] error: unable to receive from USB
avrdude: sent: . [01]
^C
ATtiny15 PICkit4 upload attempt (-vvvv)
The output log is too long, so I had to paste it over at gist.github.com instead: https://gist.github.com/MCUdude/cea0bd6ead93485eae5260609f63dc60
EDIT: For reference, the input file looks like this:
$ ./avrdude -cusbasp -pattiny15 -Uflash:r:-:I
avrdude: AVR device initialized and ready to accept instructions
avrdude: device signature = 0x1e9006 (probably t15)
avrdude: reading flash memory ...
Reading | ################################################## | 100% 0.83 s
avrdude: writing output file <stdout>
:20000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00 // 00000> ................................
:20002000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0 // 00020> ................................
:2000400041565244554445202D2041565220446F776E6C6F616465722055706C6F61646526 // 00040> AVRDUDE_-_AVR_Downloader_Uploade
:2000600072202D20697320612070726F6772616D20666F7220646F776E6C6F6164696E670F // 00060> r_-_is_a_program_for_downloading
:2000800020616E642075706C6F6164696E6720746865206F6E2D63686970206D656D6F72BB // 00080> _and_uploading_the_on-chip_memor
:2000A000696573206F66204D6963726F63686970E280997320415652206D6963726F636FC9 // 000a0> ies_of_Microchipb..s_AVR_microco
:2000C0006E74726F6C6C6572732E2049742063616E2070726F6772616D2074686520466C93 // 000c0> ntrollers._It_can_program_the_Fl
:2000E00061736820616E6420454550524F4D2C20616E6420776865726520737570706F7206 // 000e0> ash_and_EEPROM,_and_where_suppor
:20010000746564206279207468652070726F6772616D6D696E672070726F746F636F6C2CC5 // 00100> ted_by_the_programming_protocol,
:200120002069742063616E2070726F6772616D206675736520616E64206C6F636B2062697E // 00120> _it_can_program_fuse_and_lock_bi
:2001400074732E204156524455444520616C736F20737570706C69657320612064697265B6 // 00140> ts._AVRDUDE_also_supplies_a_dire
:20016000637420696E737472756374696F6E206D6F646520616C6C6F77696E67206F6E6522 // 00160> ct_instruction_mode_allowing_one
:2001800020746F20697373756520616E792070726F6772616D6D696E6720696E7374727523 // 00180> _to_issue_any_programming_instru
:2001A0006374696F6E20746F20746865204156522063686970207265676172646C657373A5 // 001a0> ction_to_the_AVR_chip_regardless
:2001C000206F662077686574686572204156524455444520696D706C656D656E74732074F6 // 001c0> _of_whether_AVRDUDE_implements_t
:2001E0006861742073706563696669632066656174757265206F6620612070617274696337 // 001e0> hat_specific_feature_of_a_partic
:0C020000756C617220636869702E00FF4D // 00200> ular_chip...
:00000001FF
avrdude done. Thank you.
@MCUdude
I have placed an order for two ATtiny15L SMD chips but they will only arrive in about a month time (using sea shipment).
Just wondering if you can try avrdude 6.2 and 6.3 version to see if that works or not. As per the earlier comments by Joerg, version 6.2 is supposed to work but not 6.3.
I have placed an order for two ATtiny15L SMD chips but they will only arrive in about a month time (using sea shipment).
@MCUdude Unfortunately the vendor cancelled my order as they do not have stock. Sorry I can not test this one.
Help wanted from the community. PR is welcome.
@MCUdude
Please check whether terminal mode works or not.
Then please try #1386 using both CLI mode the terminal mode.
In #500, it is said that terminal mode may work.
- #500