Go Down

Topic: Now you can compile sketches on the Yun! (Read 458 times) previous topic - next topic

noblepepper

I put together a toolchain (based on gcc 4.3.2) that will compile sketches on the OpenWrt side of the Yun. You can then use the existing tools (merge-sketch-with-bootloader and run-avrdude) to upload them to the Leonardo side.

This is available at YunAvrToolchain, instructions are in the README

I tested this with the Blink, YunSerialTerminal and Bridge examples in the Arduino IDE and these work fine.

Enjoy!

Angelo9999

Good job!  :)

How much time is needed to compile the blink example?
https://github.com/sngl

noblepepper

It takes around 45 seconds to build blink.

Since Sudar's system uses make logic it only builds libraries if they have changed, the next time you build it takes about 3 or 4 seconds.

Here are some test results showing start and finish times for various examples:

Blink -
First Build
Fri Nov 21 06:01:23 CST 2014
Fri Nov 21 06:02:03 CST 2014
Next Build
Fri Nov 21 06:02:04 CST 2014
Fri Nov 21 06:02:07 CST 2014

YunSerialTerminal -
First Build
Fri Nov 21 05:53:32 CST 2014
Fri Nov 21 05:54:13 CST 2014
Next Build
Fri Nov 21 05:54:13 CST 2014
Fri Nov 21 05:54:17 CST 2014

Bridge-
First Build
Fri Nov 21 06:02:56 CST 2014
Fri Nov 21 06:04:03 CST 2014
Next Build
Fri Nov 21 06:04:03 CST 2014
Fri Nov 21 06:04:10 CST 2014


Process-
First Build
Fri Nov 21 06:06:35 CST 2014
Fri Nov 21 06:07:39 CST 2014
Next Build
Fri Nov 21 06:07:39 CST 2014
Fri Nov 21 06:07:45 CST 2014



noblepepper

The test on Process revealed a bug in the Makefile, I will be updating the github repository soon.

The problem occurs when a library includes another library. In this case Process includes Bridge, using this as the Makefile solves it:

Code: [Select]
BOARD_TAG    = yun
ARDUINO_DIR = /usr/local/arduino-1.5.8
AVR_TOOLS_DIR = /usr/local/YunAvrToolchain-master
ARDUINO_LIBS= Bridge
include /usr/local/Arduino-Makefile-master/Arduino.mk

Angelo9999

https://github.com/sngl

noblepepper

The github repository now has the updated Makefile that should compile any sketch that works in the IDE. It also has scripts that automate setting up a new sketch and uploading.

Now you can:
Code: [Select]
newSketch Blink
cp /usr/local/arduino-1.5.8/examples/01.Basics/Blink/Blink.ino /root/sketchbook/Blink/
upload Blink

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy