Avrdude: ser_recv(): programmer is not responding- Making my own ROV system using Beaglebone Black and Arduino


#1

Hello,

I am trying to duplicate a ROV system using Beagleboene black with Arduino Mega (2560) and an IMU. Wanted to test how to update IMU values on the cockpit from a post here. I have wired the connections between BBB and Arduino using the schematic files (sheet 7/8) placed on github.

Since BBB pins operate at 3.3v and Arduino operates at 5v, a bidirectional conveter was needed. The OpenROV controller board uses 8 channel bidirectional logic level shifterTxB0108 but I could not get that from the local market, so used some other 4 channel converters similar to this one. The IMU has also been connected to the Arduino I2C through the level converter. I have attached my hand drawn schematic for detail.

Problem is, when I try to upload the firmware code from the cockpit (launched using start.htm), the code compiles effortlessly but then fails to load on the arduino, giving me the following errors:

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

The BBB Transmit indicator LED as indicated in the schematic never blinks. Any hints on what might be wrong or how to proceed further on uploading firmware to Arduino would be appreciated.


#2

My guess would be that the system is trying to program over /dev/ttyO1 instead of the SPI device.

What version of the OpenROV software do you have on the beagelbone. If you look in the linux folder you can find some auto detect scripts. One of them tries to talk to the Arduino over the SPI pins. If it can do that, it sets the board settings in the /var/run folder and then the programming code will default to using SPI.

SPI is the best way to have the system wired up for programming. If you need to use the UART to do the programming via the boot loader on the Arduino, you will have to enable a reset pin as wired to a GPIO on the beagle bone which is currently not enabled in the OpenROV image.


#3

Thanks for your prompt reply @badevguru.
The OpenROV version is 30.0.0 Flash image (April, 2015) downloaded from here.
The folder you mention in /var/run has some directories and files without an extension (If these are the auto detect scripts you talking about). One of them is utmp that includes ascii characters and I can see tty0, 1,2,3 etc mentioned there, but doesn’t make sense to me. Like you mentioned, I would like the SPI to upload the firmware on the Arduino board.

Plus, can you see my schematics attached in the original post? I just want to make sure I am not doing something wrong with the wiring.

Edit: I guess you are right about BBB using ttyO1 to program rather than SPI, as indicated in the log:

Converting to firmware.hex
make: warning:  Clock skew detected.  Your build may be incomplete.
Searching for Board description file (boards.txt) ... /usr/share/arduino/hardware/arduino/boards.txt
Searching for Arduino lib version file (version.txt) ... /usr/share/arduino/lib/version.txt
Detecting Arduino software version ...  1.0.5 (1.0.5)
Searching for Arduino core library ... /usr/share/arduino/hardware/arduino/cores/arduino
Searching for Arduino variants directory ... /usr/share/arduino/hardware/arduino/variants
Searching for Arduino standard libraries ... /usr/share/arduino/libraries
Searching for make ... /usr/bin/make
Searching for avr-gcc ... /usr/bin/avr-gcc
Searching for avr-g++ ... /usr/bin/avr-g++
Searching for avr-ar ... /usr/bin/avr-ar
Searching for avr-objcopy ... /usr/bin/avr-objcopy
Setting up uploader
Initiating arduino reset on pin 32

avrdude: Version 6.1-svn-20130917, compiled on Apr  2 2015 at 09:47:54
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/etc/avrdude.conf"
         User configuration file is "/root/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyO1
         Using Programmer              : arduino
Arduino reset set high, Arduino enabled.
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00

#4

The command the system uses to validate it can talk to the Arduino over SPI is this:
https://github.com/OpenROV/openrov-cockpit/blob/master/linux/system-detect.sh#L6

It then puts either cape or board in this file

https://github.com/OpenROV/openrov-cockpit/blob/master/linux/system-detect.sh#L25

In your case you need to make sure you can talk over SPI. There should be some /dev/spidev* devices that represent the SPI. If those exist and you still cannot connect then it is probably something in the wiring.


#5

You will need to double check our actual spec file to validate the pin numbers. The picture I am attaching may be misleading, it is what I used ages ago when I initially prototyped the connection. A pin may have changed somewhere since.


#6

I found the system-detect.sh file that you mentioned in the following directory:

/opt/openrov/cockpit/linux/system-detect.sh

with similar file contents. When I list the devices in the /dev directory, two SPI ports can be seen as attached in the snap.

But the Upload Arduino Firmware shows the same error, indicating that it is using ttyO1 for uploading.

Regarding the wiring, I have a few questions:

  1. Am I not supposed to conect SPI wiring to the Arduino ICSP header as well?
    Your schematic show BBB’s GPIO pin 23 connected to Reset pin of Arduino, while the schematic for OpenROV 2.7 indicated P9_11 connected to Reset_n (of the ICSp header). Would you please help me understand that ?

2- Pin 17 (spi_0 CS0 )on BBB should be connected to Pin 53, no?


#7

Tried running the bootloader script as you mentioned here and see the following output:

  root@OpenROV:/opt/openrov/cockpit/linux# sh burn-bootloader.sh

  avrdude: Version 6.1-svn-20130917, compiled on Apr  2 2015 at 09:47:54
     Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
     Copyright (c) 2007-2009 Joerg Wunsch

     System wide configuration file is "/etc/avrdude.conf"
     User configuration file is "/root/.avrduderc"
     User configuration file does not exist or is not a regular file, skipping

     Using Port                    : /dev/spidev1.0
     Using Programmer              : linuxspi
     AVR Part                      : ATmega2560
     Chip Erase delay              : 9000 us
     PAGEL                         : PD7
     BS2                           : PA0
     RESET disposition             : dedicated
     RETRY pulse                   : SCK
     serial program mode           : yes
     parallel program mode         : yes
     Timeout                       : 200
     StabDelay                     : 100
     CmdexeDelay                   : 25
     SyncLoops                     : 32
     ByteDelay                     : 0
     PollIndex                     : 3
     PollValue                     : 0x53
     Memory Detail                 :

                              Block Poll               Page                       Polled
       Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
       ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
       eeprom        65    10     8    0 no       4096    8      0  9000  9000 0x00 0x00
       flash         65    10   256    0 yes    262144  256   1024  4500  4500 0x00 0x00
       lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00
       calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
       signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

     Programmer Type : linuxspi
     Description     : Use Linux SPI device in /dev/spidev*

     avrdude: error: AVR device not responding
     avrdude: initialization failed, rc=-1
     Double check connections and try again, or use -F to override
     this check.


         avrdude done.  Thank you.

So there is a fault somewhere with my connections I am unable figure out :confused: