pebble/third_party/jerryscript/targets/mbedos5
2025-01-27 11:38:16 -08:00
..
jerryscript-mbed Import of the watch repository from Pebble 2025-01-27 11:38:16 -08:00
js Import of the watch repository from Pebble 2025-01-27 11:38:16 -08:00
source Import of the watch repository from Pebble 2025-01-27 11:38:16 -08:00
tools Import of the watch repository from Pebble 2025-01-27 11:38:16 -08:00
.gitignore Import of the watch repository from Pebble 2025-01-27 11:38:16 -08:00
Makefile Import of the watch repository from Pebble 2025-01-27 11:38:16 -08:00
mbed-events.lib Import of the watch repository from Pebble 2025-01-27 11:38:16 -08:00
mbed-os.lib Import of the watch repository from Pebble 2025-01-27 11:38:16 -08:00
mbed_app.json Import of the watch repository from Pebble 2025-01-27 11:38:16 -08:00
README.md Import of the watch repository from Pebble 2025-01-27 11:38:16 -08:00
template-mbedignore.txt Import of the watch repository from Pebble 2025-01-27 11:38:16 -08:00

JerryScript with mbed OS 5

TL;DR? jump straight to quickstart

Introduction

This directory contains the necessary code to build JerryScript for devices capable of running mbed OS 5. It has been tested with the following boards so far:

Features

Peripheral Drivers

Peripheral Drivers are intended as a 1-to-1 mapping to mbed C++ APIs, with a few differences (due to differences between JavaScript and C++ like lack of operator overloading).

Dependencies

mbed CLI

mbed CLI is used as the build tool for mbed OS 5. You can find out how to install it in the official documentation.

arm-none-eabi-gcc

arm-none-eabi-gcc is the only currently tested compiler for jerryscript on mbed, and instructions for building can be found as part of the mbed-cli installation instructions above.

make

make is used to automate the process of fetching dependencies, and making sure that mbed-cli is called with the correct arguments.

(optional) jshint

jshint is used to statically check your JavaScript code, as part of the build process. This ensures that pins you are using in your code are available on your chosen target platform.

Quick Start

Once you have all of your dependencies installed, you can build the project as follows:

git clone https://github.com/Samsung/jerryscript
cd jerryscript/targets/mbedos5
make getlibs
# NRF52 Development Kit:
make BOARD=NRF52_DK
# FRDM K64F
make BOARD=K64F

The produced file (in .build/[BOARD]/GCC_ARM) can then be uploaded to your board, and will run when you press reset.

If you make a modification to main.js, you can simply rerun make, and it will remember your previous choice of board:

make