Skip to content

Instantly share code, notes, and snippets.

@kmp1
Last active August 14, 2016 19:15
Show Gist options
  • Save kmp1/60247d08d4c9c235439872c7bfce2ab4 to your computer and use it in GitHub Desktop.
Save kmp1/60247d08d4c9c235439872c7bfce2ab4 to your computer and use it in GitHub Desktop.
Compiling an Application on Zephyr OS for Arduino 101 on the MAC

Compiling an Application on Zephyr OS for Arduino 101 on the MAC

Once I got the Crosstool NG tool chain built I then thought that I would compile the hello world application for the Arduino 101.

It did not work (x86 or ARC). The resolution which is described in OSX cross-compile targeting Arduino101 was the solution. Here's what I did...

Set the Toolchain Environment Variable

The help does not mention this at all, but I got an error saying that XTOOLS_TOOLCHAIN_PATH was not set, as a guess I set it like this:

export XTOOLS_TOOLCHAIN_PATH=/Volumes/CrossToolNG/x-tools

(I added it to ~/.zephyrrc so that it sticks around)

To Make x86 Compile

Edit $ZEPHYR_BASE/arch/x86/soc/quark_se/Kconfig.soc and remove the line select X86_IAMCU so the resulting file looks like this:

config SOC_QUARK_SE
    bool "Intel Quark SE"
    select CPU_MINUTEIA
    select IOAPIC
    select LOAPIC
    select LOAPIC_TIMER
    select EOI_HANDLER_SUPPORTED
    select BOOTLOADER_UNKNOWN
    select XIP
    select SYS_POWER_LOW_POWER_STATE_SUPPORTED
    select SYS_POWER_DEEP_SLEEP_SUPPORTED
    select HAS_QMSI

(I have no idea of the implications of this, can't be ideal though)

Now you must compile like so:

make BOARD=arduino_101 ARCH=x86

To Make ARC (SSS) Compile

  • Install the Arduino IDE.

  • Install the Intel Curie Board from the board manager in the IDE.

  • Copy the ARC compiler into the CrosstoolNG Volume:

      mkdir /Volumes/CrossToolNG/arc-elf32
      cp -a /Users/kevin/Library/Arduino15/packages/Intel/tools/arc-elf32/ /Volumes/CrossToolNG/arc-elf32/
    

Now you must compile like so:

make CROSS_COMPILE=/Volumes/CrossToolNG/arc-elf32/1.6.4+1.0/bin/arc-elf32- BOARD=arduino_101_sss_factory
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment