Whether you are a maker enthusiast who is just getting started or a seasoned developer wanting to jump into embedded device development, this session is for you. Oliver Chen covers the Intel Curie ODK (CODK) and how it can help you rapidly prototype products by leveraging tools familiar to you. The Intel CODK includes software, tools, and documentation for developers to build their own custom boards based on the Intel Curie Module. The CODK helps developers build boards starting with the Arduino101 (Genuino101 outside the United States), the Arduino IDE, or CODK A-Tree. Then, transition to using the open source schematics and board files, and the Zephyr-based M tree which uses Zephyr APIs and Arduino-style APIs, before moving to the Z-Tree for full optimization.
3. 4/10/17
1
Makers and
Innovators
Curie Open Developer
Kit
IOT Dev+Test
CODK
• Introduction
• First Time M-Tree Setup
• Proof of Life - ASCIITable
• Convert-sketch – Blink
2
• Create Your Own Project
• Pattern Matching Library
• Factory Reset
• Case Study
4. 4/10/17
2
3
Software … Tools … Documentation for developers to build boards based on the
Intel Curie module and turn them into products.
Three firmware source trees available :
• A Tree – Arduino101 firmware, Arduino core libraries and tools
• Z Tree – Zephyr firmware that targets Arduino101 as host Core
• M Tree – Mix of A and Z trees. Firmware based on Zephyr on the Quark, and
user code with Arduino class libraries on the ARC
The M Tree brings:
• Arduino class libraries
• Dual core option of running code on Quark
• Debugging using GDB
Curie Open Developer Kit (CODK) Introduction
4
Basic
functionality
and speed
Arduino
IDE
Heavy
compute
CODK
Complex
debug
EnvironmentArduino
IDE
ISSM
x86 Quark
CODK
EnvironmentISSM
ISSM
Yes
No Yes
No
CMD Line GUI CMD Line GUI
Z-tree M-tree
Insufficient
Sufficient
Curie software decision tree
• Arduino IDE and ISSM- primary options for contestants
• Arduino IDE for basics
• ISSM for anything needing multiple cores or debugging
• CODK- still available for
• Those who want to do their own IDE integration
• Prefer command line
• Just want extra debugging
5. 4/10/17
3
5
Basic
functionality
and speed
Arduino
IDE
Heavy
compute
CODK
Complex
debug
EnvironmentArduino
IDE
ISSM
x86 Quark
CODK
EnvironmentISSM
ISSM
Sufficient
Yes
No Yes
Insufficient
No
CMD Line GUI CMD Line GUI
Z-tree M-tree
MotivateMe
PowerBobber
Grush
ASEAH
NWTN
HandsOn
Project Breakdown
• Arduino IDE- MotivateMe and PowerBobber only
needed basics
• CODK M – HandsOn could have debugged their
wireless gloves
• Z-tree- Grush wanted an embedded o/s
• M-tree- ASEAH and NWTN would have used multiple
cores and x86 functionality
6
Connect Arduino101/tinyTILE
Arduino101 uses standard USB 2.0 A to B plug
tinyTILE uses micro USB
Compile Firmware/Software
Setup your environment for development by running in a new terminal:
export CODK_DIR=~/CODK/CODK-M
source ~/CODK/zephyr/zephyr-env.sh
This needs to be run in any new terminal before you compile.
Change directories to the top level directory for CODK-M in the terminal
session:
cd ~/CODK/CODK-M
The default top-level makefile builds the ASCIITable example.
Compile x86 in terminal session: make compile-x86
Compile ARC in terminal session: make compile-arc
First Time M Tree Setup
$ export CODK_DIR=$(pwd) $ source ../zephyr/zephyr-env.sh
export CODK_DIR=~/CODK/CODK-M
source ~/CODK/zephyr/zephyr-env.sh
cd ~/CODK/CODK-M
make compile-x86
make compile-arc
6. 4/10/17
4
7
Update BLE firmware
Each Arduino101 with factory settings will need to update BLE
firmware for M-Tree by running in terminal session: make upload-ble-
dfu
Some error messages are benign. Loading bar should reach
100%.
You only do this again on the same board if it has been reset to factory
settings
Flash using USB/DFU
Flash x86 binary image in terminal session : make upload-x86-dfu
Some error messages are benign. Loading bar should reach
100%.
Flash ARC binary image in terminal session: make upload-arc-dfu
Some error messages are benign. Loading bar should reach
100%.
First Time M Tree Setup
$ export CODK_DIR=$(pwd) $ source ../zephyr/zephyr-env.sh
make upload-ble-dfu
make upload-x86-dfu
make upload-arc-dfu
8
This example will output an ASCIITable for
proof of life on the Arduino101 or the tinyTILE.
Connect the board to the computer if
necessary
Verify serial port ttyACM0 is found
In the terminal session: dmesg | grep tty
You should see for example ttyACM0 referenced
Use serial port terminal program CuteCom
In the terminal session: cutecom &
If not installed: sudo apt-get install cutecom
In CuteCom, change the name to your serial device
for example /dev/ttyACM0
Proof of Life - ASCIITable
$ export CODK_DIR=$(pwd) $ source ../zephyr/zephyr-env.sh
dmesg| grep tty
cutecom &
7. 4/10/17
5
9
Run commands to compile the ASCIITable example
in a terminal window
Not necessary if continuing from M-Tree setup
export CODK_DIR=~/CODK/CODK-M
source ~/CODK/zephyr/zephyr-env.sh
cd ~/CODK/CODK-M
make compile-x86
make compile-arc
Run commands to execute the ASCIITable
example in terminal window you used to compile.
cd $CODK_DIR/arc/examples/ASCIITable
make upload SERIAL_PORT=/dev/ttyACM0
May have benign error
Proof of Life - ASCIITable
$ export CODK_DIR=$(pwd) $ source ../zephyr/zephyr-env.sh
cd $CODK_DIR/arc/examples/ASCIITable
make upload SERIAL_PORT=/dev/ttyACM0
10
Wait for 10 seconds after the upload
and select Open Device in the
CuteCom terminal
You should see this
Select Close Device and quit
Proof of Life - ASCIITable
$ export CODK_DIR=$(pwd) $ source ../zephyr/zephyr-env.sh
8. 4/10/17
6
11
This example will flash an on board LED for proof of life on
the Arduino101. This will only work on the Arduino101
because the tinyTILE does not have the LED built in.
Connect the board to the computer if necessary
Verify serial port ttyACM0 is found
In a new terminal session: dmesg | grep tty
You should see for example ttyACM0 referenced
Run commands to compile the Blink example in a
terminal window
Not necessary if continuing from M-Tree setup or
ASCIItable
export CODK_DIR=~/CODK/CODK-M
source ~/CODK/zephyr/zephyr-env.sh
Convert-Sketch - Blink
$ export CODK_DIR=$(pwd) $ source ../zephyr/zephyr-env.sh
dmesg| grep tty
cutecom &
12
Run commands to execute the Blink example in terminal
window you used to compile: cd $CODK_DIR/arc/examples/Blink
The make convert-sketch command will create the cpp file:
make convert-sketch SKETCH=Blink.ino
Blink Makefile can be used for other examples. Edit content
and add libraries with LIBDIRS. Simple will have it empty:
LIBDIRS = $(ARDUINOIDE_DIR)/libraries/WiFi/src
$(ARDUINOSW_DIR)/corelibs/libraries/SPI/src
The make compile will generate the executable to be
uploaded: make compile
make upload SERIAL_PORT=/dev/ttyACM0
The LED on pin 13 should turn off and on every second
Convert-Sketch – Blink
$ export CODK_DIR=$(pwd) $ source ../zephyr/zephyr-env.sh
cd $CODK_DIR/arc/examples/Blink
make convert-sketch SKETCH=Blink.ino
make upload-arc-dfu
make compile
make upload SERIAL_PORT=/dev/ttyACM0
9. 4/10/17
7
13
Run commands to execute the Blink example in new
terminal window: cd $CODK_DIR
The make project command will create the necessary files
for your project: make project PROJ_DIR=my_project
Source the generated env.sh:
source my_project/env.sh
This sets CODK_DIR, ARC_PROJ_DIR, X86_PROJ_DIR and
sources the zephyr environment at $CODK_DIR/../zephyr/
zephyr-env.sh, so you don't need to do these things now
when working in my_project; just source env.sh.
Your are now ready to code and compile in my_project/arc
and my_project/x86
Create Your Own Project
$ export CODK_DIR=$(pwd) $ source ../zephyr/zephyr-env.sh
cd $CODK_DIR
make project PROJ_DIR=my_project
source my_project/env.sh
14
You can use the content of the Intel pattern matching engine repository in the A tree and
in the M tree, and create pattern matching application examples.
Clone the GitHub repository:
git clone https://github.com/01org/Intel-Pattern-Matching-Technology
Store the content of the repository under CODK-A/arc/libraries or CODK-M/arc/libraries.
Copy the makefile from another example sketch (for example Blink) and paste in the
pattern matching example folder.
Edit the makefile to indicate the path to Intel pattern matching library. For example
sketch a_SimplePatternMatching:
LIBDIRS = $(ARDUINOSW_DIR)/libraries/Intel-Pattern-Matching-Technology/src
Pattern Matching Library
$ export CODK_DIR=$(pwd) $ source ../zephyr/zephyr-env.sh
10. 4/10/17
8
15
From within the CODK-A directory or the CODK-M directory, run the following command
to convert a pattern matching example sketch and build the application:
cd $CODK_DIR/arc/libraries/Intel-Pattern-Matching-Technology/examples/
a_SimplePatternMatching
make convert-sketch SKETCH=a_SimplePatternMatching.ino
make compile
make upload SERIAL_PORT=/dev/ttyACM0
Pattern Matching Library
$ export CODK_DIR=$(pwd) $ source ../zephyr/zephyr-env.sh
16
To factory reset the Arduino101/tinyTILE,
connect the board and execute the
following commands in a terminal window:
cd ~/arduino101-factory_recovery-flashpack
./flash_dfu.sh
There may be benign errors.
Factory Reset
$ export CODK_DIR=$(pwd) $ source ../zephyr/zephyr-env.sh
cd ~/arduino101-factory_recovery-flashpack
./flash_dfu.sh