aboutsummaryrefslogtreecommitdiff
path: root/README
blob: 59a4ef540363f37e43d3cdd1e8f02796436f2fce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
This is a prototype of "integration repository" for Linaro LITE team
for 2016.12 release. It's idea is to bring known-good versions of
various projects together, to allow reproducible buils for multiple
boards and server as a seed for CI efforts.

Prerequisites
=============

Zephyr SDK 0.8.2 should be installed in ~/opt/zephyr-sdk-0.8.2/ . If
you have it in different place, the easiest solution is to make a
symlink.

After cloning the repository, run:

    git submodule update --init --recursive --rebase

or just

    make update

You'll need to re-run those regularly, to pick up any changes

Before using this repository, you'll need to run following to setup
Zephyr build environment:

    source zephyr-environ.sh

Alternatively, instead of `make`, you can run `./zmake`, which will
setup Zephyr environment in a make subshell, without affecting
environment of your interactive shell.

Projects
========

You can build any of the projects below for a particular board with:

    make <project> BOARD=<board>

Or all projects with:

    make all BOARD=<board>

JerryScript
-----------

Build with e.g.:

    make jerryscript BOARD=frdm_k64f

The result is in the top-level directory, file

    jerryscript-<board>.bin

Note that JerryScript implements raw ECMAScript5 standard and doesn't
support any hardware access. No LED blinking. You can print something
with:

    print("Someting:", 2 + 2)


MicroPython
-----------

Build with e.g.:

    make micropython BOARD=frdm_k64f

The result is in the top-level directory, file

    micropython-<board>.bin

MicroPython port includes support for accessing arbitrary Zephyr-defined
GPIO and timing, i.e. all needed to blink an LED. For example code and
instructions on blinking, follow
https://github.com/micropython/micropython/tree/master/zephyr#quick-example
(the code there needs to be updated for LED GPIO as used by your board!)


Zephyr.js
---------

Zephyr.js currently officially supports only 2 boards: arduino_101 (x86)
and frdm_k64f. It various places, it so far hardcodes support for these
2 boards and bundles its own Zephyr snapshot, so building for other boards
is somewhat complicated. There's ongoing work to alleviate this, and this
repository includes pfalcon's Zephyr.js fork repository with some patches
applied to make building for other ports possible while the upstream
catches up.

Build with:

    ./zmake-z.js micropython BOARD=frdm_k64f

Note that you must use "zmake-z.js" wrapper script due to complicated
build environment setup (because Zephyr.js bundles its own Zephyr copy).

The result is in the top-level directory, file

    zephyr.js-<board>.bin

Default Zephyr.js mode of operation is no interactive mode, a JavaScript
application is bundled into the firmware binary. Steps above use default
"hello world" application, which prints a message to the console.