7639e613a4
Rationale: - There is no port under targets/ that would use it. All of them turn it off when building. - That's no surprise, as jerry-libc supports no barebone MCUs but posix targets with syscalls only. Actually, that's Linux only, because macOS builds have turned off the use of jerry-libc a while ago. - And there is no point in maintaining a highly restricted set of libc functions: as soon as someone wants to use JerryScript in a scenario that needs more functions than jerry-main, they have to choose a different libc (most problably the compiler's default one). I think that we should not keep supporting an otherwise unused library for the purposes of jerry-main on arm/x86/x64-linux only. JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
154 lines
3.6 KiB
Markdown
154 lines
3.6 KiB
Markdown
### About
|
|
|
|
This folder contains files to build and run JerryScript on [TizenRT](https://github.com/Samsung/TizenRT) with Artik053 board.
|
|
|
|
### How to build
|
|
|
|
#### TL; DR
|
|
|
|
If you are in a hurry, run following commands:
|
|
|
|
```
|
|
$ sudo apt-add-repository -y "ppa:team-gcc-arm-embedded/ppa"
|
|
$ sudo apt-get update
|
|
$ sudo apt-get install gcc-arm-embedded
|
|
$ git clone https://github.com/jerryscript-project/jerryscript.git jerryscript
|
|
$ cd jerryscript
|
|
$ make -f ./targets/tizenrt-artik053/Makefile.travis install script
|
|
```
|
|
Next, go to [step 7](#7-generate-romfs)
|
|
|
|
|
|
#### Build steps in detail
|
|
|
|
#### 1. Set up build environment
|
|
|
|
* Install toolchain
|
|
|
|
Get the build in binaries and libraries, [gcc-arm-none-eabi-4_9-2015q3-20150921-linux.tar](https://launchpad.net/gcc-arm-embedded/4.9/4.9-2015-q3-update).
|
|
|
|
|
|
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 -b 1.1_Public_Release
|
|
```
|
|
|
|
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-1.1.patch TizenRT/
|
|
```
|
|
|
|
#### 3. Configure TizenRT
|
|
|
|
```
|
|
$ cd TizenRT/os/tools
|
|
$ ./configure.sh artik053/jerryscript
|
|
```
|
|
|
|
#### 4. Configure TizenRT
|
|
|
|
```
|
|
$ cd ../../
|
|
$ patch -p1 < romfs-1.1.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
|
|
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
|
|
```
|
|
|
|
**Note**: 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
|
|
```
|
|
|
|
#### 6. Build TizenRT binary
|
|
|
|
```
|
|
# assuming you are in jerry-tizenrt folder
|
|
$ cd TizenRT/os
|
|
$ make
|
|
```
|
|
Binaries are available in TizenRT/build/output/bin
|
|
|
|
#### 7. Generate romfs
|
|
|
|
```
|
|
$ genromfs -f ../build/output/bin/rom.img -d ../build/output/res/ -V "NuttXBootVol"
|
|
```
|
|
|
|
#### 8. Flash binary
|
|
|
|
```
|
|
make download ALL
|
|
```
|
|
|
|
Reboot the device.
|
|
|
|
For more information, see [How to program a binary](https://github.com/Samsung/TizenRT/blob/master/build/configs/artik053/README.md).
|
|
|
|
|
|
#### 9. 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
|
|
```
|