c9e9f8e818
The default Mbed OS device (STM32F4) had been changed to FRDM-K64F that is supported by both Mbed OS 5 and Mbed OS 6 versions. Makefile had also been modified to have a flash recipe. JerryScript-DCO-1.0-Signed-off-by: Roland Takacs roland.takacs@h-lab.eu
1.9 KiB
1.9 KiB
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!