Poll
Question: Bootloader error and uploading
bootloader - 0 (0%)
error - 1 (100%)
Total Voters: 1

Pages: [1] 2   Go Down
Author Topic: Upload sketch only once!  (Read 3311 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 22
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi!
I've made a board with an atmega2560. I'm trying to upload the bootloader with another arduino used as ISP and I get this error:

Code:
avrdude: verification error, first mismatch at byte 0x3e000
        0x0d != 0xff
avrdude: verification error; content mismatch

but the led on pin 13 digital blinks. So, I tried to upload a sketch and it works only the first time!  smiley-eek
If I try twice it fails with a timeout error.
Can somebody help me?

Thank you very much!
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8958
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

After you load ArduinoISP, are you disabling auto-reset?   If the host Arduino resets then the bootloader will be in control, not the ArduinoISP sketch.  One easy way is to hook a 1 to 2 microfarad capacitor between Reset (+) and Ground (-) on the host Arduino after you upload ArduinoISP.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

0
Offline Offline
Newbie
*
Karma: 0
Posts: 22
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes...I put the 110Ohm resistor as explained here http://www.arduino.cc/playground/Main/DisablingAutoResetOnSerialConnection...is it right?
Thank you
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 212
Posts: 8958
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, the resistor should work.

I'm not entirely clear on the problem...  Did you burn a bootloader without error?

You can use the ArduinoISP to upload sketches but I think you need the bootloader to turn control over to the sketch on startup.  If the error was with burning the bootloader you should get that fixed first.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

0
Offline Offline
Newbie
*
Karma: 0
Posts: 22
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No...that's the first problem...when I burn it I get the error in my first post.
I have also tried to upload a sketch via usb (with ft232) and it succeeded, but if I try to upload it again it fails.
I made few tests and I I can upload a sketch only ones after the bootloader, but I think it is a bootloader-related problem because of that error...

Thank You
Logged

Scotland
Offline Offline
Edison Member
*
Karma: 26
Posts: 1338
Have you had your Arduino fix today?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Sounds like a lock issue - after uploading the bootloader, the lock but should be set to 0x0F - maybe an issue with the boards.txt file. Can you post its contents here and we'll havea look at it.


Drew.
Logged

Drew.
http://www.uk-pcb.co.uk - My UK Based PCB Fab & Assembly Company
Design work undertaken
SMD & Thru-Hole assembly

0
Offline Offline
Newbie
*
Karma: 0
Posts: 22
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I was thinking about a lock, too. But I haven't edited the original board.txt...
This is the mega2560 section:
Code:
mega2560.name=Arduino Mega 2560

mega2560.upload.protocol=stk500v2
mega2560.upload.maximum_size=258048
mega2560.upload.speed=115200

mega2560.bootloader.low_fuses=0xFF
mega2560.bootloader.high_fuses=0xD8
mega2560.bootloader.extended_fuses=0xFD
mega2560.bootloader.path=stk500v2
mega2560.bootloader.file=stk500boot_v2_mega2560.hex
mega2560.bootloader.unlock_bits=0x3F
mega2560.bootloader.lock_bits=0x0F

mega2560.build.mcu=atmega2560
mega2560.build.f_cpu=16000000L
mega2560.build.core=arduino

Thank You
Logged

Scotland
Offline Offline
Edison Member
*
Karma: 26
Posts: 1338
Have you had your Arduino fix today?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Looks OK ! - Does the sketch you are trying to upload contain !!! in it? - That is the debug switch code to access the extended menu on the 2560 bootloader.

Drew
Logged

Drew.
http://www.uk-pcb.co.uk - My UK Based PCB Fab & Assembly Company
Design work undertaken
SMD & Thru-Hole assembly

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 209
Posts: 13025
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

How long are the wires between Arduino ISP and the target (atmega2560)?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 22
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

No "!!!"...I just tried with the blink example...
The wires are long about 70cm...mmh..is it too much?

Thank You
Logged

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 209
Posts: 13025
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The wires are long about 70cm...mmh..is it too much?

I've never used anything longer than about 20cm so I can't say for certain if 70cm is or is not a problem.  I can say that 20cm has been a good choice for me.

At this point, you nothing to lose...  Try shorter wires.  Carefully check all connections.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 22
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Less than 10cm, but nothing change  smiley-neutral
Logged

Scotland
Offline Offline
Edison Member
*
Karma: 26
Posts: 1338
Have you had your Arduino fix today?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

what operating system and version of ide are you using?
Logged

Drew.
http://www.uk-pcb.co.uk - My UK Based PCB Fab & Assembly Company
Design work undertaken
SMD & Thru-Hole assembly

0
Offline Offline
Newbie
*
Karma: 0
Posts: 22
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Mac Os X 10.6.6 and arduino IDE 0022...
I also tried with 0020 with the same result...

Should I try on windows?

Thank you
Logged

Scotland
Offline Offline
Edison Member
*
Karma: 26
Posts: 1338
Have you had your Arduino fix today?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

There has been issues with the drivers on mac, try this :

1) Go to System Preferences -> Network
2) If it asks you to add the Arduino (modem device), say cancel
3) Remove the Arduino device from the list if its there
4) Try uploading a sketch!

I only have windows xp - so can't comment if this realy works.

Drew
Logged

Drew.
http://www.uk-pcb.co.uk - My UK Based PCB Fab & Assembly Company
Design work undertaken
SMD & Thru-Hole assembly

Pages: [1] 2   Go Up
Jump to: