Pages: 1 2 [3]   Go Down
Author Topic: Mega 2560 R3, eXtreme Burner and AVR Programmer  (Read 5500 times)
0 Members and 1 Guest are viewing this topic.
Canada
Offline Offline
God Member
*****
Karma: 7
Posts: 600
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

What I am saying is, that it does not mater what you load up.  Bootloader or other code (as long as it's not loaded via the bootloader itself).  Once it goes beyond the 128K boundary you will get the verify error.  In all the cases we tried, we did erase the flash and set the lock byte to 0xFF (actually 0x3F or 0x7F are okay as the two highest order bits are always '1').  That's the standard way of loading code via avrdude, unless you have something you want protected, like a bootloader.  It's not forgetting where it put things, it's 'forgetting' to enable the extended addressing during verify.
Logged

Facts just don't care if you ignore them.

South Africa
Offline Offline
Sr. Member
****
Karma: 2
Posts: 403
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you tried loading a smaller sketch and seeing if it verifies OK ?

Apart from that, I must admit that the technicalities are way above my level, so would have to wait for the guru's to post.

If it helps at all, the content of my batch file to upload is :
Code:
cd\Program Files\arduino-1.0\hardware\arduino\bootloaders\stk500v2
avrdude -v -p atmega2560 -c usbasp -U lfuse:w:0xff:m -U hfuse:w:0xd8:m  -U efuse:w:0xfd:m -U lock:w:0x3f:m -U flash:w:stk500boot_v2_mega2560.hex
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 524
Posts: 26484
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Bootloader in only 512 to 1024 bytes, not 23,000.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

South Africa
Offline Offline
Sr. Member
****
Karma: 2
Posts: 403
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Bootloader in only 512 to 1024 bytes, not 23,000.

Hi CrossRoads

That's odd, and I don't dispute your info. But on my PC, the properties of  stk500boot_v2_mega2560.hex  show  Size : 22.4 KB (22,989 bytes)

Is the bootloader hex on my pc the wrong size, or does it change when uploaded to the board ?  Or possibly the bootloader is not the complete hex file ?

Just curious.
Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 524
Posts: 26484
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That might be the size of the file, with 2 letters to represent a byte: B01010101 = 55 for instance, with each 5 needing a byte,
then data for the address of the bytes, data for a checksum, and so on.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Canada
Offline Offline
God Member
*****
Karma: 7
Posts: 600
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

These files are in HEX format.  See below which is part of a bootloader file:

Code:
:02 0000 02 30 00 CC
:10E000000D94F6F20D941FF30D941FF30D941FF36E
:10E010000D941FF30D941FF30D941FF30D941FF334
:10E020000D941FF30D941FF30D941FF30D941FF324
:10E030000D941FF30D941FF30D941FF30D941FF314
:10E040000D941FF30D941FF30D941FF30D941FF304
:10E050000D941FF30D941FF30D941FF30D941FF3F4
:10E060000D941FF30D941FF30D941FF30D941FF3E4
:10E070000D941FF30D941FF30D941FF30D941FF3D4
:10E080000D941FF30D941FF30D941FF30D941FF3C4
:10E090000D941FF30D941FF30D941FF30D941FF3B4
:10E0A0000D941FF30D941FF30D941FF30D941FF3A4
:10E0B0000D941FF30D941FF30D941FF30D941FF394
:10E1500000415652204C69624320566572203D2092
:10 E160 00 00 47 43 43 20 56 65 72 73 69 6F 6E 20 20 3D 20 3F

Each line starts with a colon then a 2 character byte count (in hex) for the record.
This is followed an address in some records.   Then a 2 character record type.  Then data.  Then a 2 character check-sum.
A type 02 record contains a segment address as it's data like the first line above which I have broken out.  The last line is a type 00 data record.  I broke this one out as well.  So, each byte of data written to the flash is represented by 2 bytes in the hex file, and for every 20 of thoes there are some 12 additional characters describing what to do with the data as well as a few extra characters in each file.
Logged

Facts just don't care if you ignore them.

Offline Offline
Newbie
*
Karma: 0
Posts: 20
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Having the same problems while programming the 2560 with USBasp

I'm using this one http://www.ebay.com/itm/New-USBASP-USBISP-AVR-Programmer-USB-ATMEGA8-ATMEGA128-/170813851774?pt=LH_DefaultDomain_0&hash=item27c54c887e#ht_6041wt_962

The 8u2/16u2 gives no problem. The bootloader loads and gives flashes. Still getting
an error message after the bootloader is uploaded.

But with a sketch (like the 'blink' sketch), it won't work.
Can readout it is programmed ok.

But for uploading sketches and it's all working, both IDE & Atmel Studio,
what are the right settings of the fuses? Is this/there a definely solution?

By the way, have also looked at the AVRdude source and the config.
Could be possibly the solution there making?

Note: the Attiny programmer can also not programm more
then 64Kb, also described in the in the AVRdude document.

http://www.adafruit.com/products/46
« Last Edit: February 19, 2014, 05:43:26 pm by pe1mxp » Logged

Pages: 1 2 [3]   Go Up
Jump to: