anilgkts / arduino

Automatically exported from code.google.com/p/arduino
Other
0 stars 0 forks source link

Switch to "wiring" from "stk500v2" for avrdude protocol for Mega 2560. #806

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Try to upload code to Mega
2. Upload will Timeout

What is the expected output? What do you see instead?

Always get timeouts.  On a windows 7 machine.   022 and earlier work fine.

What version of the Arduino software are you using? On what operating
system?  Which Arduino board are you using?

This happens with Arduino 1.0, and Mega 2650.

Please provide any additional information below.

This seems to be due to changes to Arduino version of AVRDUDE.   

Here is my patch on avrdude-5.11.1/stk500v2.c which fixed all my upload issues. 
 I changed some things back to the old avrdude 5.4 arduino code for some 
things.   Replacing avrdude.exe/avrdude.conf in 1.0 from 022 works also.

73c73
< #define SERIAL_TIMEOUT 2

---
> #define SERIAL_TIMEOUT 5
76c76
< #define RETRIES 5

---
> #define RETRIES 33
1317a1318,1325
>
>   printf("trying this reset stuff now..\n");
>   usleep(50*1000);
>
>   serial_set_dtr_rts(&pgm->fd, 1);
>   usleep(50*1000);
>   serial_set_dtr_rts(&pgm->fd, 0);
>   usleep(50*1000);

JesseJay

Original issue reported on code.google.com by jjbro...@gmail.com on 31 Jan 2012 at 8:20

GoogleCodeExporter commented 9 years ago
Thanks for the patch.  With the old avrdude (that comes with 1.0), can you try 
the "wiring" programmer type instead of stk500v2?  (That is, change the Mega 
2560 entry in the boards.txt file.)

Otherwise, we'll need to do something like your patch: either doing a custom 
patch to / version of avrdude or creating a new programmer type (e.g. 
"arduino2") that does the auto-reset for stk500v2 (like the "arduino" type does 
for stk500v1).  

Original comment by dmel...@gmail.com on 29 Mar 2012 at 1:47

GoogleCodeExporter commented 9 years ago
I tried the "wiring" change and that worked for me.  Thank you very much, I've 
been looking for a fix for WEEKS now... :-) :-)

Original comment by Kotze...@gmail.com on 31 Mar 2012 at 4:58

GoogleCodeExporter commented 9 years ago
Hi, can anybody explain what is this wiring thing?
The only way I managed to solve my uploading issues to the mega2560 was using 
avrdude and respective .conf file from IDE 022 on IDE 1.0

Original comment by baltasa...@gmail.com on 18 Apr 2012 at 3:10

GoogleCodeExporter commented 9 years ago
Hi,

I also tried that but it wouldn't work.  Open the below file:

"C:\Program Files\arduino-0100-relax\hardware\arduino\boards.txt"

And then change the "mega2560.upload.protocal" value to "wiring" - see 
below...

##############################################################

mega2560.name=Arduino Mega 2560 or Mega ADK

mega2560.upload.protocol=wiring
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
mega2560.build.variant=mega

##############################################################

Original comment by Kotze...@gmail.com on 19 Apr 2012 at 6:19

GoogleCodeExporter commented 9 years ago
Ok, editing that file and change back to original avrdude 5.11 and his .conf 
file (the one that cames with IDE 1.0) doesn't solve me anything, stil getting 
the upload problems on mega2560.
I had to revert back to IDE 022 avrdude again.

Any new or other way to fix this without using the olde avrdude?

Original comment by baltasa...@gmail.com on 19 Apr 2012 at 9:50

GoogleCodeExporter commented 9 years ago
Ok solved, here is the new compiled avrdude 5.11.1 for Windows with JesseJay 
patch.

It's working ok for me now on mega2560 !!!

Original comment by baltasa...@gmail.com on 17 May 2012 at 1:04

Attachments:

GoogleCodeExporter commented 9 years ago
http://arduino.cc/forum/index.php/topic,109417.0.html

Original comment by dmel...@gmail.com on 14 Jun 2012 at 2:44

GoogleCodeExporter commented 9 years ago
The "wiring" protocol does the auto-reset in avrdude and so should be more 
reliable.  

See: http://arduino.cc/forum/index.php/topic,109933.0.html for another example.

Original comment by dmel...@gmail.com on 15 Jun 2012 at 7:27

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
https://github.com/arduino/Arduino/commit/d83543cff15d8a1f4623b1e2babc6c2f4a8678
15

Original comment by dmel...@gmail.com on 15 Jul 2012 at 1:14

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Is there any fix for Arduino 1.5.6-r2 ? 
The timeout problem still occurs with the Mega, and the boards.txt already 
contains "wiring" so that your fix is not working.

## Arduino Mega w/ ATmega2560
## -------------------------
mega.menu.cpu.atmega2560=ATmega2560 (Mega 2560)

mega.menu.cpu.atmega2560.upload.protocol=wiring
mega.menu.cpu.atmega2560.upload.maximum_size=258048
mega.menu.cpu.atmega2560.upload.speed=115200

mega.menu.cpu.atmega2560.bootloader.high_fuses=0xD8
mega.menu.cpu.atmega2560.bootloader.extended_fuses=0xFD
mega.menu.cpu.atmega2560.bootloader.file=stk500v2/stk500boot_v2_mega2560.hex

Original comment by via...@hotmail.fr on 27 May 2014 at 9:48

GoogleCodeExporter commented 9 years ago
My arduino atmega2560 problem resolved itself when I switched to using the
usb port on the back of the PC which are directly on the motherboard.
 Probably just my specific case but it can't hurt to try.  I was having a
similar problem uploading android apk's to a nexus 10 via usb until I did
the same and then that problem also resolved.

Original comment by kelvin.i...@gmail.com on 27 May 2014 at 1:12