Go Down

Topic: Avrdude intermittent problem (Mega2560) (Read 527 times) previous topic - next topic

bpietras

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!






spycatcher2k

try
avrdude -c wiring -P com12 -p atmega2560 -b115200 -U flash:w:plus1.hex:i
Drew.
http://www.uk-pcb.co.uk - My UK Based PCB Fab & Assembly Company
Design work undertaken
SMD & Thru-Hole assembly

bpietras

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

bpietras

Unfortunately I spoke too soon

Both commands work, however the problem persists.

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

spycatcher2k

Strange, that's the command line used by the Arduino IDE
Drew.
http://www.uk-pcb.co.uk - My UK Based PCB Fab & Assembly Company
Design work undertaken
SMD & Thru-Hole assembly

bpietras

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!

bpietras

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!

spycatcher2k

Thats a windows error - not an arduino error.
Drew.
http://www.uk-pcb.co.uk - My UK Based PCB Fab & Assembly Company
Design work undertaken
SMD & Thru-Hole assembly

bpietras

#8
May 09, 2014, 05:50 pm Last Edit: May 09, 2014, 06:21 pm by bpietras Reason: 1
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/)

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