LowPowerLab Forum

Hardware support => MoteinoMEGA => Topic started by: sgoudelis on April 21, 2017, 10:49:32 AM

Title: having trouble programming [solved]
Post by: sgoudelis on April 21, 2017, 10:49:32 AM
Hello,

I just received my moteino mega a couple of days ago. I have being having issues flashing it. Every time I attempt to program it I get one of the following errors:


avrdude: stk500_paged_load(): (a) protocol error, expect=0x10, resp=0x00
avrdude: stk500_cmd(): programmer is out of sync
avr_read(): error reading address 0x0000
    read operation not supported for memory "flash"
avrdude: failed to read all of flash memory, rc=-2
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x00



...
avrdude: stk500_cmd(): programmer is out of sync
avrdude: stk500_cmd(): programmer is out of sync
avrdude: stk500_cmd(): programmer is out of sync
avrdude: stk500_cmd(): programmer is out of sync
avrdude: stk500_cmd(): programmer is out of sync
avrdude: stk500_cmd(): programmer is out of sync
avrdude: stk500_cmd(): programmer is out of sync
avrdude: stk500_cmd(): programmer is out of sync
...




avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00
An error occurred while uploading the sketch


I am using Arduino IDE 1.6.11 with the correct board selected and I am using this FTDI cable http://www.ebay.com/itm/1PCS-6pin-FTDI-FT232RL-USB-to-Serial-adapter-module-TTL-RS232-Arduino-cables-N-/181846983236?hash=item2a56ecc244:g:cxMAAOSwa39Ux4zU

Thats not the best cable I know but the power requirements are met.


Occasionally it actually flashes. Once every 30 attempts or so. I had issues with this since the very first attempt of programming it.

Any idea what is happening? I am also waiting for a second moteino to be delivered to me. When it comes I can test whether it is an issue with the moteino itself or not.
Title: Re: having trouble programming
Post by: Felix on April 21, 2017, 12:58:21 PM
Definitely looks like serial adapter issues.
While many other 3rd party will also work fine, I would recommend the FTDI-Adapter from the shop which was designed specifically for Moteinos and has a genuine FTDI chip.
Title: Re: having trouble programming
Post by: sgoudelis on April 21, 2017, 02:21:07 PM
Thank you for the comments. Is there a way I could use an ESP8266 USB to serial like this one: http://www.ebay.co.uk/itm/1PCS-USB-to-ESP8266-Serial-Wireless-Wifi-Module-Board-Developent-8266-Wifi-Modul-/191881754243?hash=item2cad0b3683:g:BVMAAOSwB9xXOuiG ?
Title: Re: having trouble programming
Post by: Felix on April 21, 2017, 03:04:09 PM
I don't know, I have not tried it.
Title: Re: having trouble programming
Post by: sgoudelis on April 21, 2017, 03:26:16 PM
Is there a recipe to flash it with another arduino ?
Title: Re: having trouble programming
Post by: Felix on April 21, 2017, 03:53:55 PM
Many out there, some discussed in the forum, many links with details how it can be done you can also find on the web.
I always wonder why some folks prefer to do those kinds of things and spend their time and money when there is an easy way.
Title: Re: having trouble programming
Post by: sgoudelis on April 21, 2017, 04:08:11 PM
For me it is because I want to get on with my project and not wait two weeks for the ftdi adapter to reach me. Will probably order one though.
Title: Re: having trouble programming
Post by: Felix on April 21, 2017, 04:18:00 PM
As long as you find a 5V power and 3.3v signal FTDI adapter with same header pins and DTR for reset, you should be OK.
Another option is to use DHL at checkout (~$30) - yes i know it's more than double the cost of the FTDI.
Another is to get everything in the beginning knowing that it might cost a lot more (time too) later ;)
Title: Re: having trouble programming
Post by: sgoudelis on May 07, 2017, 05:00:29 AM
An update regarding this. After I received a new USB-Serial adapter with a genuine FTDI chip the above issues reduced greatly but not completely. What actually made the issues go away completely was that fact that I made sure all other components of my project got their power supply from another source and not the moteino mega itself. After that there were no issues programming it.
Title: Re: having trouble programming
Post by: Felix on May 07, 2017, 08:06:46 PM
Thanks for the update, makes complete sense, I hope others see the value in using genuine components!
And you made another important find, that the Moteino LDO can only deliver a limited amount of current (@3.3v) and is not generally meant to power the whole project, especially when the transceiver is used at max output power.