Author Topic: Timeout while uploading code to wiring board  (Read 6762 times)

0 Members and 1 Guest are viewing this topic.

pyr0

Timeout while uploading code to wiring board
« on: November 04, 2011, 01:32:44 PM »
Hi folks,

here's the thing: I tried to upload code with Wiring 1.0 Build 100 and after a while I get the following errors:

stk500v2_ReceiveMessage(): timeout
stk500v2_ReceiveMessage(): timeout
...
stk500v2_getsync(): timeout communicating with programmer

With Wiring 0027 everything works fine.

I searched the forum and found out that the errors have something to do with the bootloader on my board. I use a very old board, it's the first version from 2004.

My question: How exactly do I get a new bootloader on my board? Or should I switch back to version 0027? But if not, it would be great if someone has a step by step description. I feel a bit like a noob to these things.

Many thanks in advance,
pyr0

barragan

Re: Timeout while uploading code to wiring board
« Reply #1 on: November 04, 2011, 02:56:21 PM »
hi, here is a post with a procedure: http://forum.wiring.co/index.php/topic,9.0.html
Let us know.

pyr0

Re: Timeout while uploading code to wiring board
« Reply #2 on: November 04, 2011, 03:41:16 PM »
I see. The problem is, I have no Arduino at hand. Seems to me, I have to stay at software version 0027. However, thanks for your fast reply, barragan, I'll keep it in mind.

barragan

Re: Timeout while uploading code to wiring board
« Reply #3 on: November 04, 2011, 09:11:49 PM »
you could use any board you have at hand, the example just shows how to do it with an arduino.

bhagman

Re: Timeout while uploading code to wiring board
« Reply #4 on: November 05, 2011, 04:27:39 AM »
To explain the issue a bit: the problem is that the old bootloader used the Atmel STK500 protocol and the new bootloader uses STK500V2.  There are some more issues, but that's the main one.

Try this.  This is an updated version of the hardware/Wiring/boards.txt (in the Wiring installation folder).  Replace the file with this below, then start Wiring and select Tools->Boards->Wiring V1.0 @ 16 MHz (STK500)

Let us know if it works for you.

Code: [Select]
##############################################################

WiringS.name=Wiring S @ 16 MHz
WiringS.upload.protocol=wiring
WiringS.upload.maximum_size=63488
WiringS.upload.speed=115200
WiringS.bootloader.low_fuses=0xF7
WiringS.bootloader.high_fuses=0xD4
WiringS.bootloader.extended_fuses=0xFD
WiringS.bootloader.path=build/Wiring
WiringS.bootloader.file=WiringBoot_WiringS.hex
WiringS.bootloader.unlock_bits=0x3F
WiringS.bootloader.lock_bits=0x2F
WiringS.build.mcu=atmega644p
WiringS.build.f_cpu=16000000L
WiringS.build.core=AVR8Bit
WiringS.build.hardware=WiringS

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

WiringSPlayShield.name=Wiring S with Play Shield @ 16 MHz
WiringSPlayShield.upload.protocol=wiring
WiringSPlayShield.upload.maximum_size=63488
WiringSPlayShield.upload.speed=115200
WiringSPlayShield.bootloader.low_fuses=0xF7
WiringSPlayShield.bootloader.high_fuses=0xD4
WiringSPlayShield.bootloader.extended_fuses=0xFD
WiringSPlayShield.bootloader.path=build/Wiring
WiringSPlayShield.bootloader.file=WiringBoot_WiringS.hex
WiringSPlayShield.bootloader.unlock_bits=0x3F
WiringSPlayShield.bootloader.lock_bits=0x2F
WiringSPlayShield.build.mcu=atmega644p
WiringSPlayShield.build.f_cpu=16000000L
WiringSPlayShield.build.core=AVR8Bit
WiringSPlayShield.build.hardware=WiringSPlayShield

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

WiringV1.name=Wiring V1.0/Wiring Mini V1.0 @ 16 MHz
WiringV1.upload.protocol=wiring
WiringV1.upload.maximum_size=129024
WiringV1.upload.speed=115200
WiringV1.bootloader.low_fuses=0xBF
WiringV1.bootloader.high_fuses=0xDC
WiringV1.bootloader.extended_fuses=0xFF
WiringV1.bootloader.path=build/Wiring
WiringV1.bootloader.file=WiringBoot_Wiring-V1-Mega.hex
WiringV1.bootloader.unlock_bits=0x3F
WiringV1.bootloader.lock_bits=0x2F
WiringV1.build.mcu=atmega128
WiringV1.build.f_cpu=16000000L
WiringV1.build.core=AVR8Bit
WiringV1.build.hardware=Wiring1

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

