xiuos/APP_Framework/lib/JerryScript/jerryscript/targets/mbedos5
wgzAIIT 516b8627f7 add jerryscript source code 2023-11-20 09:05:58 +08:00
..
jerryscript-mbed add jerryscript source code 2023-11-20 09:05:58 +08:00
js add jerryscript source code 2023-11-20 09:05:58 +08:00
source add jerryscript source code 2023-11-20 09:05:58 +08:00
tools add jerryscript source code 2023-11-20 09:05:58 +08:00
.gitignore add jerryscript source code 2023-11-20 09:05:58 +08:00
Makefile add jerryscript source code 2023-11-20 09:05:58 +08:00
Makefile.travis add jerryscript source code 2023-11-20 09:05:58 +08:00
README.md add jerryscript source code 2023-11-20 09:05:58 +08:00
mbed-os.lib add jerryscript source code 2023-11-20 09:05:58 +08:00
mbed_app.json add jerryscript source code 2023-11-20 09:05:58 +08:00
template-mbedignore.txt add jerryscript source code 2023-11-20 09:05:58 +08:00

README.md

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.

nodejs

npm is used to install the dependencies in the local node_modules folder.

gulp

gulp is used to automate tasks, like cloning repositories or generate source files. If you create an own project, for more info see mbed-js-gulp.

(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 example project as follows:

git clone https://github.com/ARMmbed/mbed-js-example
cd mbed-js-example
npm install
gulp --target=YOUR_TARGET_NAME

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