Pages: [1]   Go Down
Author Topic: Mega2560 upload OK but Not execute any program!  (Read 930 times)
0 Members and 1 Guest are viewing this topic.
Neuchatel
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,
I am new in this forum,
My name is andre , soy ing. in microelectronic. Normally, i write prog. in ASM & C++
I am working with Linux (suse¦ Mandriva¦ Debian) & some time with MS_Window
I don't use Arduino board since long time. I don't have any problems with UNO. 
But I am not able to use my new board MEGA. Just  received this week. (4 pieces 2560 R1.)
No prob. for upload from SDK 1.01 via programmer  external ( USB HK SDK 500-ISP Clone) direct to 2560-ISP. Newer use  on-board programmer (usb-8u2).
But after nothing  Works ?? (unlike UNO )
I have tested with linux , window, & SDK 1.01, 1.0, 0023  w. small prog.'s Like Blink-LED-on-off-Digital_13. Etc...
 Power ON ; Led's OK ; Osc. 16Mhz OK ; Switch reset OK ; etc... but no run prog.!!! All Digital_pin's at 0 volt!!
I have downloaded the bootloader for mega2560 (SDK-1.01 /tools/burn-boot-loader) & at end the led Digital_13 flash & error (avrdude: verification error, first mismatch at byte 0x1e000     0xff != 0x0d )
Why? Please HELP ME.!  (I know my all 4 Arduino Board MEGA are KO !!)
Thanks.
Logged

California
Offline Offline
God Member
*****
Karma: 14
Posts: 629
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

When you burn the bootloader and get the verification error, did you try to upload a sketch anyways? 

The Arduino Mega2560 bootloader through the Arduino IDE gives a verification error that does not affect the burnt bootloader.  I have manually verified the .hex bootloader file with AVRDUDE and received no verification errors.  Something else is confusing the Arduino IDE.

Also, remember that if you burn a sketch through the ICSP (500 ISP clone), the bootloader is overwritten and the Atmega8u2 will no longer be able to upload to the Atmega2560.  To turn the Mega USB upload back on requires a bootloader on the Mega2560.
Logged


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

Thanks for  answer.
After more investigation: my prob. is wrong flag setup.

The default defined in utility prog. in: http://www.engbedded.com/fusecalc is:
    -U lfuse:w:0x42:m    -U hfuse:w:0x99:m    -U efuse:w:0xff:m   (-U lock:w:0xff:m)

The fct. burn bootloader for mega2560 (in tools/burn_bootloader) change fuse as:
    -Ulfuse:w:0xFF:m    -Uhfuse:w:0xD8:m    -Uefuse:w:0xFD:m    -Ulock:w:0x3F:m
and     upload  stk500v2/stk500boot_v2_mega2560.hex   with  rewrite : -Ulock:w:0x0F:m

The end of file .hex  for  the bootloader for mega2560 is 0x59c0. In this case the read back error
is not possible at 0x1e000 because is outside of upload stk500boot_v2_mega2560.hex.!!!

Now  I use  fuse's like this:   avrdude -v -patmega2560 -cusbasp -Pusb    -U lfuse:w:0xc2:m -U hfuse:w:0x99:m  -U efuse:w:0xff:m -U lock:w:0x3f:m

and  all it's OK. :  interrupt reset @ 0x000 & unlock for ISP & timing slower

andre
Logged

Pages: [1]   Go Up
Jump to: