bugAVR Downloader/UploaDEr - Bugs: bug #30844, attiny45 + arduino programmer...

 
 

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

bug #30844: attiny45 + arduino programmer won't verify

Submitter:  None
Submitted:  Sun 22 Aug 2010 09:51:42 PM UTC
   
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Works For Me Privacy:  Public
Assigned to:  joerg_wunsch Originator Name:  Mat Scull
Originator Email:  -email is unavailable- Open/Closed:  Closed
Release:  None Programmer hardware: 
Device type: 

Jump to the original submission

Wed 25 Aug 2010 09:47:55 PM UTC, comment #8: 

Thanks for trying with a stk500. I'm still a bit confused though. Looking at the log files below, it appears that avrdude isn't sending the same data in both cases. Surely if the difference between the devices is the number of words per page (page 154 of http://www.atmel.com/dyn/resources/prod_documents/doc2586.pdf) then avrdude should be writing the same locations?

Lines 29 (log) ##################avrdude: Send: U [55]   [20] . [00]   [20]

and 38 (log2) #########avrdude: Send: U [55] . [10] . [00]   [20]

should be the same shouldn't they?

Mat Scull <breadboards>
Wed 25 Aug 2010 05:36:21 AM UTC, comment #7: 

Well, if you've got a pagesize of 32 bytes, you are going
to program 32 bytes into address 0x0000, then 32 bytes into
0x0020, then 32 bytes into 0x0040, and so on.

If you pretend a pagesize of 16 bytes, you are going to program
16 bytes into 0x0000, then 16 bytes into 0x0010, then 16 bytes
into 0x0020, and so on.  That's the differences in the
addresses you are seeing.

Joerg Wunsch <joerg_wunsch>
Group administrator
Tue 24 Aug 2010 10:21:37 PM UTC, comment #6: 

Thanks for trying with a stk500. I'm still a bit confused though. Looking at the log files below, it appears that avrdude isn't sending the same data in both cases. Surely if the difference between the devices is the number of words per page (page 154 of http://www.atmel.com/dyn/resources/prod_documents/doc2586.pdf) then avrdude should be writing the same locations?

Lines 29 (log) ##################avrdude: Send: U [55]   [20] . [00]   [20]

and 38 (log2) #########avrdude: Send: U [55] . [10] . [00]   [20]

should be the same shouldn't they?

Mat Scull <breadboards>
Tue 24 Aug 2010 09:00:21 AM UTC, comment #5: 

As a final check, I reprogrammed my STK500 with the final
version of the Atmel v1.x firmware.  I had no problems
flashing the ATtiny45 using the existing t45 description
in avrdude.conf.

Joerg Wunsch <joerg_wunsch>
Group administrator
Mon 23 Aug 2010 10:27:36 AM UTC, comment #4: 

Thanks for that - over to the mega-isp people..

Mat Scull <breadboards>
Mon 23 Aug 2010 09:28:15 AM UTC, comment #3: 

I'm sorry, I'm afraid the fault is within your programmer's STK500
implementation.  The only difference between the two files is that
when pretending an ATtiny25, only half the pagesize is used both,
during initialization as well as within the Cmnd_STK_PROG_PAGE
commands.  The page sizes used are correct with respect to the
device's datasheet though, so it's even more surprising that
pretending the device to be an ATtiny25 does actually work at all
(page programming there is started with only half the data of an
actual flash page).

There is one flaw in the entire protocol, this is the so-called
"devicecode".  The Atmel appnote AVR061 (which describes the v1.x
STK500 protocol) mentions that this code were according to the file
"devices.h", but as this protocol version has been discontinued years
ago, the most recent AVRs mentioned in the file are the ATmega169 and
ATmega128, respectively.  (The file dates 2002-09-09.)  So, for those
who still wish to use STK500v1 for whatever reason, avrdude.conf has
to invent a "devicecode" of its own, which is 0x14 for both, the
ATtiny25 as well as the ATtiny45.  Maybe your programmer is stumbling
across that?  Normally, I'd expect any sane programmer implementation
to simply ignore that value these days.

Joerg Wunsch <joerg_wunsch>
Group administrator
Mon 23 Aug 2010 09:00:57 AM UTC, comment #2: 

Uploaded -vvvv files.

Additionally, I've posted the files read back from the t45 when programmed at t45 and t25. You can see in this file (and the -vvvv files) where the hex is not being sent to fill the incorrect locations and they stay as 'ff'. I'm suspecting a tiny flaw in avrdude.conf but can't find it...

Mat Scull <breadboards>
Mon 23 Aug 2010 04:15:09 AM UTC, comment #1: 

Please run AVRDUDE with -vvvv for both -p options, save the
output into a file:

avrdude ... 2> logfile.txt 1>&2

and attach these files to this bug tracker.

Joerg Wunsch <joerg_wunsch>
Group administrator
Sun 22 Aug 2010 09:51:42 PM UTC, original submission:  

I'm using avrdude 5.10 with an arduino diecimila connected to an attiny45 over spi as detailed at http://www.uchobby.com/index.php/2007/11/04/arduino-avr-in-system-programmer-isp/

The arduino is running avr-isp v3 from http://code.google.com/p/mega-isp/

I have a small file 174 byte hello world program that I'm testing with. If I force avrdude to program the t45 as a t25, it programs, verifys and runs fine. If I specify t45, it fails to verify at 0x00.

This fails -
avrdude -P com4 -p t45 -c avrisp -U flash:w:hello_world\default\hello_world.hex:i

This verifys and runs
avrdude -P com4 -p t25 -c avrisp -U flash:w:hello_world\default\hello_world.hex:i -F

I can read the code back from both methods and see that there is corruption in the t45 version.

hello_world.hex programmed as 45 read as 45

:20000000 000015C014C013C012C011C010C00FC00EC00DC00CC00BC00AC009C008C0112460
:20002000 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF8FEF87BB29E130E074E068E050E140E207
:20004000 18B280E197E2F9013197F1F70197D9F778BB80E197E2F9013197F1F70197D9F7CB
:20006000 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF58BB80E197E2F9013197F1F70197D9F791
:20008000 48BB80E197E2F9013197F1F70197D9F7D7CF80E197E229E130E0F9013197F1F72D
:00000001 FF


hello_world.hex programmed as 25 read as 45

:20000000 0EC015C014C013C012C011C010C00FC00EC00DC00CC00BC00AC009C008C0112492
:20002000 1FBECFE5D1E0DEBFCDBF02D03EC0E8CF8FEF87BB29E130E074E068E050E140E205
:20004000 18BA80E197E2F9013197F1F70197D9F778BB80E197E2F9013197F1F70197D9F7C3
:20006000 68BB80E197E2F9013197F1F70197D9F758BB80E197E2F9013197F1F70197D9F772
:20008000 48BB80E197E2F9013197F1F70197D9F7D7CF80E197E229E130E0F9013197F1F72D
:0E00A000 0197D9F781E090E00895F894FFCF22
:00000001 FF


First byte wrong, lots of FFs where there shouldn't be. I have been through avrdude.conf with a fine toothed comb and can't find the offending bit. It's the version that comes with WinAVR-20100110-install.exe

Any help would be much appreciated - I've been stuck here for days!

Thanks

Mat

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #21279:  log3.txt added by breadboards (944B - text/plain - log3 shows files read back from t45 when programmed as t25 and t45)
file #21277:  log2.txt added by breadboards (17KiB - text/plain - 1st file is t25, works. 2nd file is non working t45.)
file #21278:  log.txt added by breadboards (16KiB - text/plain - 1st file is t25, works. 2nd file is non working t45.)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by breadboards (Updated the item)
  • -email is unavailable- added by joerg_wunsch (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-08-24 joerg_wunsch StatusNeed Info Works For Me
        Assigned toNone joerg_wunsch
        Open/ClosedOpen Closed
    2010-08-23 breadboards Attached File- Added log3.txt, #21279
    2010-08-23 breadboards Attached File- Added log2.txt, #21277
        Attached File- Added log.txt, #21278
    2010-08-23 joerg_wunsch StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-caa5.
    Corresponding source code