Userspace Arduino

 Development Blogs for the Userspace Arduino project:
 * Primary Blog for work on the project
 * Parav Nagarsheth's Blog about his work on the project
 * Anuj Deshpande's Blog about his work on the 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)  Cross compilation

Native Compilation
You won't have to install any toolchain. Connect to your BeagleBone Black using ssh. Make sure that you have internet access on your BBB.

Clone repo
git clone http://github.com/prpplague/Userspace-Arduino.git
 * Clone the repo from the GitHub project page

Running a demo
Running Blink LED program: cd Userspace-Arduino/arduino-makefile/examples/BlinkUserspace make cd build-userspace ./BlinkUserspace.elf
 * A binary BlinkUserspace.elf should be created in a directory build-userspace
 * You will now see USR LED 1 blinking at one second intervals. Press Ctrl-C to break from the loop.

Install toolchain
~$ 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-
 * You will need the Angstrom cross compilation toolchain for the BeagleBone Black.
 * Run the following commands on your host machine (i.e. laptop/PC)

Links to 64 and 32 bit versions of Angstrom toolchain.
 * x86_64-linux-armv7a-linux-gnueabi-toolchain
 * i686-linux-armv7a-linux-gnueabi-toolchain

Clone repo
git clone https://github.com/prpplague/Userspace-Arduino.git
 * Clone the repo from https://github.com/prpplague/Userspace-Arduino

Running a demo
Running Blink LED program: cd Userspace-Arduino/arduino-makefile/examples/BlinkUserspace make make upload
 * A binary BlinkUserspace.elf should be created in a directory build-userspace
 * To upload the created binary file, do
 * You will now see USR LED 1 blinking at one second intervals. Press Ctrl-C to break from the loop.
 * Check out some of the examples in /path/to/Userscape-Arduino/Arduino-Makefile/examples.
 * HelloWorldUserspace
 * BlinkUserspace
 * BaconDemo
 * 7segment
 * PWM

Setup SSH keys (optional)
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
 * If you want to avoid a password prompt, you can set up the ssh keys for the Beaglebone Black:

= Boards Supported =

Beaglebone Black
Initial development is being done with the Beaglebone Black and the Bacon Cape ~# scp ~/Downloads/BB-BONE-BACONE-00A0.dtbo root@192.168.7.2:/lib/firmware/BB-BONE-BACONE-00A0.dtbo
 * if you have your Beaglebone Black loaded with a firmware image older that 07.11.2013, you will need copy the [[media:BB-BONE-BACONE-00A0.dtbo|Bacon Cape dtbo file]] on to your beaglebone black

MinnowBoard

 * Initial support started
 * Need Lure accessory board for testing

Raspberry Pi

 * support planned
 * will use RPi_Gertboard for initial development


 * Userspace_Arduino:To Do
 * Userspace_Arduino:Libraries