Trouble loading code into cape bd


#1

Got cape bd. on Friday THANKS!!!!

Am powering system throught cape bd. with power supply, 12 volts, hooked to battery terminals

Moved image to SD card

Using Google Crome can connect and see camera image and Cockpit using IP (connection icon is green)

I cannot make any motors run in diagonostic and battery shows 0.0 volts

I think I need to load Arduino firmware in cape board which I have not done

going to settings and upload firmware, I don't understand what file I need to upload????

I have never worked the Arduino chips, lots of time with PIC chips and code

leds on BeagleBone board: user led 0 green blinking, green pwr led on, network leds flashing

cape bd.: have 11.81 volts on Vn pin, 3.31 volts on 3.3 volt pin and 4.99 volts on 5 volt pin, led1 green on

do not have 5 volt pins to motor esc hooked up, just gnd. and signal wires

1934-elechousingsideview2.jpg (187 KB) 1935-elechousingsideview.jpg (154 KB) 1936-elechousingwithbeagelboneandcape.jpg (168 KB)

#2

John,

a good description how to update the beaglebone software and uploading the arduino firmware to the cape can be found here:

http://wiki.openrov.com/index.php/Update_Software

However, I had problems with the last step. When clicking "Apply New Firmware", the upload did not seem to work and I had repeately the message "avrdude: stk500_recv(): programmer is not responding avrdude done." I finally managed to upload the code by putting the ATMega to an Arduino (UNO) board, uploading the code there and putting it back to the openrov cape.

There is also a thread for this:

http://openrov.com/forum/topics/beaglebone-cape-seems-to-not-function

Kind regards,

Stefan


#3

I have spent the day trying to upload the firmware and get no place

have tried a lot of times, here are the messages:

unpack: build dir is /tmp/tmp.568e8npnT5
un-tared /temp/rov.tar[1].gz in /tmp/tmp.568e8npnT5/src
src/OpenROV.ino
Searching for Arduino lib version file (version.txt) ... /usr/share/arduino/lib/version.txt
Detecting Arduino software version ... 1.0 (1.0)
Scanning dependencies of src
Scanning dependencies of arduino
Scanning dependencies of Servo
src/Timer.cpp
src/Command.cpp
src/Device.cpp
src/Motors.cpp
src/OpenROV.cpp
Servo/Servo.cpp
Linking libServo.a
arduino/wiring_digital.c
arduino/wiring.c
arduino/wiring_shift.c
arduino/wiring_analog.c
arduino/wiring_pulse.c
arduino/WInterrupts.c
arduino/Print.cpp
arduino/USBCore.cpp
arduino/HardwareSerial.cpp
arduino/Tone.cpp
arduino/HID.cpp
arduino/Stream.cpp
arduino/new.cpp
arduino/main.cpp
arduino/WMath.cpp
arduino/WString.cpp
arduino/IPAddress.cpp
arduino/CDC.cpp
Linking libarduino.a
Linking firmware.elf
Converting to firmware.hex
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 (1.0)
Searching for Arduino core library ... /usr/share/arduino/hardware/arduino/cores/arduino
Searching for Arduino standard libraries ... /usr/share/arduino/libraries
Searching for Arduino variants directory ... /usr/share/arduino/hardware/arduino/variants
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
avrdude: stk500_recv(): programmer is not responding

avrdude done. Thank you.

Searching for stty ... /bin/stty
Searching for avrdude ... /usr/share/arduino/hardware/tools/avrdude
Searching for avrdude.conf ... /usr/share/arduino/hardware/tools/avrdude.conf
Initiating arduino reset
upload failed, trying again.
avrdude: stk500_recv(): programmer is not responding avrdude done. Thank you.
Initiating arduino reset
upload failed, trying again.
avrdude: stk500_recv(): programmer is not responding avrdude done. Thank you.
Initiating arduino reset
upload failed, trying again.
avrdude: stk500_recv(): programmer is not responding avrdude done. Thank you.
Initiating arduino reset
upload failed, trying again.
avrdude: stk500_recv(): programmer is not responding avrdude done. Thank you.
Initiating arduino reset
upload failed, trying again.
avrdude: stk500_recv(): programmer is not responding avrdude done. Thank you.
Initiating arduino reset
upload failed, trying again.
avrdude: stk500_recv(): programmer is not responding avrdude done. Thank you.
Initiating arduino reset
upload failed, trying again.
avrdude: stk500_recv(): programmer is not responding avrdude done. Thank you.
Initiating arduino reset
upload failed, trying again.
avrdude: stk500_recv(): programmer is not responding avrdude done. Thank you.
Initiating arduino reset
upload failed, trying again.
avrdude: stk500_recv(): programmer is not responding avrdude done. Thank you.
Initiating arduino reset
upload failed, trying again.
avrdude: stk500_recv(): programmer is not responding avrdude done. Thank you.
cat: output.log: No such file or directory

any help would be appreciated

1937-testingbd.jpg (196 KB)

#4

This is exactly the same problem that I had, too. I only could fix it by removing the ATMega from the cape, putting it on an Arduino board, uploading the code there and putting it back to the cape.

-Stefan


#5

I went to Radio Shack and bought an Arduino UNO board. Programmed the chip as you did. Put the new programmed chip in the Cape board and it works.

If David would send me another Cape board I will try to figure out what is wrong with the programming of the cape board by the Beaglebone board. I don't want to keep taking apart my working system. It has taken me a couple of months to get this far and I want to see the OpenROV in the water. Using my o'scope I should be able to check and see if the right signal lines are being set. I can compare the UNO board in programming to the BeagleBone bd.


#6

+1 for the issue from the Kit cape.


#7

#8

