Arduino BT and avrdude "not in sync" errors

Hi guys,

I'm having some serious problems uploading programs to my Arduino BT-V06.

I'm attempting to upload the basic "Blink" program.

What happens is that after compiling the program, the Arduino IDE (and the shell) return the following error messages:

avrdude: Version 5.4-arduino, compiled on Aug  6 2007 at 10:43:18
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

         System wide configuration file is "C:\Documents and Settings\DummyUser\Desktop\Processing\arduino-0009-win\arduino-0009\tools/avr/etc/avrdude.conf"
         Using Port            : COM4
         Using Programmer      : stk500v1
         Overriding Baud Rate  : 19200
avrdude: ser_open(): setting dtr
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Recv:
avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: Send: Q [51]   [20]
avrdude: Recv:
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

avrdude done.  Thank you.

Yesterday I managed to upload programs a few times by resetting the Arduino BT and immediately afterwards pushing the upload button. But today it just spits out the same error no matter what I do

However, the program I uploaded yesterday returns the ASCII value of keypresses (using a serial connection), and I am able to connect to it today, so the thing is still alive.

I am on a Windows XP machine with Arduino 0009 Alpha software. I have tried to remove the Bluetooth device profile from the Windows Bluetooth Devices manager and seeking for it again - and adding it succesfully with COM port and all without problems.

I look forward to hearing from you.

Cheers, Hamsol

So I tested it on my Apple Macbook and I was able to upload the program with the Arduino 0009 - but only by resetting the Arduino BT AND pressing the upload button in the Arduino software at the exact same time.

If my timing is lazy with the Apple, I get a "Programmer is not responding" error (and not any "sync" or "connection" errors as on Windows).

I read somewhere that the 0007 version of the Arduino software might work better, but on the Windows platform I just get "Programmer is not responding" errors, no matter if I reset the board synchronously with or right before pressing the upload button.

I then attempted to manually upload the compiled HEX to the Arduino by just invoking the command from the command line within the 0007 folder (and doing so ½ second after pressing the reset switch on the Arduino):

C:\Documents and Settings\DummyUser\Desktop\arduino-0007-win\arduino-0007>tools\avr\bi
n\uisp -v=4 -dpart=atmega168 -dprog=stk500 -dserial=/dev/com4 -dspeed=19200 --up
load if=C:\Documents and Settings\DummyUser\My Documents\Arduino\bluetooth_responder\a
pplet\bluetooth_responder.hex
Transmit: { 0 [30]   [20] }
Receive: { . [14] . [10] }
Transmit: { B [42] . [86] . [00] . [00] . [01] . [01] . [01] . [01] . [03] . [ff] . [ff] . [ff] . [ff] . [00] . [80] . [02] . [00] . [00] . [00] @ [40] . [00]
 [20] }
Receive: { . [14] . [10] }
Transmit: { A [41] . [82]   [20] }
Receive: { . [14] . [0f] . [10] }
Transmit: { A [41] . [81]   [20] }
Receive: { . [14] . [01] . [10] }
Firmware Version: 1.15
Transmit: { E [45] . [04] . [04] . [d7] . [a0] . [01]   [20] }
Receive: { . [14] . [10] }
Transmit: { P [50]   [20] }
Receive: { . [14] . [10] }
Transmit: { u [75]   [20] }
Receive: { . [14] . [1e] . [94] . [06] . [10] }
Transmit: { Q [51]   [20] }
Receive: { . [14] }
Receive: { . [10] }
Vendor Code: 0x1e
Part Family: 0x94
Part Number: 0x06
Atmel AVR ATmega168 is found.
Page Write Enabled, size=128
FLASH Write Delay (t_wd_flash): 12500 us
EEPROM Write Delay (t_wd_eeprom): 11111 us
Transmit: { 0 [30]   [20] }
Receive: { . [14] }
Receive: { . [10] }
Transmit: { B [42] . [86] . [00] . [00] . [01] . [01] . [01] . [01] . [03] . [ff] . [ff] . [ff] . [ff] . [00] . [80] . [02] . [00] . [00] . [00] @ [40] . [00]
 [20] }
Receive: { . [14] . [10] }
Transmit: { A [41] . [82]   [20] }
Receive: { . [14] . [0f] . [10] }
Transmit: { A [41] . [81]   [20] }
Receive: { . [14] . [01] . [10] }
Firmware Version: 1.15
Transmit: { E [45] . [04] . [04] . [d7] . [a0] . [01]   [20] }
Receive: { . [14] . [10] }
Error: No such file or directory
 -> C:\Documents

It seems that the upload went well (better than before at least), and the result is the same whether I specify 19200 or 115200. But what about the last error? It seems that there might be an issue with directory names with spaces?

Phew, this is not easy. For various reasons I need to get this working reliably on the Windows platform...

Cheers, Hamsol

Yahoo, now I got the darn box uploading programs to the Arduino. :sunglasses:

This is what I did:

I reckoned that knowing the exact timing isn’t possible with the Arduino IDE as it doesn’t allow me to control exactly when the upload commences. Remember that the IDE normally needs to compile the program first, so that’ll take some time and makes it really hard to predict when it’s the right time for resetting the Arduino.

I have used the upload command from the verbose output in the cmd shell in Windows and found that the following works:

"C:\Documents and Settings\SomeUser\Desktop\Processing\arduino-0009-win\arduino-0009\tools/avr/bin/avrdude" -C"C:\Documents and Settings\SomeUser\Desktop\Processing\arduino-0009-win\arduino-0009\tools/avr/etc/avrdude.conf" -v -v -v -v -pm168 -F -cstk500v1 -PCOM4 -b19200 -D -V -Uflash:w:"C:\Documents and Settings\SomeUser\My Documents\Arduino\bluetooth_responder\applet\bluetooth_responder.hex:i"

Note that I needed to add the "'s around the path names as it would otherwise fail because of the spaces.

Now, when I press the reset button and run the command at the same time, it does indeed upload without errors. No errors what so ever.

Perhaps an option in the Arduino IDE to prompt the user for a keypress when compiling is finished and upload is about to begin would be a good idea? That would enable the average user Arduino BT user with these problems to upload without having to resolve to command line voodoo… :slight_smile:

Cheers,
Hamsol