avrdude or bootloader problem with MEGA and binary > 32KB

Hi,

I have a problem with my board avrdude and Arduino MEGA 2560.
Since my binary is supperior to 32000 bytes avrdude displays the following message:

avrdude.exe: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude.exe: Device signature = 0x1e9801
avrdude.exe: reading input file "C:\ArduinoMega\MyProgram\Release\MyProgram.hex"
avrdude.exe: writing flash (32898 bytes):

Writing | avrdude.exe: stk500_2_ReceiveMessage(): timeout
avrdude.exe: stk500_2_ReceiveMessage(): timeout
avrdude.exe: stk500_2_ReceiveMessage(): timeout
avrdude.exe: stk500_2_ReceiveMessage(): timeout
...

I use eclipse JUNO and WINAVR tool chain.
My command line to upload this MyProgram is :

C:\arduino-0023\hardware\tools\avr\bin\avrdude.exe -CC:\arduino-0023\hardware\tools\avr\etc\avrdude.conf -patmega2560 -cstk500v2 -P\\.\COM6 -b115200 -D -Uflash:w:${workspace_loc}\${project_name}\Release\${project_name}.hex:i

But if I try to upload a small binary with the same avrdude command line, no problem to upload !

Anyone knows this problem ?

Thank.

Nassarane.

When I add -v -v -v -v option in avrdude command line :

avrdude.exe: Version 5.4-arduino, compiled on Oct 11 2007 at 19:12:32
             Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

             System wide configuration file is "C:\AVR\arduino-0023\hardware\tools\avr\etc\avrdude.conf"

             Using Port            : \\.\COM6
             Using Programmer      : stk500v2
             Overriding Baud Rate  : 115200
avrdude.exe: ser_open(): setting dtr
avrdude.exe: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14] 
avrdude.exe: Recv: 
[...]
avrdude.exe: Recv: 
avrdude.exe: stk500v2_getsync(): found AVRISP programmer
             AVR Part              : ATMEGA2560
             Chip Erase delay      : 9000 us
             PAGEL                 : PD7
             BS2                   : PA0
             RESET disposition     : dedicated
             RETRY pulse           : SCK
             serial program mode   : yes
             parallel program mode : yes
             Timeout               : 200
             StabDelay             : 100
             CmdexeDelay           : 25
             SyncLoops             : 32
             ByteDelay             : 0
             PollIndex             : 3
             PollValue             : 0x53
             Memory Detail         :

                                      Block Poll               Page                       Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               eeprom        65    10     8    0 no       4096    8      0  9000  9000 0x00 0x00
                                      Block Poll               Page                       Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               flash         65    10   256    0 yes    262144  256   1024  4500  4500 0x00 0x00
                                      Block Poll               Page                       Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                      Block Poll               Page                       Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                      Block Poll               Page                       Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                      Block Poll               Page                       Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
                                      Block Poll               Page                       Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
                                      Block Poll               Page                       Polled
               Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
               ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
               signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

             Programmer Type : STK500V2
             Description     : Atmel STK500 Version 2.x firmware
             Programmer Model: AVRISP
avrdude.exe: Send: . [1b] . [02] . [00] . [02] . [0e] . [03] . [90] . [86] 
avrdude.exe: Recv: 
[...]
avrdude.exe: Recv: 
avrdude.exe: Send: . [1b] . [03] . [00] . [02] . [0e] . [03] . [91] . [86] 
avrdude.exe: Recv: 

The following of this log in the next post...
[...]
avrdude.exe: Recv: 
avrdude.exe: Send: . [1b] . [04] . [00] . [02] . [0e] . [03] . [92] . [82] 
avrdude.exe: Recv: 
[...]
avrdude.exe: Recv: 
             Hardware Version: 15
             Firmware Version: 2.10
avrdude.exe: Send: . [1b] . [05] . [00] . [02] . [0e] . [03] . [94] . [85] 
avrdude.exe: Recv: 
[...]
avrdude.exe: Recv: 
             Vtarget         : 0.0 V
