On Sep 30, 2015, at 8:20 AM, Grant Likely <grant.likely@linaro.org> wrote:

[cc'ing dev list. This can be discussed in public]

On Wed, Sep 30, 2015 at 12:37 PM, Daniel Thompson
<daniel.thompson@linaro.org> wrote:
Hi Grant

On 28/09/15 15:57, Grant Likely wrote:

On Mon, Sep 28, 2015 at 3:47 PM, Grant Likely <grant.likely@linaro.org>
wrote:

Update on the Sensors board.

Unfortunately, some of the boards got shipped out without the Arduino
bootloader installed on the Atmel. Before you can use the procedure in
the starter guide, you'll need to disconnect the Sensors board from
your 96boards baseboard and flash the bootloader. Pretty much any
flashing method will work, but the easiest is probably to use another
Arduino as a programmer as documented here (unless you already have an
AVR-ISP programmer, in which case use that):

https://www.arduino.cc/en/Tutorial/ArduinoISP

I've also updated the getting started guide.

Sorry for the inconvenience. Let me know if you have any trouble
flashing the bootloader.


Also, can you please let me know if your board was missing the
bootloader, and if you were able to get it reflashed?


Not sure if you want private e-mail to report troubles with the AVR or if I
should put it on dev@... For now I've just done a straight reply but I'm
happy to widen things.


Either but anyhow my sensors board really isn't doing what I would expect.

I've run a quite a few different experiments after looking at the schematic
to try and figure out what is going on. The (somewhat lengthy) results are
as follows:

1. When power is applied to baseboard (Dragonboard 410c in my case) the
  PB5 LED (red) comes on briefly then goes out and it replaced by the
  reset LED (blue).

2. avrdude (run via make upload) fails with "avrdude: stk500_getsync()
  attempt 1 of 10: not in sync: resp=0x00" errors. When avrdude is run
  the blue LED goes out and PB5 starts to blink.

Sounds like the bootloader is indeed missing and the manufacturing
test sketch is still on the board. The test sketch blinks LEDs on all
the pins.

3. Running avrdude again interrupts the timing of the blink sequence
  It looks like avrdude can place the AVR into reset.reset.

Yes, that sounds right.

4. Shorting UART0 TX/RX on the LS connector (with the sensors board
  not fitted) results in character echo so we know the Dragonboard UART
  is able to send receive characters.

5. Shorting TX/RX after level shifting does *not* result in character
  echo. I tried on the arduino connector (P5) and directly on AVR pins
  30 and 31.

This may not work as the AVR is also driving the UART RX signal. It
probably prevents the signal from going low enough to be detected.

6. I can light D7 using GPIO36 and the sysfs interface although the
  lamp strength is very weak.

I will check into that on my board.

7. Connecting a SW to P12 allows me to read the state of the switch.
  D7 also lights up and the lamp strength is much brighter. This is
  since in both cases

8. USBtinyISP cannot program the AVR using the ISP connector. I have
  checked the programmer with another ATMega328P based board and it is
  working OK.

I've not tried the ISP connector. It may be that we screwed it up
somehow. George, have you tried it?

No - but I successfully programmed the bootloader onto the sensor board 
using another Arduino Uno (actually the original CircuitCo board) and the 
instructions in the link below. Then everything started working, though you 
do need to do the stty -F /dev/ttyxxx -hupcl to bring the board out of reset 
after uploading a sketch. 

This was the very first batch of
boards, so there are things that I know are wrong and will be fixed
before going into production.

~~~
...
avrdude: Using SCK period of 10 usec
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.
~~~

9. (I suspect you have already discovered this but just in case...) the
  P2 (arduino 1x10) and P3 (ISP) are too close together to allow
  a normal IDC connector to be attached to P3. ;-)

For the next run I want to move the ISP connector down to the same
location it is on a real arduino. That will solve the connector
problem and also make it compatible with more shields.

I'm pretty confused at this point, to the point of suspecting multiple
faults. Next steps for me will be with a continuity tester...

Actually, most of this sounds to be symptoms of a missing bootloader.
Since you can't get USBtinyISP to program the board, do you have an
arduino board handy that you can run the ArduinoISP sketch on? I used
the following instructions for flashing the bootloader:

https://www.arduino.cc/en/Tutorial/ArduinoISP

Feel free to make comments on the Getting Started guide as you find things.

https://docs.google.com/document/d/1GNoC-1C1xcejgLLvgm1JbpF7blwJigXq5XIB3FvnuIE/edit#

g.