LowPowerLab Forum

Hardware support => Moteino => Topic started by: sk1 on May 23, 2018, 08:36:22 PM

Title: "START!" from serial port, but won't program
Post by: sk1 on May 23, 2018, 08:36:22 PM
Greetings all,

Wanted to put this question out on the forum before sending in a support request. I have, brand new, 2 moteino with trace antenna and 2 moteino regular (wire antenna).  One trace antenna moteino will not program. 

This is a brand new moteino with trace antenna that will not load any sketch -- Note -- this is brand new and I have never programmed anything into it.

There are two major indicators, even though I don't know what is wrong... First interesting thing is the error output from the arduino IDE isn't the "usual" output you would get with an error, the output is listed below.  Second interesting thing is if I set the Serial Monitor baud to 115200 then when I plug in the moteino, it outputs "START!" to the terminal. (I set it to blue color for emphasis in this post) I confirmed this by using PuTTY as a serial terminal as well, so "START!" is definitely coming from the Moteino.

Here is the output from the arduino IDE log during uploading:

Sketch uses 10598 bytes (33%) of program storage space. Maximum is 31744 bytes.
Global variables use 790 bytes (38%) of dynamic memory, leaving 1258 bytes for local variables. Maximum is 2048 bytes.
C:\Users\Steve\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.0.1-arduino5/bin/avrdude -CC:\Users\Steve\AppData\Local\Arduino15\packages\Moteino\hardware\avr\1.3.0/avrdude.conf -v -patmega328p -carduino -PCOM23 -b115200 -D -Uflash:w:C:\Users\Steve\AppData\Local\Temp\arduino_build_741927/Node.ino.hex:i

avrdude: Version 6.0.1, compiled on Apr 15 2015 at 19:59:58
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Users\Steve\AppData\Local\Arduino15\packages\Moteino\hardware\avr\1.3.0/avrdude.conf"

         Using Port                    : COM23
         Using Programmer              : arduino
         Overriding Baud Rate          : 115200
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x53
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x54
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x41
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x52
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x54
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x21
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x21
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x21
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x21
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x21

avrdude done.  Thank you.

Problem uploading to board.  See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.


-----------

So thats the problem, this moteino with trace antenna will not upload a sketch through the serial port.  The other 3 new moteinos work normally.


Any help appreciated - thanks



Title: Re: "START!" from serial port, but won't program
Post by: Felix on May 24, 2018, 08:40:31 AM
Hi sk1,

What hardware/programmer are you using? Is this via the FTDI 6 pin header?
How is the onboard LED react when you initiate programming on the 3 working ones, and the 1 non-working?
It should be blinking indicating that it was reset and enters the bootloader.

The boards are all programmed and tested before they are shipped, this should guarantee the boards:
- can reset, and accept a new sketch via serial using an FTDI programmer or equivalent
- essential peripherals are working, including GPIO that control and the transmission/reception of the radio, and/or FLASH-MEM
Title: Re: "START!" from serial port, but won't program
Post by: sk1 on May 25, 2018, 12:35:35 PM
Its with an FTDI cable. The LED flickers at the very beginning and is the same as the other good ones as best I can tell.  Since I've never programmed it, do any of your  'factory' programs print "START!" at 115200 when it boots up?  I happened to have the serial monitor already up at that rate, and it prints "START!" (no quotes) when I plug in the FTTI connector.  I was going to post a video of the bad board programming but my phone won't make a video less than 500KB, they are more like 30+MB. I tried trimming one but could only get it to about 7MB.
Title: Re: "START!" from serial port, but won't program
Post by: sk1 on May 25, 2018, 04:27:15 PM
I dug out my Atmel ICE and connected the Moteino with trace antenna to it.  I was able to read the memory and compare it to the various bootloader hex files from Github.  Its memory matches "DualOptiboot_V5.0_atmega328_BlinkD9_SPIdisable.hex".

When I searched that hex file for the ascii code for START! and that string does appear in the hex file but coudn't find the string START! in the C file source, so not sure about that - why its in the hex file but not the source

Using the ICE I can read and write the flash, and even programmed it with the hex file for a "Blinky" flashing the LED on pin 9 and it works fine. 

I also tried programming it with other boodloaders, DualOptiboot_V5.0_atmega328_BlinkD9.hex, and the standard one for the UNO, but none of them work to reload via the FTDI interface.  Since it prints START! over the serial port write when power is applied, that direction is working, but there is definitely something wrong going in from the FTDI interface.

Title: Re: "START!" from serial port, but won't program
Post by: Felix on May 25, 2018, 06:20:29 PM
START! is from the test sketch I load on all of them.
If you'd like, you can return it and I can debug/repair or replace it for you. Whatever works for you... let me know via email/contact page (https://lowpowerlab.com/contact).
Title: Re: "START!" from serial port, but won't program
Post by: perky on May 26, 2018, 09:00:42 AM
If the START! is coming from the application code then either the application is immediately running on a reset instead of the bootloader, or the bootloader is timing out without detecting a sync. Note the responses from getsync is ASCII for START!. I think maybe the RX from the FTDI to the Moteino is broken. Also worth checking the fuses aren't set to boot directly to application.

Mark.