WiringV1STK500.name=Wiring V1.0 @ 16 MHz (STK500)
WiringV1STK500.upload.protocol=arduino
WiringV1STK500.upload.maximum_size=129024
WiringV1STK500.upload.speed=115200
WiringV1STK500.bootloader.low_fuses=0xBF
WiringV1STK500.bootloader.high_fuses=0xDC
WiringV1STK500.bootloader.extended_fuses=0xFF
WiringV1STK500.bootloader.path=build/Wiring
WiringV1STK500.bootloader.file=WiringBoot_Wiring-V1-Mega.hex
WiringV1STK500.bootloader.unlock_bits=0x3F
WiringV1STK500.bootloader.lock_bits=0x2F
WiringV1STK500.build.mcu=atmega128
WiringV1STK500.build.f_cpu=16000000L
WiringV1STK500.build.core=AVR8Bit
WiringV1STK500.build.hardware=Wiring1

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

WiringV1Sparkfun1281.name=Wiring V1.1 ATmega1281 @ 16 MHz
WiringV1Sparkfun1281.upload.protocol=wiring
WiringV1Sparkfun1281.upload.maximum_size=129024
WiringV1Sparkfun1281.upload.speed=115200
WiringV1Sparkfun1281.bootloader.low_fuses=0xF7
WiringV1Sparkfun1281.bootloader.high_fuses=0xD4
WiringV1Sparkfun1281.bootloader.extended_fuses=0xFD
WiringV1Sparkfun1281.bootloader.path=build/Wiring
WiringV1Sparkfun1281.bootloader.file=WiringBoot_Wiring-V1.1-1281.hex
WiringV1Sparkfun1281.bootloader.unlock_bits=0x3F
WiringV1Sparkfun1281.bootloader.lock_bits=0x2F
WiringV1Sparkfun1281.build.mcu=atmega1281
WiringV1Sparkfun1281.build.f_cpu=16000000L
WiringV1Sparkfun1281.build.core=AVR8Bit
WiringV1Sparkfun1281.build.hardware=Wiring1.1

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

WiringV1Sparkfun2561.name=Wiring V1.1 ATmega2561 @ 16 MHz
WiringV1Sparkfun2561.upload.protocol=wiring
WiringV1Sparkfun2561.upload.maximum_size=260096
WiringV1Sparkfun2561.upload.speed=115200
WiringV1Sparkfun2561.bootloader.low_fuses=0xF7
WiringV1Sparkfun2561.bootloader.high_fuses=0xD4
WiringV1Sparkfun2561.bootloader.extended_fuses=0xFD
WiringV1Sparkfun2561.bootloader.path=build/Wiring
WiringV1Sparkfun2561.bootloader.file=WiringBoot_Wiring-V1.1-2561.hex
WiringV1Sparkfun2561.bootloader.unlock_bits=0x3F
WiringV1Sparkfun2561.bootloader.lock_bits=0x2F
WiringV1Sparkfun2561.build.mcu=atmega2561
WiringV1Sparkfun2561.build.f_cpu=16000000L
WiringV1Sparkfun2561.build.core=AVR8Bit
WiringV1Sparkfun2561.build.hardware=Wiring1.1

pyr0

Re: Timeout while uploading code to wiring board
« Reply #5 on: November 07, 2011, 08:10:29 AM »
Hi bhagman,

I'm sorry to say but it didn't work. I'm using OS X Lion, so I changed the content of the file /Applications/Wiring/Contents/Resources/Java/hardware/Wiring/boards.txt. After selecting Tools->Boards->Wiring V1.0 @ 16 MHz (STK500) in the menu, I pressed the reset button on the board and uploaded a short code to my board. I get the error "stk500_recv(): programmer is not responding".

Now I also get an error with Wiring 0027: "Programmer is not responding". The strange thing is, I remember that the first time I tried to upload the code with Wiring 0100, I got a different error. I'm not sure, but perhaps it was "timeout communicating with programmer".

Any ideas?

Thanks,
pyr0

bhagman

Re: Timeout while uploading code to wiring board
« Reply #6 on: November 07, 2011, 12:38:18 PM »
Have you got another board you can use to program the old board?  e.g. A new Wiring S, Arduino, or another board?

pyr0

Re: Timeout while uploading code to wiring board
« Reply #7 on: November 08, 2011, 08:52:05 AM »
Hi bhagman,

not yet. I do know people with Arduino boards. I let you know when I changed the bootloader on my board.

The bad thing is that I can't use my board with Wiring 0027 anymore, so it's practically useless at the moment...

barragan

Re: Timeout while uploading code to wiring board
« Reply #8 on: November 08, 2011, 09:24:41 AM »
Yes you need to replace your boot loader asap. Use the link I sent you before for the procedure. Also I see your board does;t have auto-reset, which means you need to press the reset button at the right time, that depends sometimes on the speed of your computer compiling, try to measure the time from the moment you click un the upload and the attempt to send data to the board (serial led rx for example), to press the reset right on time.

bhagman

Re: Timeout while uploading code to wiring board
« Reply #9 on: November 10, 2011, 11:49:37 AM »
Hernando, I don't have one of the old boards to have a quick look, but how difficult do you think it would be to get people to add a 0.1uF cap between the DTR signal and the reset line?

I'm hoping it's easy, then they can upgrade the old board.

barragan

Re: Timeout while uploading code to wiring board
« Reply #10 on: November 10, 2011, 08:52:24 PM »
could you post a picture of your board?