avrdude.exe: Send: . [1b] . [06] . [00] . [02] . [0e] . [03] . [98] . [8a] 
avrdude.exe: Recv: 
[...]
avrdude.exe: Recv: 
             SCK period      : 0.1 us

avrdude.exe: Send: . [1b] . [07] . [00] . [0c] . [0e] . [10] . [c8] d [64] . [19]   [20] . [00] S [53] . [03] . [ac] S [53] ( [28] . [00] . [1c] 
avrdude.exe: Recv: 
[...]
avrdude.exe: Recv: 
avrdude.exe: AVR device initialized and ready to accept instructions

Reading | avrdude.exe: Send: . [1b] . [08] . [00] . [08] . [0e] . [1d] . [04] . [04] . [00] 0 [30] . [00] . [00] . [00] 8 [38] 
avrdude.exe: Recv: 
[...]
avrdude.exe: Recv: 
avrdude.exe: Send: . [1b] . [09] . [00] . [08] . [0e] . [1d] . [04] . [04] . [00] 0 [30] . [00] . [01] . [00] 8 [38] 
avrdude.exe: Recv: 
[...]
avrdude.exe: Recv: 
################avrdude.exe: Send: . [1b] . [0a] . [00] . [08] . [0e] . [1d] . [04] . [04] . [00] 0 [30] . [00] . [02] . [00] 8 [38] 
avrdude.exe: Recv: 
[...] 
avrdude.exe: Recv: 
################################## | 100% 0.01s

avrdude.exe: Device signature = 0x1e9801
avrdude.exe: Send: . [1b] . [0b] . [00] . [08] . [0e] . [1d] . [04] . [04] . [00] . [a0] . [0f] . [fc] . [00] X [58] 
avrdude.exe: Recv: 
[...]
avrdude.exe: Recv: 
avrdude.exe: Send: . [1b] . [0c] . [00] . [08] . [0e] . [1d] . [04] . [04] . [00] . [a0] . [0f] . [fd] . [00] ^ [5e] 
avrdude.exe: Recv: 
[...]
avrdude.exe: Recv: 
avrdude.exe: Send: . [1b] . [0d] . [00] . [08] . [0e] . [1d] . [04] . [04] . [00] . [a0] . [0f] . [fe] . [00] \ [5c] 
avrdude.exe: Recv: 
[...]
avrdude.exe: Recv: 
avrdude.exe: Send: . [1b] . [0e] . [00] . [08] . [0e] . [1d] . [04] . [04] . [00] . [a0] . [0f] . [ff] . [00] ^ [5e] 
avrdude.exe: Recv: 
[...]
avrdude.exe: Recv: 
avrdude.exe: reading input file "C:\ArduinoMega\MyProgram\Release\MyProgram.hex"
avrdude.exe: writing flash (32898 bytes):

Writing | avrdude.exe: Send: . [1b] . [0f] . [00] . [05] . [0e] . [06] . [80] . [00] . [00] . [00] . [99] 
avrdude.exe: Recv: 
[...]
avrdude.exe: Recv: 
avrdude.exe: Send: . [1b] . [10] . [01] . [0a] . [0e] . [13] . [01] . [00] . [c1] . [0a] @ [40] L [4c]   [20] . [00] . [00] . [0c] . [94] . [f4] . [0b] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] . [0c] . [94] . [15] . [0c] % [25] . [0c] + [2b] . [0c] 1 [31] . [0c] 7 [37] . [0c] = [3d] . [0c] C [43] . [0c] I [49] . [0c] S [53] . [0c] ] [5d] . [0c] g [67] . [0c] s [73] . [0c] y [79] . [0c] . [7f] . [0c] . [85] . [0c] : [3a] 
avrdude.exe: Recv: 
[...] 
avrdude.exe: Recv: 
avrdude.exe: Send: . [1b] . [11] . [01] . [0a] . [0e] . [13] . [01] . [00] . [c1] . [0a] @ [40] L [4c]   [20] . [00] . [00] . [8b] . [0c] . [91] . [0c] . [97] . [0c] . [9d] . [0c] . [a3] . [0c] . [a9] . [0c] . [af] . [0c] . [b5] . [0c] . [ca] . [0c] . [cc] . [0c] . [ce] . [0c] . [d0] . [0c] . [d2] . [0c] . [d4] . [0c] . [d6] . [0c] . [d9] . [0c] . [e2] . [0c] . [e5] . [0c] . [e8] . [0c] . [ea] . [0c] . [ec] . [0c] . [ee] . [0c] . [f0] . [0c] . [f5] . [0c] . [fd] . [0c] . [05] . [0d] . [07] . [0d] . [0f] . [0d] . [16] . [0d] . [1c] . [0d] - [2d] . [0d] 3 [33] . [0d] 9 [39] . [0d] ? [3f] . [0d] E [45] . [0d] K [4b] . [0d] Q [51] . [0d] [ [5b] . [0d] e [65] . [0d] o [6f] . [0d] { [7b] . [0d] . [81] . [0d] . [87] . [0d] . [8d] . [0d] . [93] . [0d] . [99] . [0d] . [9f] . [0d] . [a5] . [0d] . [ab] . [0d] . [b1] . [0d] . [b7] . [0d] . [bd] . [0d] . [fb] . [1a] . [08] . [1b] Q [51] . [1a] . [1a] . [1f] . [f8] . [1a] . [19] . [1b] . [1c] . [1b] . [1f] . [1b] " [22] . [1b] % [25] . [1b] ( [28] . [1b] + [2b] . [1b] . [2e] . [1b] 1 [31] . [1b] 4 [34] . [1b] 7 [37] . [1b] : [3a] . [1b] = [3d] . [1b] @ [40] . [1b] C [43] . [1b] F [46] . [1b] I [49] . [1b] L [4c] . [1b] O [4f] . [1b] R [52] . [1b] U [55] . [1b] X [58] . [1b] [ [5b] . [1b] ^ [5e] . [1b] a [61] . [1b] d [64] . [1b] g [67] . [1b] j [6a] . [1b] m [6d] . [1b] p [70] . [1b] } [7d] . [1b] . [8a] . [1b] . [97] . [1b] . [9a] . [1b] . [9d] . [1b] . [a0] . [1b] . [a3] . [1b] . [a6] . [1b] . [1d] . [1f] . [a9] . [1b] . [a9] . [1b] . [a9] . [1b] . [b1] . [1b] . [c2] . [1b] . [1d] . [1f] . [11] ! [21] . [11] ! [21] . [11] ! [21] . [11] ! [21] . [f2] ! [21] . [9a] # [23] . [be] ! [21] . [9a] # [23] . [be] ! [21] . [9a] # [23] . [be] ! [21] . [9a] # [23] . [be] ! [21] . [9a] # [23] . [be] ! [21] ! [21] ! [21] ) [29] ! [21] 1 [31] ! [21] 9 [39] ! [21] X [58] ! [21] ` [60] ! [21] h [68] ! [21] v [76] ! [21] . [84] ! [21] . [9a] # [23] . [be] ! [21] . [9c] 
avrdude.exe: Recv: 
[...]

Hi All,

I solved my problem !

In the project Properties/C C++Build/Setting/AVR C Linker:
Command line patern:
I replaced :

${COMMAND} ${FLAGS} -Wl,-u,vfprintf ${OUTPUT_FLAG} ${OUTPUT_PREFIX}${OUTPUT} ${INPUTS}

by

${COMMAND} --cref -s -Os ${OUTPUT_FLAG}${OUTPUT_PREFIX}${OUTPUT} ${INPUTS} -Wl,-u,vfprintf ${FLAGS}

But impossimple to upload again.

I the project Properties/C C++Build/Setting/AVR Compiler/Optimization/
Other optimisation Flags: -ffunction-sections -fdata-sections

Same problem...

I the project Properties/C C++Build/Setting/AVR Compiler/Optimization/
Disabled :
[ ] Pack structs
[ ] Pack Short enums

I can to upload my program !

I do not understand exactly what's going on, but now it works

I found this configuration here : Arduino Playground - Eclipse

Thank for your attentions !

Nassarane.