Pages: [1]   Go Down
Author Topic: Avrdude intermittent problem (Mega2560)  (Read 376 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, my program interacts with the (windows xp - groan) command line using bat files. Avrdude 5.11.

In my bat file
"cd directory_where_hex_is
avrdude -c wiring -P com12 -p m2560 -U flash:w:plus1.hex"

plus1.hex was made using the arduino IDE. Usually this works fine, however the odd time the flashing hangs:

" ... Reading : #### : 16% 0.16savrdude stk500v2_ReceiveMessage(): timeout (repeated)"

Or when Writing.

Clues on the interwebs have pointed towards toggling the DTR signal of the com port (by use of -c arduino). But when I try to use this it hangs (I just replaced "wiring" with "arduino").

Should I include the baud rate in the command, or is this already catered for by specifying m2560? Any help (by way of complete commands) would be appreciated.

Cheers!





Logged

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

try
avrdude -c wiring -P com12 -p atmega2560 -b115200 -U flash:w:plus1.hex:i
Logged

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

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

Works a treat - a hat tip to you, my man.
Logged

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

Unfortunately I spoke too soon

Both commands work, however the problem persists.

I will remake the hex files with a different com..
Logged

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

Strange, that's the command line used by the Arduino IDE
Logged

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

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

I think it's a hardware problem then. The board is flashed twice every 5 minutes, continuously. Perhaps there's a defect in the memory. Or a problem with the USB - I moved to another, lets see.

Thanks for the help!
Logged

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

Hi

Same issue, sometimes works fine (90% of the time, it works every time).

Here´s the error when I try to flashg when it´s in a non-responsive state.

avrdude -c wiring -P com12 -p atmega2560 -b115200 -U flash:w:minus1.hex:i
avrdude: ser_open(): can't set com-state for "\\.\com12"
avrdude: ser_drain(): read error: Controlador no vßlido.

The problem can be resolved by replugging the USB. I was looking into a way with "mountvol com12 /d" "mountvol com12" to mimic this reset everytime, but as the arduino board isn´t a volume I didn´t find a way to do this.

Any ideas appreciated.

Cheers!
Logged

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

Thats a windows error - not an arduino error.
Logged

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

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

Ok, perhaps you could suggest a more appropriate forum? Thanks for the arduino command help before.

(EDIT: Going to see what I can destroy with http://support.moates.net/usb-drivers-ftclean/)
« Last Edit: May 09, 2014, 11:21:21 am by bpietras » Logged

Pages: [1]   Go Up
Jump to: