avrdude problems

Started by loseymark, April 20, 2016, 03:05:48 PM

loseymark

Attempting to program my mightyhat with avrdude. I have a hex file created from the sample sketch and downloaded to rpi.

avrdude gives error

avrdude-original: stk500_recv(): programmer is not responding
avrdude-original: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00

here is the command:
avrdude -c arduino -p atmega328p -P /dev/ttyAMA0 -b 115200 -U flash:w:/home/pi/mightyhat/mightyhat.ino.with_bootloader.standard.hex

I would also like to have any info on troubleshooting like how I can test whether the board is functioning correctly and whether ttyAMA0 is available or not, etc.

Felix

Re programming see this page: http://lowpowerlab.com/mightyhat/#programming
Re Pi3 serial port compatibility see this page: http://lowpowerlab.com/mightyhat/#compatibility

The avrdude method may not always work very realiably simply because natively avrdude does not have a way to assert a custom reset pin on the GPIO. If you were to try this with a USB connected Moteino it would work flawlessly. The way we hack around this limitation is to modify avrdude and try to reset the target  before avrdude starts its upload attempt. There is a delay inserted in that process which is the actual issue. I've seen this delay work without a problem, repeatedly, on one day, then work only intermittently on another day so I am not 100% sure how to fix it permanently other than playing around with the delay to find a good stable delay. The delay is found in the avrdude script, see the page above for how that works.

One important aspect: you cannot use the serial port while trying to program it! Ie it has to be completely free and not busy with the gateway or some other script that uses it.