platformio / platformio/platformio-docs

avrdude upload error. content mismatch

Open
#198 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
285
Forks
357
PR merge metrics
No merged PRs in 30d

Description

Hi. I suppouse the problem is in erase flag. I use buton PlatformIO:Upload
Platformio.ini:

[env:megaatmega2560]
platform = atmelavr
board = megaatmega2560
board_build.f_cpu = 8000000L
board_build.mcu = atmega2560

framework = arduino
upload_protocol = usbasp -B4.0

This is verbose output of upload command:

Total                      9591
<lambda>(["upload"], [".pio\build\megaatmega2560\firmware.hex"])
AVAILABLE: usbasp -B4.0
CURRENT: upload_protocol = usbasp -B4.0
BeforeUpload(["upload"], [".pio\build\megaatmega2560\firmware.hex"])
avrdude -v -p atmega2560 -C C:\Users\Me\.platformio\packages\tool-avrdude\avrdude.conf -c usbasp -B4.0 -D -U flash:w:.pio\build\megaatmega2560\firmware.hex:i

avrdude: Version 5.11-Patch#7610, compiled on Aug 31 2011 at 08:02:19
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Users\Me\.platformio\packages\tool-avrdude\avrdude.conf"

         Using Port                    : lpt1
         Using Programmer              : usbasp
         Setting bit clk period        : 4.0
         AVR Part                      : ATMEGA2560
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PA0
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    10     8    0 no       4096    8      0  9000  9000 0x00 0x00
           flash         65    10   256    0 yes    262144  256   1024  4500  4500 0x00 0x00
           lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : usbasp
         Description     : USBasp, http://www.fischl.de/usbasp/

avrdude: set SCK frequency to 187500 Hz
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9801
avrdude: safemode: lfuse reads as 62
avrdude: safemode: hfuse reads as 99
avrdude: safemode: efuse reads as FF
avrdude: reading input file ".pio\build\megaatmega2560\firmware.hex"
avrdude: writing flash (1548 bytes):

Writing | ################################################## | 100% 0.98s

avrdude: 1548 bytes of flash written
avrdude: verifying flash memory against .pio\build\megaatmega2560\firmware.hex:
avrdude: load data flash data from input file .pio\build\megaatmega2560\firmware.hex:
avrdude: input file .pio\build\megaatmega2560\firmware.hex contains 1548 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 0.63s

avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x0002
         0x17 != 0x01
avrdude: verification error; content mismatch

avrdude: safemode: lfuse reads as 62
avrdude: safemode: hfuse reads as 99
avrdude: safemode: efuse reads as FF
avrdude: safemode: Fuses OK

avrdude done.  Thank you.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the supplied platformio.ini and the verbose avrdude upload output, especially the device signature, write, and verification lines. Done means identifying a reproducible cause for the byte mismatch and documenting a supported configuration or resolution; the issue names no target file or test.

Written by the indexing model from the issue text.

Assessment

Tech stack
arduino
Domain
embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.