(Given this may all be a completely wrong, but posting what I am seeing in case it triggers someone to zero in on the real problem...)

Hmm. Well I can get it the Arduino to respond by changing the board and programmer .txt files to use 9600 baud... which is what is reported when I call iso serail...

rov@OpenROV:/usr/share/arduino/hardware/arduino$ sudo ino serial -p /dev/ttyO1
picocom v1.4

port is : /dev/ttyO1
flowcontrol : none
baudrate is : 9600
parity is : none
databits are : 8
escape is : C-a
noinit is : no
noreset is : no
nolock is : yes
send_cmd is : ascii_xfr -s -v -l10
receive_cmd is : rz -vv

Terminal ready

FATAL: read from term failed: Resource temporarily unavailable

Which gives me a sync error now instead (which seems better than not responding):

avrdude: stk500_getsync(): not in sync: resp=0x61 avrdude done. Thank you.
Initiating arduino reset
upload failed, trying again.
avrdude: stk500_getsync(): not in sync: resp=0x3b avrdude done. Thank you.
cat: output.log: No such file or directory


#9

+2 for the Kit cape.

further, when connected via crossover to laptop, I have video, but no voltage report.

when connected via router, no video, no voltage.

Cape SPI red LED flashes one or twice on start up in both cases. Power supply is 12v gel cel 7.0 amp/h reading 13.2v


#10

And managed to get the SPI red LED to come up a solid red now... I'm assuming that is a step backwards? May be off to Radio Shack for a Arduino UNO like the rest...


#11

Which if I understand correctly means the SCK pin has gone low which appears to be part of the standard protocol to prepare to send data. And that the MOSI should go high to start the transfer which should trigger flashes on the LED as the clock cycles. Not sure why it comes on by default after power cycling the bb+cape.


#12

I managed to uploade code to the cape for the first time!

I did not have the time to go through all the scripts that are used for the upload via the browser in order to find the problem, but I had sucess with the following simple example http://inotool.org/quickstart.

You can do all the steps described there, but after the build, instead of calling

ino upload

you should execute:
/opt/openrov/linux/setuart.sh
/opt/openrov/linux/reset.sh
ino upload -p /dev/ttyO1

The crucial thing about this is to call the upload command VERY fast after the reset (use a script or the command line history).

Now I think the whole issue is just a matter of timing.

After having sucess with this simple example I was also able to upload the OpenROV Arduino code the same way.



#13

Sorry for the bad formatting. One more try:

You can do all the steps described there, but after the build, instead of calling

ino upload

you should execute:

/opt/openrov/linux/setuart.sh

/opt/openrov/linux/reset.sh

ino upload -p /dev/ttyO1

The crucial thing about this is to call the upload command VERY fast after the reset (use a script or the command line history).

Now I think the whole issue is just a matter of timing.

After having sucess with this simple example I was also able to upload the OpenROV Arduino code in the same manner.


#14

Shoot. Looks like it actually loaded the code during my troubleshooting.


#15

Worked for me as well. I ended up:

1. Create a script:

#!/bin/sh


/opt/openrov/linux/setuart.sh &

/opt/openrov/linux/reset.sh &

ino upload -p /dev/ttyO1

2. chmod it as executable

3. go to the \tmp folder and found one of the orphaned uploads from the openrov cockpit upload

4. sudo chmod -R 755 <tmp.???>

5. change to the folder

6. ran "ino build"

7. ran the script from step 1. Took a couple tries as I would get sync errors. Eventually get the following:

Initiating arduino reset

avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.00s

avrdude: Device signature = 0x1e950f
avrdude: reading input file ".build/uno/firmware.hex"
avrdude: writing flash (9674 bytes):

Writing | ################################################## | 100% 1.40s

avrdude: 9674 bytes of flash written
avrdude: verifying flash memory against .build/uno/firmware.hex:
avrdude: load data flash data from input file .build/uno/firmware.hex:
avrdude: input file .build/uno/firmware.hex contains 9674 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 1.10s

avrdude: verifying ...
avrdude: 9674 bytes of flash verified

avrdude: safemode: Fuses OK

avrdude done. Thank you.


#16

Same problem here ('avrdude: stk500_recv(): programmer is not responding' messages). Cape and BB is powered by an external 12V battery.

In addition to the web upload I also tried the script above, but didnt help. :(

I also noticed that the reset.sh command makes three short red flashes on the cape if I have the web page open (streaming video). If I close the web page and run reset.sh it flashes two short and one long flash.


#17

I'm back building, and am stuck at loading s/w into the cape.

I can connect via Chrome on 192.168.254.1:8080, and get live video streamed back.

I'm trying to connect via Terminal (MacOSX) with no luck:

ssh -1 rov 192.168.254.1
ssh: Could not resolve hostname rov: nodename nor servname provided, or not known

I have no knowledge of linux at all, so this is as far as I can get logging into the Beagle.


#18

Hey Dale. That should be a lower case L "-l" not a 1.

ssh 192.168.254.1 -l rov


#19

Thanks Brian, I'm back again, will test it out in the am here.


#20

Couple things:

The system is uploading firmware the first time when I do it directly on the beagle through the console AND first shut down the node process. It seems to prevent the sync issue.

I suspect their is an environment issue when running 'ino' using the firmware-* scripts. When i run those scripts from the terminal 'ino upload' always fails for me with the programmer unavailable issue. I have no trouble using the abreviated script I mentioned earlier in the thread and I've essentially copy and pasted the abreviated script in to the firmware-upload.sh script.

When I run the firmware-upload script without the -m ATMEGA... command line option on the ino upload line the system cannot find the avrdude.conf. When I run those same commands without using firmware-install.sh I have no issue.