Uploading arduino sketch from beaglebone

240 views
Skip to first unread message

Tom

unread,
Aug 24, 2013, 10:40:07 AM8/24/13
to beagl...@googlegroups.com
I'm wondering if there is an easier way to upload arduino sketches to an arduino using the command line? I've found this:
https://github.com/todbot/ArduinoOnBeagleBone/blob/master/building-beaglebone-avr-arduino-tools.txt but the last time it was updated was over a year ago. I've also run out disk space trying to follow those instructions. 

My arduino is always plugged into the BBB and it would be nice to be able to leave it plugged in when I want to update the firmware. 


Thanks in advance. 

Timbo

unread,
Aug 25, 2013, 7:52:32 PM8/25/13
to beagl...@googlegroups.com
Hi Tom,
If you can do the compilation on the desktop, or on another PC, uploading the binaries is straightforward with avrdude.  eg. to upload to an Uno:
$ avrdude -C /usr/share/arduino/hardware/tools/avrdude.conf -p atmega328p -c arduino -P /dev/ttyACM0 -b 115200 -D -U flash:w:$HOME/arduino/sketch.cpp.hex:i

The USB device name may be different under different linux distributions.  Just look in /dev to see what device appears when you plug the Arduino in.

You may need to give yourself permission to access the serial devices, eg:
$ sudo usermod -a -G tty tim
$ sudo usermod
-a -G dialout tim

Tom

unread,
Aug 28, 2013, 3:45:33 AM8/28/13
to beagl...@googlegroups.com
Thanks, I'll definitely be using this in the meantime. Eventually, it would be nice to change a file, and with one command compile and flash. Just have to wait for someone smarter than me to figure it all out. Until then, thanks Timbo. 


Tom

Timbo

unread,
Aug 28, 2013, 11:27:12 AM8/28/13
to beagl...@googlegroups.com
Command line compilation for Arduino is awkward because the Arduino gui makes a lot of changes to the sketch code, and it's hard to reliably reproduce all these changes with a makefile.  There are a few projects which attempt to do this, including Arduino-mk and Inotool.  Let us know if you get one of them working on the BBB.

Tom

unread,
Aug 28, 2013, 2:39:08 PM8/28/13
to beagl...@googlegroups.com
Will do. I spent a good portion of the morning playing with Arduino-mk on ubuntu. I haven't heard of Inotool, I'll look into it. 
Thanks again. 
Reply all
Reply to author
Forward
0 new messages