Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #1018 from bovi/arduino-due

Compile Support for Arduino Due
  • Loading branch information...
commit 526f4bf6400acdc69b214076946c65b09828f643 2 parents 8ae0c58 + 4e1c54e
@matz matz authored
Showing with 32 additions and 0 deletions.
  1. +32 −0 examples/targets/ArduinoDue.rb
View
32 examples/targets/ArduinoDue.rb
@@ -0,0 +1,32 @@
+# Cross Compiling configuration for Arduino Duea
+# http://arduino.cc/en/Main/ArduinoBoardDue
+#
+# Requires Arduino IDE >= 1.5
+MRuby::CrossBuild.new("Arduino Due") do |conf|
+ toolchain :gcc
+
+ # GNU Linux
+ ARDUINO_PATH = '/opt/arduino'
+ BIN_PATH = "#{ARDUINO_PATH}/hardware/tools/g++_arm_none_eabi/bin"
+ SAM_PATH = "#{ARDUINO_PATH}/hardware/arduino/sam"
+ TARGET_PATH = "#{SAM_PATH}/variants/arduino_due_x"
+
+ conf.cc do |cc|
+ cc.command = "#{BIN_PATH}/arm-none-eabi-gcc"
+ cc.include_paths = ["#{SAM_PATH}/system/libsam -I#{SAM_PATH}/system/CMSIS/CMSIS/Include/",
+ "#{SAM_PATH}/system/CMSIS/Device/ATMEL/",
+ "#{SAM_PATH}/cores/arduino -I#{TARGET_PATH}",
+ "#{MRUBY_ROOT}/include"]
+ cc.flags << '-g -Os -w -ffunction-sections -fdata-sections -nostdlib --param max-inline-insns-single=500 ' +
+ '-Dprintf=iprintf -mcpu=cortex-m3 -DF_CPU=84000000L -DARDUINO=152 -D__SAM3X8E__ -mthumb -DUSB_PID=0x003e -DUSB_VID=0x2341 -DUSBCON'
+ cc.compile_options = "%{flags} -o %{outfile} -c %{infile}"
+ end
+
+ conf.archiver do |archiver|
+ archiver.command = "#{BIN_PATH}/arm-none-eabi-ar"
+ archiver.archive_options = 'rcs %{outfile} %{objs}'
+ end
+
+ # No binaries necessary
+ conf.bins = []
+end
Please sign in to comment.
Something went wrong with that request. Please try again.