STK500 weirdness: timeouts and verification errors

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

Today my STK500 started to spit out errors when programming any AVR. The writing phase works fine, but when reading I get timeouts and verification errors:

avr-objcopy -O ihex -R .eeprom main.elf main.hex
avrdude -c stk500 -p atmega168 -P /dev/ttyUSB0 -e -U flash:w:main.hex

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.11s

avrdude: Device signature = 0x1e9406
avrdude: erasing chip
avrdude: reading input file "main.hex"
avrdude: input file main.hex auto detected as Intel Hex
avrdude: writing flash (240 bytes):

Writing | ################################################## | 100% 6.71s

avrdude: 240 bytes of flash written
avrdude: verifying flash memory against main.hex:
avrdude: load data flash data from input file main.hex:
avrdude: input file main.hex auto detected as Intel Hex
avrdude: input file main.hex contains 240 bytes
avrdude: reading on-chip flash data:

Reading |                                                    | 0% 0.00savrdude: stk500_2_ReceiveMessage(): timeout
avrdude: stk500_2_ReceiveMessage(): timeout
Reading | ################################################## | 100% 11.63s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x00be
         0x18 != 0x1c
avrdude: verification error; content mismatch

avrdude: safemode: Fuses OK

avrdude done.  Thank you.

What might be the cause of this? I've checked the fuses, tried with different AVRs, but still the same.

Also, programming in general seems very slow - 7 seconds for writing 240 bytes of flash? I don't know, but I believe it used to go faster than that...

- Johannes

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Fixed it! Seems like the "SCK period" parameter had been set to 276.7 us, which is what caused the slowness. Running avrdude with -B 1 solved the problem, and automatically saved this parameter as well :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Nice! Found this solution from a google search when I encountered this problem, solved it for me too. It started after i ran a chip erase (-e), but i don't understand why this would affect SCK period settings. Anyone that could explain this?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello, can someone tell me what the SCK period setting is and where I can find it. I am having the same problem. Also what is -B 1 and how can I apply it to my issue.

Thank you