mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
Notable changes: - Remove the comments in port impl, that's easily getting to in-consistence - Sync the jerryscript-port.h and 05.PORT-API.md - Fixes the invalid comment in port codes JerryScript-DCO-1.0-Signed-off-by: Yonggang Luo luoyonggang@gmail.com
About
This folder contains files to run JerryScript on FRDM-K64F board with Mbed OS. The document had been validated on Ubuntu 20.04 operating system.
1. Setup the build environment
Clone the necessary projects into a jerry-mbedos directory.
The latest tested working version of Mbed is mbed-os-6.15.0.
mkdir jerry-mbedos && cd jerry-mbedos
git clone https://github.com/jerryscript-project/jerryscript.git
git clone https://github.com/ARMmbed/mbed-os.git -b mbed-os-6.15.0
The following directory structure has been created:
jerry-mbedos
+ jerryscript
| + targets
| + os
| + mbedos
+ mbed-os
2. Install dependencies of the projects
# Assuming you are in jerry-mbedos folder.
jerryscript/tools/apt-get-install-deps.sh
sudo apt install stlink-tools
pip install --user mbed-cli
# Install Python dependencies of Mbed OS.
pip install --user -r mbed-os/requirements.txt
3. Build Mbed OS (with JerryScript)
# Assuming you are in jerry-mbedos folder.
make -C jerryscript/targets/os/mbedos MBED_OS_DIR=${PWD}/mbed-os
The created binary is a mbedos.bin named file located in jerryscript/build/mbed-os folder.
4. Flash
Connect Micro-USB for charging and flashing the device.
# Assuming you are in jerry-mbedos folder.
make -C jerryscript/targets/os/mbedos MBED_OS_DIR=${PWD}/mbed-os flash
5. Connect to the device
The device should be visible as /dev/ttyACM0 on the host.
You can use minicom communication program with 115200 baud rate.
sudo minicom --device=/dev/ttyACM0 --baud=115200
Set Add Carriage Ret option in minicom by CTRL-A -> Z -> U key combinations.
Press RESET on the board to get the output of JerryScript application:
This test run the following script code: [print ('Hello, World!');]
Hello, World!