bugAVR Downloader/UploaDEr - Bugs: bug #48131, Problem with EEprom address of...


You are not allowed to post comments on this tracker with your current authentication level.

bug #48131: Problem with EEprom address of avrdude for different processors!

Submitted by:  Karl-Heinz Kuebbeler <kh_kuebbbeler>
Submitted on:  Sat 04 Jun 2016 06:06:37 PM UTC  
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Confirmed Privacy:  Public
Assigned to:  Brian Dean <bdean> Originator Name:  kh_kuebbeler
Open/Closed:  Open Release:  None
Programmer hardware:  Device type: 

Tue 24 Jul 2018 05:39:34 AM UTC, comment #2:

Hmm. Also breaks the ability to read or write EEPROM to ATMEGA8 using the Arduino as ISP sketch, which is expecting the addresses in the STK500 "Load Address" command to be word addresses (as it is for the m328.)

Bill Westfield <westfw>
Sat 04 Jun 2016 06:29:52 PM UTC, comment #1:

The problem is apparently that piece of code in stk500.c:

Later on, a_div is used to determine whether the address in
the load command needs to be divided by 2:

(Similar code exists in both, stk500_paged_write() as well as

I think the intention was to divide the load address by 2 when
accessing flash. Now, the ATmega328 entry (as well as others)
has an AVR_OP_LOADPAGE_LO instruction even in the EEPROM memory
section. Thus, load addresses are halved for it when accessing

If the only decision needed is whether flash or EEPROM is going
to be accessed, my suggestion is to combine that with the 'F' and
'E' decision a few lines before:

Joerg Wunsch <joerg_wunsch>
Project Administrator
Sat 04 Jun 2016 06:06:37 PM UTC, original submission:

I have found out, that the address of EEprom load with the stk500v1 protocol is send as word address for the target ATmega328 and as a byte address for the target ATmega8.
I have build a bootloader from the optiboot source in assembly language with additional EEprom support, which match in a 512 byte page.
If I handle the transmitted address different for the ATmega328 and
the ATmega8, all works well. For the ATmega328 I must multiply the
transmitted address by 2.
The problem is already reported at https://www.mikrocontroller.net/topic/398978 in german language. Joerg Wunsch has this information already.
I can handle the different address type in my bootloader version,
if I know, which processors use the byte address (mega8, mega16, mega32, ...). But what is with other transfer programs as avrdude?
The AVR061 from Atmel does not specify the address type of the
Cmnd_STK_LOAD_ADDRESS command.

Karl-Heinz Kuebbeler <kh_kuebbbeler>


No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by westfw (Posted a comment)
  • -email is unavailable- added by joerg_wunsch (Posted a comment)
  • -email is unavailable- added by kh_kuebbbeler (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-06-04 joerg_wunsch StatusNone => Confirmed
        Assigned toNone => bdean

    Back to the top

    Powered by Savane 3.4