Go Down

Topic: [SOLVED] ATMEGA2560v-Au Bootloader (Read 1 time) previous topic - next topic

jacqueskleynhans

Mar 20, 2012, 02:55 pm Last Edit: Mar 26, 2012, 11:44 am by jacqueskleynhans Reason: 1
How do I modify the ATMEGA2560 Bootloader to the ATMEGA2560v-Au 3.3v 8Mhz ?


jacqueskleynhans

I tried to use a bootloader from sparkfun for the 3.3v 8 Mhz.

But now.........

Quote
avrdude: Version 5.11, compiled on Sep  2 2011 at 19:38:36
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Users\Leon Mckenzie\Desktop\CanSatDuino\Ardiuno\arduino-1.0\hardware/tools/avr/etc/avrdude.conf"

         Using Port                    : \\.\COM5
         Using Programmer              : stk500v2
         Overriding Baud Rate          : 57600
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with 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: Unknown
avrdude: Send: . [1b] . [01] . [00] . [02] . [0e] . [03] . [90] . [85]
avrdude: Recv:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]


giantsfan3

#3
Mar 22, 2012, 04:00 pm Last Edit: Mar 22, 2012, 04:17 pm by giantsfan3 Reason: 1
I cannot give an exact technical answer of how to CREATE the necessary modified bootloader.
However, having done this exact thing successfully in the past, I recommend you try one of the following two approaches:

(1) Get the already compiled file for Sparkfun's 3.3 V / 8 Mhz version of Mega2560 (hex file, credit Brett Hagman):
http://code.google.com/p/wiring/downloads/detail?name=WiringBoot_sparkfun-megapro-8MHz.hex
Then burn using avrdude commandline specifying "m2560" for the microcontroller (even though technically, the uC is Atmega2560-V version)

(2) Or instead, if using Arduino IDE, first edit the "boards.txt" file in the appropriate arduino folder (for example) "arduino-0022/hardware/arduino/", by changing the following two parameters in the file:
Code: [Select]

mega2560.upload.speed=57600

mega2560.build.f_cpu=8000000L

Then reload Arduino IDE, select Tools >> Board >> Arduino Mega 2560, then Tools >> Burn bootloader, and so on.

Note:
In both of the above cases, AFTER the bootloader is burned, I think you will get a msg toward the end as follows:
"avrdude: verification error, first mismatch at byte 0x3e000... 0x0d != 0xff"
This error can be ignored; Test it out by uploading a sketch, and it will work fine.

jacqueskleynhans

Hi, Thanks for the tips I will try it ASAP !!!

In my current configuration I used the AVR Programmer to upload all my sketches to the mega board this was useful because I managed to finish all my code
but now I am back to the boot-loader.

I have tried to upload the sparkfun bootloader in arduino IDE 1.0 but it seems to lock up.. It says uploading boot-loader but never finishes... I then uploaded the bootloader in avr studio and tried the serial upload in arduino ide this is when I received the  timeout message.

I will try your suggestions.

regards

Jacques

jacqueskleynhans

Hi giantsfan3,

I tried both options you mentioned. In the first case the bootloader ends with the mismatch error but I still get the :

Quote
avrdude: Recv:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]


In the second case the bootloader uploads succesfully without any errors but then I still get the :

Quote
avrdude: Recv:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]


But the weird part is that even if I disconnect the serial I get the same message.

Quote
avrdude: Recv:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]


I verified that all my uart channels work by using a keypress sketch where I send a char to the arduino, it blinks a led and then return a debug string.

But I have to program it using my avrispmk2...


jacqueskleynhans

Good news, I have upload the arduino 2560 with halved clock and baud.. And now it seems to work when I manually reset the board at the correct moment.

But What peeved me off is that I have done this before and it timed out so I dont understand why this is so sporadic.

Anyway thx for the assitance

giantsfan3

#7
Mar 24, 2012, 02:33 pm Last Edit: Mar 24, 2012, 02:50 pm by giantsfan3 Reason: 1
apparently the timeout issue has occurred to other people before (not to me):

this discussion (http://arduino.cc/forum/index.php?topic=83079.0) suggests trying the upload with arduino-022/arduino-023 versus arduino-1.0

try with different version and let me know what happens.

also, google "avrdude: stk500v2_ReceiveMessage(): timeout" [with the double-quotes]...


jacqueskleynhans

I got it stable now in Arduino 1.0. I have tried the other version IDE's all give me the same time out thing.

I am still struggling a bit with the auto reset. But atm I am using the reset button technique where I manually reset at the correct time in the upload sequence then the code uploads successfully.

But thanks for all you assistance in any-case.

Regards

Jacques

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy