Loading...
Pages: [1] 2   Go Down
Author Topic: bootloader error  (Read 360 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Dear all
as a arduino user for a few year i haven't encounter much unsovable problems until now.
I am using a uno as a arduinoisp to burn the bootloader on a pcb with a ATMEGA2560 on it.
Afther a while , afther a lot of activity on the rx-tx leds , i recieve a error message:
AVRDUDE : verification error , first mismatch at byte 0x1e000
                0xff !=0x0d
AVRDUDE : verification error , content mismatch.
I am using 0022  and tryed it with 1.01   
Has anybody any experiance with this error ?
Thanks .                   
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 96
Posts: 6364
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

0x1e000 is the first byte of the bootloader. smiley-sad

I think the problem is the the STK500 V1 protocol implemented by the ArduinoISP sketch isn't capable if writing to the ATmega2560 because of the memory size.  I'm fairly sure you need an ISP capable of STK500 V2.  I suspect that back when they created the V1 protocol they were thinking "Nobody will ever need more than 32k of FLASH.".

I recommend buying a USBasp from eBay for less than $5.  They take a while to ship from Hong Kong so order early.
Logged

Global Moderator
Melbourne, Australia
Offline Offline
Shannon Member
*****
Karma: 218
Posts: 13896
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I wrote a sketch to burn bootloaders:

http://www.gammon.com.au/forum/?id=11635

This includes the Mega2560 which did indeed need extra code to handle the higher addresses.
Logged


Kansas City, MO
Offline Offline
Jr. Member
**
Karma: 0
Posts: 62
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Nick,
I'm trying to use your 2560 bootloader procedure and file from the link you provided. When the bootloader sketch executes, it prints out the expected signature, processor and flash size for the MEGA2560, but there are a couple differences.

LFuse = 0x62
HFuse = 0x99
EFuse = 0xFF
LockByte = 0x00
Clock calibration = 0x86
Bootloader address = 0x3E000
Bootloader length = 7434 bytes
Type 'V' to verify, or 'G' to program the chip..

When I type G it tries to program but everything comes back with verification errors because all the expected results are read as 0xFF instead of what they should be.

These are new 2560 chips on a custom board. These are not from an off the shelf Arduino MEGA. Any assistance you can provide would be greatly appreciated.
Logged

Kansas City, MO
Offline Offline
Jr. Member
**
Karma: 0
Posts: 62
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm not sure why, but I built a parallel programmer to try and program the bootloader that way. It didn't completely work, but whatever it did do cleared the path for the Nick's code to work now. The fuses were correct after tryng with the parallel method. I was able to program the bootloader successfully after trying to do it parrallel first and then with Nick's sketch.
Logged

Kansas City, MO
Offline Offline
Jr. Member
**
Karma: 0
Posts: 62
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Blinky is now working!! All 100 pins are broke out on this one. Caps for crystal are on the back.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 279
Posts: 15314
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I wrote a sketch to burn bootloaders:

http://www.gammon.com.au/forum/?id=11635

This includes the Mega2560 which did indeed need extra code to handle the higher addresses.

How about the original arduino mega1280 board, is that included in your suite of chips supported?

Lefty
Logged

Kansas City, MO
Offline Offline
Jr. Member
**
Karma: 0
Posts: 62
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Lefty,
I do see a 1280.h file as part of Nicks program.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 279
Posts: 15314
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Lefty,
I do see a 1280.h file as part of Nicks program.

Thanks, I was too lazy to download it and see.

Lefty
Logged

Global Moderator
Melbourne, Australia
Offline Offline
Shannon Member
*****
Karma: 218
Posts: 13896
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Here, Lefty:

https://github.com/nickgammon/arduino_sketches/tree/master/Atmega_Board_Programmer

The list of files is visible on that page. One of them is "Bootloader image for Atmega1280".
Logged


Global Moderator
Melbourne, Australia
Offline Offline
Shannon Member
*****
Karma: 218
Posts: 13896
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm not sure why, but I built a parallel programmer to try and program the bootloader that way. It didn't completely work, but whatever it did do cleared the path for the Nick's code to work now.

Occasionally I get verification errors. I am suspecting that (the absence of) decoupling caps or long cable runs might be to blame. Once it works, it usually works reliably.

Anyway, glad you got it going.
Logged


Offline Offline
Sr. Member
****
Karma: 15
Posts: 463
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Dear all
as a arduino user for a few year i haven't encounter much unsovable problems until now.
I am using a uno as a arduinoisp to burn the bootloader on a pcb with a ATMEGA2560 on it.
Afther a while , afther a lot of activity on the rx-tx leds , i recieve a error message:
AVRDUDE : verification error , first mismatch at byte 0x1e000
                0xff !=0x0d
AVRDUDE : verification error , content mismatch.
I am using 0022  and tryed it with 1.01   
Has anybody any experiance with this error ?
Thanks .                   

That happens with an "Arduino as ISP" setup. Don't know why... but the bootloader is burned correctly anyway.

I took my Mega2560 R3 and burned the bootloader with an AVRISPMKII (a real Atmel MKII, not a clone), then read it back into a .HEX file. Then I burned it again with a Sparkfun AVRISP shield and the ArduinoISP code running in an Uno R3 board. I got the "0xff != 0x0d" error as expected. Then I read the bootloader back out with my MKII and compared the .HEX files. They were identical.

Moral of the story... ignore that error message.
Logged

Offline Offline
Sr. Member
****
Karma: 15
Posts: 463
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Blinky is now working!! All 100 pins are broke out on this one. Caps for crystal are on the back.

That's an awesome board? Where to get one?
Logged

Kansas City, MO
Offline Offline
Jr. Member
**
Karma: 0
Posts: 62
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I designed it myself. It does have the crystal and caps but you still have to provide an external power source. I wanted to design the board so that it could be plugged in to a interface board of whatever form factor I need and become the "heart" of any system while still maintaining the Arduino software and IDE interface. I put female headers in this one because I'll use it for bench top / breadboard wiring. Once I use it in actual hardware it will have male headers on the bottom and the interface board will have the female compliment and standoffs to secure it. Gives me a Mega in a "Virtual DIP" IC for easy replacement.

Thanks for the vote of confidence!!
Logged

Offline Offline
Sr. Member
****
Karma: 15
Posts: 463
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I designed it myself. It does have the crystal and caps but you still have to provide an external power source. I wanted to design the board so that it could be plugged in to a interface board of whatever form factor I need and become the "heart" of any system while still maintaining the Arduino software and IDE interface. I put female headers in this one because I'll use it for bench top / breadboard wiring. Once I use it in actual hardware it will have male headers on the bottom and the interface board will have the female compliment and standoffs to secure it. Gives me a Mega in a "Virtual DIP" IC for easy replacement.

Thanks for the vote of confidence!!

Well, if you have a run of boards of have any extras, I would love to buy one. I'd like one without headers though.... if they're not assembled yet.
Logged

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