@@ -9,6 +9,18 @@ This code requires a local copy of JerryScript and Zephyr OS source. We
9
9
will upstream patches to those projects as appropriate, but this repo is for
10
10
everything else.
11
11
12
+ ### Index
13
+ * [ Getting Started] ( #getting-started )
14
+ * [ Contributing] ( #contributing )
15
+ * [ Repo Organization] ( #repo-organization )
16
+ * [ Increase space on A101] ( #getting-more-space-on-your-arduino-101 )
17
+ * [ JS Minifier] ( #js-minifier )
18
+ * [ FRDM-K64F Platform] ( #frdm-k64f-platform )
19
+ * [ Building and running on Linux/Mac OSX] ( #building-and-running-on-linux-and-mac-osx )
20
+ * [ Supported modules on Linux and Zephyr] ( #supported-modules-on-linux-and-zephyr )
21
+ * [ Networking with QEMU] ( #networking-with-qemu )
22
+ * [ OCF over BLE] ( #ocf-over-ble )
23
+
12
24
## Getting Started
13
25
14
26
This section will walk you through building and running your first ZJS
@@ -224,7 +236,9 @@ least two plus-ones (+1) , "Look Good To Me (LGTM)" or other positive signals
224
236
for the project members. Once you have gained the required signals the project
225
237
maintainers will merge the PR.
226
238
227
- ## File Descriptions
239
+ ## Repo Organization
240
+
241
+ ### File Descriptions
228
242
* ` zjs-env.sh ` - Source this file to set environment variables and path to be
229
243
able to use tools from ``` scripts/ ``` anywhere.
230
244
* ` prj.conf ` - The main configuration file for a Zephyr application; overrides
@@ -233,7 +247,7 @@ assemble the prj.conf file at build time from other fragments.
233
247
* ` prj.mdef ` - Another configuration file for a Zephyr application; we use it to
234
248
configure the heap size available to the ZJS API.
235
249
236
- ## Subdirectories
250
+ ### Subdirectories
237
251
- ` arc/ ` - Contains sensor subsystem code for ARC side of the Arduino 101.
238
252
- ` deps/ ` - Contains dependency repos and scripts for working with them.
239
253
- ` docs/ ` - Documentation in Markdown format (use API.md as index).
@@ -271,46 +285,6 @@ few modules you require in the ARC build.
271
285
The RAM and ROM sizes being used are now displayed at the top of the make
272
286
output when you do build for Arduino 101.
273
287
274
- ## Building system images
275
- The ZJS project uses a top-level Makefile to control the building of code from
276
- he project itself as well as the JerryScript and Zephyr projects it depends on.
277
-
278
- To see the available make commands, type:
279
-
280
- ``` bash
281
- $ make help
282
- ```
283
-
284
- On Arduino 101, there are two embedded microcontrollers, an X86 and an ARC one.
285
- If you only need the x86 side, you can disable ARC with CONFIG_ARC_INIT=n in
286
- the Zephyr prj.conf. Otherwise, you need a working image running on it.
287
-
288
- ## Build the * Hello World* sample
289
- ``` bash
290
- $ make JS=samples/HelloWorld.js
291
- ```
292
-
293
- This will build both an X86 and an ARC image, resulting in
294
- ` outdir/arduino_101/zephyr.bin ` and ` arc/outdir/arduino_101_sss/zephyr.bin `
295
- as the final output. Then adjusted versions are created with a ` .dfu ` suffix.
296
- To flash them to your device with dfu-util, first press the Master Reset button
297
- on your Arduino 101, and about three seconds later type:
298
-
299
- ``` bash
300
- $ make dfu
301
- ```
302
-
303
- There is a window of about five seconds where the DFU server is available,
304
- starting a second or two after the device resets.
305
-
306
- Now both images on your device have been updated. Press the Master Reset button
307
- one more time to boot your new images.
308
-
309
- ## Build other samples
310
- The other samples may require some hardware to be set up and connected; read
311
- the top of each JS file, but then simply pass in the path to the JS file to make
312
- as with ` HelloWorld.js ` above.
313
-
314
288
## JS Minifier
315
289
316
290
To save space it is recommended to use a minifier. In ` convert.sh ` , the script
@@ -378,9 +352,9 @@ Using the same procedure as above, once you hit Reset you should see
378
352
379
353
Zephyr is a trademark of the Linux Foundation. * Other names and brands may be claimed as the property of others.
380
354
381
- ## Building and running on Linux/ Mac OSX
355
+ ## Building and running on Linux and Mac OSX
382
356
In addition to Zephyr there is a "linux" target which does not use Zephyr at all
383
- and instead uses the host OS. This can be build on Linux or Mac OSX using the
357
+ and instead uses the host OS. This can be built on Linux or Mac OSX using the
384
358
command:
385
359
386
360
``` bash
@@ -425,7 +399,7 @@ on it, specifically the hardware modules (AIO, I2C, GPIO etc.). There are some
425
399
modules which can be used though like Events, Promises, Performance and OCF. This
426
400
list may grow if other modules are ported to the Linux target.
427
401
428
- ## Supported modules ( Linux vs Zephyr)
402
+ ## Supported modules on Linux and Zephyr
429
403
There is only partial support for modules on Linux compared to Zephyr. Any hardware
430
404
specific module (I2C, UART, GPIO, ADC etc.) is not supported on Linux. Trying
431
405
to run a Zephyr specific module on Linux will result in the JavaScript not running
@@ -447,6 +421,34 @@ successfully. Below is a complete table of modules and target support.
447
421
| Performance| <ul ><li >- [ x] </li ></ul > | <ul ><li >- [ x] </li ></ul > |
448
422
| Timers | <ul ><li >- [ x] </li ></ul > | <ul ><li >- [ x] </li ></ul > |
449
423
424
+ ## Networking with QEMU
425
+ QEMU has support for networking features that can be tested on your Linux
426
+ desktop. To do this you will need a separate "net-tools" repo:
427
+ ``` bash
428
+ git clone git clone https://gerrit.zephyrproject.org/r/net-tools
429
+ ```
430
+ Open up 2 terminals to run the tools:
431
+ Terminal 1:
432
+ ``` bash
433
+ sudo ./net-tools/loop-socat.sh
434
+ ```
435
+ Terminal 2:
436
+ ``` bash
437
+ ./net-tools/loop-slip-tap.sh
438
+ ```
439
+ Then run QEMU as your normally would e.g.
440
+ ``` bash
441
+ make BOARD=qemu_x86 JS=samples/OcfServer.js qemu
442
+ ```
443
+
444
+ Note: At this point, this setup is relatively unstable. You may experience
445
+ crashes or things just not working in general. If the behavior does not seem
446
+ normal you can usually fix it by restarting the two scripts and running QEMU
447
+ again.
448
+
449
+ The original instructions document can be found on the Zephyr website
450
+ (here)[ https://www.zephyrproject.org/doc/subsystems/networking/qemu_setup.html ]
451
+
450
452
## OCF over BLE
451
453
There is a dedicated [ document] ( ./docs/ocf-ble.md ) for building and running OCF over
452
454
BLE on the Arduino 101.
0 commit comments