Files
jerryscript/targets/tizenrt-artik053
Péter Gál 01ecc7bb7b Rework usages/naming of configuration macros [part 2] (#2903)
There are quite a few configuration macros in the project.
As discussed in the #2520 issue there are a few awkward constructs.

Main changes:

* The following macros are now 0/1 switches:
** Renamed CONFIG_ECMA_LCACHE_DISABLE to JERRY_LCACHE.
** Renamed CONFIG_ECMA_PROPERTY_HASHMAP_DISABLE to JERRY_PROPERTY_HASHMAP.
** Renamed CONFIG_DISABLE_UNICODE_CASE_CONVERSION to JERRY_UNICODE_CASE_CONVERSION.
** Renamed ENABLE_REGEXP_STRICT_MODE to JERRY_REGEXP_STRICT_MODE.
** Renamed JERRY_DISABLE_JS_PARSER to JERRY_PARSER.
** Renamed JERRY_ENABLE_ERROR_MESSAGES to JERRY_ERROR_MESSAGES.
** Renamed JERRY_ENABLE_EXTERNAL_CONTEXT to JERRY_EXTERNAL_CONTEXT.
** Renamed JERRY_ENABLE_LINE_INFO to JERRY_LINE_INFO.
** Renamed JERRY_ENABLE_LOGGING to JERRY_LOGGING.
** Renamed JERRY_ENABLE_SNAPSHOT_EXEC to JERRY_SNAPSHOT_EXEC.
** Renamed JERRY_ENABLE_SNAPSHOT_SAVE to JERRY_SNAPSHOT_SAVE.
** Renamed JERRY_SYSTEM_ALLOCATOR to JERRY_SYSTEM_ALLOCATOR.
** Renamed JERRY_VM_EXEC_STOP to JERRY_VM_EXEC_STOP.
** Renamed JMEM_GC_BEFORE_EACH_ALLOC to JERRY_MEM_GC_BEFORE_EACH_ALLOC.
** Renamed JMEM_STATS to JERRY_MEM_STATS.
** Renamed PARSER_DUMP_BYTE_CODE to JERRY_PARSER_DUMP_BYTE_CODE.
** Renamed REGEXP_DUMP_BYTE_CODE to JERRY_REGEXP_DUMP_BYTE_CODE.
* Recursion check changes:
** Renamed REGEXP_RECURSION_LIMIT to JERRY_REGEXP_RECURSION_LIMIT.
** Renamed VM_RECURSION_LIMIT to JERRY_VM_RECURSION_LIMIT.
* Attribute macro changes:
** Renamed JERRY_CONST_DATA to JERRY_ATTR_CONST_DATA.
** Renamed JERRY_HEAP_SECTION_ATTR to JERRY_ATTR_GLOBAL_HEAP.
  Now the macro can specify any attribute for the global heap object.
* Other macro changes:
** Renamed CONFIG_MEM_HEAP_AREA_SIZE to JERRY_GLOBAL_HEAP_SIZE.
   Then new macro now specify the global heap size in kilobytes.
* Updated documentations to reflect the new macro names.

For more deatils please see jerry-core/config.h.

JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
2019-06-19 12:28:21 +02:00
..

About

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

How to build

TL; DR

If you are in a hurry, run the following commands:

$ sudo apt-add-repository -y "ppa:team-gcc-arm-embedded/ppa"
$ sudo apt-get update
$ sudo apt-get install gcc-arm-embedded genromfs
$ git clone https://github.com/pando-project/jerryscript.git
$ cd jerryscript
$ make -f targets/tizenrt-artik053/Makefile.travis install
$ make -f targets/tizenrt-artik053/Makefile.travis script

Next, go to step 7

Build steps in detail

1. Set up build environment

  • Install toolchain

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

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

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/

3. Configure TizenRT

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

4. Build JerryScript for TizenRT

# assuming you are in jerry-tizenrt folder
jerryscript/tools/build.py \
    --clean \
    --lto=OFF \
    --jerry-cmdline=OFF \
    --all-in-one=OFF \
    --mem-heap=70 \
    --profile=es2015-subset \
    --compile-flag="--sysroot=${PWD}/TizenRT/os" \
    --toolchain=${PWD}/jerryscript/cmake/toolchain_mcu_artik053.cmake

Alternatively, there is a Makefile in the targets/tizenrt-artik053/ folder that also helps to build JerryScript for TizenRT.

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

5. Add your JavaScript program to TizenRT (optional)

If you have script files for JerryScript, you can add them to TizenRT. These files will be flashed into the target's /rom folder. Note that your content cannot exceed 1200 KB.

# assuming you are in jerry-tizenrt folder
cp jerryscript/tests/hello.js TizenRT/tools/fs/contents/

6. Build TizenRT binary

# assuming you are in jerry-tizenrt folder
$ cd TizenRT/os
$ make

Binaries are available in TizenRT/build/output/bin.

7. Flash binary

make download ALL

Reboot the device.

For more information, see How to program a binary.

8. Run JerryScript

Use a terminal program (e.g., minicom) with baud rate of 115200. (Note: Actual device path may vary, e.g., /dev/ttyUSB1.)

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

Run jerry with javascript file(s):

TASH>>jerry /rom/hello.js
Hello JerryScript!

Running the program without argument executes a built-in demo:

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