Difference between revisions of "Userspace Arduino"

From eLinux.org
Jump to: navigation, search
Line 6: Line 6:
 
</div>
 
</div>
 
<br />
 
<br />
This page documents how to Get Started with writing Arduino code for the embedded Linux boards.
+
A Getting Started guide on compiling and executing "Arduino code" on embedded Linux boards.
 
<br />
 
<br />
  
 
= Getting Started =
 
= Getting Started =
 +
There are 2 methods to run Arduino code on the BeagleBone Black.
 +
# Native compilation
 +
# Compilation using a cross compiler
  
 
== Toolchain ==  
 
== Toolchain ==  

Revision as of 00:42, 8 September 2013

Development Blogs for the Userspace Arduino project:


A Getting Started guide on compiling and executing "Arduino code" on embedded Linux boards.

Getting Started

There are 2 methods to run Arduino code on the BeagleBone Black.

  1. Native compilation
  2. Compilation using a cross compiler

Toolchain

BeagleBone Black

~$ wget http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-x86_64-linux-armv7a-linux-gnueabi-toolchain.tar.bz2
~$ sudo tar -C / -xjf angstrom-2011.03-x86_64-linux-armv7a-linux-gnueabi-toolchain.tar.bz2
~$ export PATH=/usr/local/angstrom/arm/bin:$PATH
~$ export CROSS_COMPILE=arm-angstrom-linux-gnueabi-


Links to 64 and 32 bit versions of Angstrom toolchain.


MinnowBoard

  • todo

Raspberry Pi

  • todo

Cloning

git clone https://github.com/prpplague/Userspace-Arduino.git


Running a demo


Running Blink LED program:

cd Userspace-Arduino/arduino-makefile/examples/BlinkUserspace
make
  • A binary BlinkUserspace.elf should be created in a directory build-userspace
  • send-exec is an upload and execute script, which is integrated with the Arduino-Userspace repository. It uses the scp protocol to copy binaries to the Beaglebone Black over USB/ethernet and execute it. You can find it in the utility folder.
  • To use it, simply do
make upload 

Setup SSH keys (optional)

  • If you want to avoid a password prompt, you can set up the ssh keys for the Beaglebone Black:
cd ~/.ssh
ssh-keygen -t dsa #set a password or you can leave it blank
ssh-copy-id -i ~/.ssh/id_dsa.pub root@$192.168.7.2 # replace id_dsa.pub by your public key file if some other name is given
ssh root@192.168.7.2 # login and enter password once

Here after, you won't be prompted for a password from this machine

Boards Supported


Beaglebone Black

Initial development is being done with the Beaglebone Black and the Bacon Cape

  • if you have your Beaglebone Black loaded with a firmware image older that 07.11.2013, you will need copy the Bacon Cape dtbo file on to your beaglebone black
~# scp ~/Downloads/BB-BONE-BACONE-00A0.dtbo root@192.168.7.2:/lib/firmware/BB-BONE-BACONE-00A0.dtbo
Arduino Pin BBB Header Pin Function Alternate Function
0 P9_11 UART (RXD)
1 P9_13 UART (TXD)
2 P9_15 GPIO
3 P9_14 PWM
4 P9_12 GPIO
5 P9_16 PWM
6 P9_42 PWM
7 P8_19 GPIO PWM
8 P9_19 I2C (SCL)
9 P9_20 I2C (SDA)
10 P9_17 GPIO SPI_CS0
11 P9_18 GPIO SPI_MOSI
12 P9_21 SPI_MISO
13 P9_22 GPIO SCK
14 USR LED 0 LED
15 USR LED 1 LED
16 USR LED 2 LED
17 USR LED 3 LED
18 P9_33 AIN4
19 P9_35 AIN6
20 P9_36 AIN5
21 P9_37 AIN2
22 P9_38 AIN3
23 P9_39 AIN0
24 P9_40 AIN1


MinnowBoard

  • Initial support started
  • Need Lure accessory board for testing


Raspberry Pi