Timeout communicating with programmer

Raspberry Pi - MegaPi Hat related Question/Answers.
h.wills
Posts: 8
Joined: Mon Mar 20, 2017 12:46 am

Timeout communicating with programmer

Post by h.wills » Wed Apr 26, 2017 11:00 am

Hi

Just received my MegaPi Hat for a Raspberry Pi 3 and when I went to run my intended code through the Arduino IDE it came up with:

avrdude: stk500v2_RecieveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer

I have heard there have been a few issues with the RPi 3 and have tried disabling the UART ttyS0 and ttyAMA0, as well as changing the different options in the 'Tools' bar in the Arduino IDE - all with no luck. Have spent the best part of a day trying to hack this one but am running out of options so hope someone can help me out with this.

Cheers

Bertus Kruger
Site Admin
Posts: 1360
Joined: Wed Feb 03, 2016 10:26 pm
Location: Wellington , New Zealand
Contact:

Re: Timeout communicating with programmer

Post by Bertus Kruger » Wed Apr 26, 2017 7:09 pm

h.wills wrote:
Wed Apr 26, 2017 11:00 am
Hi

Just received my MegaPi Hat for a Raspberry Pi 3 and when I went to run my intended code through the Arduino IDE it came up with:

avrdude: stk500v2_RecieveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer

I have heard there have been a few issues with the RPi 3 and have tried disabling the UART ttyS0 and ttyAMA0, as well as changing the different options in the 'Tools' bar in the Arduino IDE - all with no luck. Have spent the best part of a day trying to hack this one but am running out of options so hope someone can help me out with this.

Cheers
Hi,

Start with a fresh RPi image.
Run only the RPi 3 script to setup the Serial port.

Testing the serial port can be done as follow : http://wiki.protoneer.co.nz/Raspberry_P ... leShooting

Only go on after the previous test succeeded... :)

Then you can try to program the MegaPi again. The sync issue is usually just a timing issue. Its worth retrying if it does not flash the first time.
(This can be due to the Pi pins not being in the right state after a refresh.)

Hope this helps

h.wills
Posts: 8
Joined: Mon Mar 20, 2017 12:46 am

Re: Timeout communicating with programmer

Post by h.wills » Thu Apr 27, 2017 12:46 am

Thanks for the quick reply

I have tried the loop test with Minicom, Screen and Putty but none of them seen to want to connect to the serial. Minicom looked the most promising as I was able to get to the main screen where it says 'CTRL A Z to exit' but then it wouldn't let me type anything or even exit.
I have gone through method 1 in the 'Connection to a microcontroller or other peripheral' section on this website (http://elinux.org/RPi_Serial_Connection ... peripheral) so assume it is good to go but again just getting stuck and chasing my tail.

Thanks

h.wills
Posts: 8
Joined: Mon Mar 20, 2017 12:46 am

Re: Timeout communicating with programmer

Post by h.wills » Thu Apr 27, 2017 7:30 am

Ok, got it printing back on Putty via the AMA port which is weird because doesn't the 'RPi 3 Script' on Github swap the AMA and S0 ports. Anyway, in the Arduino IDE the only port available was AMA so I commented out the 'dtoverlay...' in config.txt to make the AMA port return via Putty. However after all this and trying all the different Programmer options in the IDE Toolbox it is still giving my the same timeout error. Any ideas? Does there need to be anything in my code calling avrdude? Sorry for all the nube questions :roll:

Bertus Kruger
Site Admin
Posts: 1360
Joined: Wed Feb 03, 2016 10:26 pm
Location: Wellington , New Zealand
Contact:

Re: Timeout communicating with programmer

Post by Bertus Kruger » Thu Apr 27, 2017 7:46 pm

the RPi 3 script disables S0 and defaults back to AMA0 for UART.

What board did you select in Arduino?

Could you post the full output of the Arduino IDE when uploading?

h.wills
Posts: 8
Joined: Mon Mar 20, 2017 12:46 am

Re: Timeout communicating with programmer

Post by h.wills » Thu Apr 27, 2017 8:45 pm

In 'Board' I have selected 'Arduino Mega 2560 or Mega ADK' and in programmer I have currently selected 'ARVISP mkII'. Sure:

avrdude: stk500v2_RecieveMessage( ): timeout
avrdude: stk500v2_RecieveMessage( ): timeout
avrdude: stk500v2_RecieveMessage( ): timeout
avrdude: stk500v2_RecieveMessage( ): timeout
avrdude: stk500v2_RecieveMessage( ): timeout
avrdude: stk500v2_getsync( ): timeout communicating with programmer

Through my own research this is the most informative post I found that you may find helpful/interesting (http://stackoverflow.com/questions/1964 ... ge-timeout).

Thanks again

Bertus Kruger
Site Admin
Posts: 1360
Joined: Wed Feb 03, 2016 10:26 pm
Location: Wellington , New Zealand
Contact:

Re: Timeout communicating with programmer

Post by Bertus Kruger » Sat Apr 29, 2017 9:04 pm

Sorry to be pain but could you please enable verbose output in the Arduino settings and add a full output again..

AVRDUDE needs to use the modified ATMEGA2560 script to upload to the board. The verbose output will tell us if the script is running the right flash tool.

h.wills
Posts: 8
Joined: Mon Mar 20, 2017 12:46 am

Re: Timeout communicating with programmer

Post by h.wills » Sun Apr 30, 2017 9:40 am

No worries:

avrdude: Version 6.1, compiled on Jul 7 2015 at 10:29:47
Copyrite (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyrite (c) 2007-2014 Joerg Wunsch

System wide configuration file is "/usr/share/arduino/hardware/tools/avrdude.conf"
User configuration file is "/home/pi/.avrduderc"
User configuration file does not exist or is not a regular file, skipping

Using Port : /dev/ttyS0
Using Programmer : wiring
Overriding Baud Rate : 115200
avrdude: wiring_open(): releasing DTR/RTS
avrdude: wiring_open(): asserting DTR/RtS
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . 14
avrdude: Recv: . [00]
avrdude: Recv: . [00]
avrdude: Recv: . [00]
avrdude: Recv: . [00]
avrdude: Recv: . [00]
(many more)
avrdude: stk500v2_RecieveMessage( ): timeout
avrdude: stk500v2_getsync( ): timeout communicating with programmer

What is the modified ATMEGA2560 script too? Is that the AVRDUDE command line at the top of a script to specify all the different inputs etc?
Thanks

Bertus Kruger
Site Admin
Posts: 1360
Joined: Wed Feb 03, 2016 10:26 pm
Location: Wellington , New Zealand
Contact:

Re: Timeout communicating with programmer

Post by Bertus Kruger » Sun Apr 30, 2017 8:03 pm

Right, I can see two issues...

On a clean RPI image using the MegaPi Arduino install scripts it would use ttyAMA0 and it will write "RPI-ATMega2560" in the output window.

When you installed the Raspberry Pi Avrdude scripts, did you have any errors come up?
https://github.com/Protoneer/RaspberryP ... vrdude-rpi

h.wills
Posts: 8
Joined: Mon Mar 20, 2017 12:46 am

Re: Timeout communicating with programmer

Post by h.wills » Thu May 04, 2017 4:16 am

Sorry for the late reply, just got back to Uni...ok I see. No I didn't have any errors.
I will re-download the RPI image. I know how to download the raw files with the 'wget' command but how do I actually install/run them? Do I just open them in Python and then press F5?

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest