Problemi di timeout durante il caricamento dello sketch sulla scheda

Buongiorno signori
Ultimamente sto avendo questo scherzo.
in fase di caricamento dello sketch , riesce a leggere dalla scheda e poi nel momento in cui deve scrivere mi segnala timeout.
ho provato a caricare uno sketch vuoto e me lo carica normalmente.
qui di seguito riporto i valori di debug .
sono costretto a togliere il collegamento alla seriale altrimenti cicla continuamente.

Qualcuno puo' dirmi cosa succede?
Vi ringrazio tanto.

C:\Arduino\hardware\tools\avr/bin/avrdude -CC:\Arduino\hardware\tools\avr/etc/avrdude.conf -v -patmega2560 -cwiring -PCOM17 -b115200 -D -[/tt]Uflash:w:C:\DOCUME~1\gigio\IMPOST~1\Temp\build6342767485472225220.tmp/megaGpsSD_base.cpp.hex:i

avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2009 Joerg Wunsch

System wide configuration file is "C:\Arduino\hardware\tools\avr/etc/avrdude.conf"

Using Port : COM17
Using Programmer : wiring
Overriding Baud Rate : 115200
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
flash 65 10 256 0 yes 262144 256 1024 4500 4500 0x00 0x00[
lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00
signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00

Programmer Type : Wiring
Description : Wiring
Programmer Model: AVRISP
Hardware Version: 15
Firmware Version Master : 2.10
Vtarget : 0.0 V
SCK period : 0.1 us

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e9801
avrdude: reading input file "C:\DOCUME~1\gigio\IMPOST~1\Temp\build6342767485472225220.tmp/megaGpsSD_base.cpp.hex"
avrdude: writing flash (23324 bytes):

Writing | avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: ser_send(): write error: sorry no info avail
Problema di caricamento sulla scheda. Guarda http://www.arduino.cc/en/Guide/Troubleshooting#upload per suggerimenti

Accade spesso che le programmazione non abbia successo se la seriale รจ impegnata dallo sketch in esecuzione.
Per ovviare inserisci un delay di 1 o 2 secondi come primo comando nel setup().

Se hai problemi a caricare lo sketch puoi usare la procedura di emergenza.
-> Solito "avrdude: stk500_getsync(): not in sync: resp=0xff" - #3 by PaoloP - Software - Arduino Forum

Ricorda di scollegare eventuali componenti esterni dai pin 0 e 1 dell'Arduino.

Sono riuscito a risolverlo.
ho eliminato due variabili che cominciavano per Time....
esempio logfile.print((TimeNow-TimeLast)/1000);
e tutto e' andato come prima.
Sara' il nome della variabile?...
potrebbe essere un baco.

Senza vedere il tuo codice (prima delle modifiche) ci vuole la palla di vetro :grin:

hai ragione
adesso te lo posto cosi' controllerai.
scusa

il codice e' troppo lungo
te lo mando come allegato

io ho modificato le variabili TimeNew e TimeLast con T_new e T_last e ho visto che funziona

megaGpsSD_base.ino (11.2 KB)