Files
jerryscript/targets/tizenrt-artik053
Akos Kiss d0143adc82 Replace JERRY_JS_PARSER feature guard with JERRY_DISABLE_JS_PARSER (#2036)
* Replace JERRY_JS_PARSER feature guard with JERRY_DISABLE_JS_PARSER

All feature guards of jerry-core are deciding about the inclusion
or exclusion of a feature based on the state (defined or undefined)
of a macro -- except for the JS parser guard, which requires
`JERRY_JS_PARSER` to be defined with a value of either 0 or 1. This
has some issues:
- The engine cannot be built with a "clean" compiler invocation,
  i.e., without any `-D` command line macro definitions. This is
  painful for targets that must use a different build system from
  the project's own python/cmake-based one.
- Some build systems in targets and even some code in jerry-code
  are already confused about the different semantics of
  `JERRY_JS_PARSER`, and simply define it without a value and make
  decisions based on the macro being simply defined or not.

This patch renames the guard to `JERRY_DISABLE_JS_PARSER` and makes
use of it in jerry-core based on its state, not based on its value.
As obvious from the guard name, the default for the JS parser is
that it is included in the build.

The patch also touches those targets in the repository that
explicitly defined the original macro (correctly or incorrectly).

* Make cppcheck verbose

Cppcheck can be quite slow sometimes, especially on Travis CI,
which has a "10 mins without output means failure" rule. As the
code base of the project grows, we start to undeterministically
fall over that limit. Thus, this PR makes cppcheck verbose to
ensure that it keeps Travis CI continuously fed with output.

JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
2017-10-17 17:11:54 +02:00
..

About

This folder contains files to build and run JerryScript on TizenRT with Artik053 board.

How to build

1. Set up build environment

  • Install toolchain

Get the build in binaries and libraries, gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar.

Untar the gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar and export the path like

$ tar xvf gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar
$ export PATH=<Your Toolchain PATH>:$PATH
  • Get the jerryscript and TizenRT sources
$ mkdir jerry-tizenrt
$ cd jerry-tizenrt
$ git clone https://github.com/jerryscript-project/jerryscript.git
$ git clone https://github.com/Samsung/TizenRT.git

The following directory structure is created after these commands

jerry-tizenrt
  ├── jerryscript
  └── TizenRT

2. Add jerryscript configuration for TizenRT

$ cp -r jerryscript/targets/tizenrt-artik053/apps/jerryscript/ TizenRT/apps/system/
$ cp -r jerryscript/targets/tizenrt-artik053/configs/jerryscript/ TizenRT/build/configs/artik053/
$ cp jerryscript/targets/tizenrt-artik053/romfs.patch TizenRT/

3. Configure TizenRT

$ cd TizenRT/os/tools
$ ./configure.sh artik053/jerryscript

4. Configure TizenRT

$ cd ../../
$ patch -p0 < romfs.patch
$ cd build/output/
$ mkdir res
# You can add files in res folder
# The res folder is later flashing into the target's /rom folder
# CAUTION: You must not exceed 400kb

5. Build JerryScript for TizenRT

# assuming you are in jerry-tizenrt folder
$ cd jerryscript
$ make -f targets/tizenrt-artik053/Makefile.tizenrt

6. Build TizenRT binary

# assuming you are in jerry-tizenrt folder
$ cd TizenRT/os
$ make
$ genromfs -f ../build/output/bin/rom.img -d ../build/output/res/ -V "NuttXBootVol"

Binaries are available in TizenRT/build/output/bin

7. Flash binary

make download ALL

For more information, see How to program a binary.

8. Run JerryScript

You can use minicom for terminal program, or any other you may like, but set baud rate to 115200.

(Note: Device path may differ like /dev/ttyUSB1.)

sudo minicom --device=/dev/ttyUSB0 --baud=115200

Run jerry with javascript file(s)

TASH>>jerry hello.js                                                               
Hello JerryScript!

Without argument it prints:

TASH>>jerry                                                                        
No input files, running a hello world demo:                                        
Hello World from JerryScript