• Home
Name Date Size #Lines LOC

..--

source/12-May-2024-11258

MakefileD12-May-20241.4 KiB4913

Makefile.riotD12-May-20242.1 KiB7138

Makefile.travisD12-May-20241.3 KiB4211

README.mdD12-May-20242.3 KiB9767

README.md

1### About
2
3This folder contains files to run JerryScript on RIOT-OS with STM32F4-Discovery board.
4
5### How to build
6
7#### 1. Preface
8
91, Directory structure
10
11Assume `harmony` as the path to the projects to build.
12The folder tree related would look like this.
13
14```
15harmony
16  + jerryscript
17  |  + targets
18  |      + riot-stm32f4
19  + RIOT
20```
21
222, Target board
23
24Assume [STM32F4-Discovery with BB](http://www.st.com/web/en/catalog/tools/FM116/SC959/SS1532/LN1199/PF255417)
25as the target board.
26
27#### 2. Prepare RIOT-OS
28
29Follow [this](https://www.riot-os.org/#download) page to get the RIOT-OS source.
30
31Follow the [Inroduction](https://github.com/RIOT-OS/RIOT/wiki/Introduction) wiki site and also check that you can flash the stm32f4-board.
32
33
34#### 3. Build JerryScript for RIOT-OS
35
36```
37# assume you are in harmony folder
38cd jerryscript
39make -f ./targets/riot-stm32f4/Makefile.riot
40```
41
42This will generate the following libraries:
43```
44/build/bin/release.riotstm32f4/librelease.jerry-core.a
45/build/bin/release.riotstm32f4/librelease.jerry-libm.lib.a
46```
47
48This will copy one library files to `targets/riot-stm32f4/bin` folder:
49```
50libjerrycore.a
51```
52
53This will create a hex file in the `targets/riot-stm32f4/bin` folder:
54```
55riot_jerry.elf
56```
57
58#### 4. Flashing
59
60```
61make -f ./targets/riot-stm32f4/Makefile.riot flash
62```
63
64For how to flash the image with other alternative way can be found here:
65[Alternative way to flash](https://github.com/RIOT-OS/RIOT/wiki/Board:-STM32F4discovery#alternative-way-to-flash)
66
67#### 5. Cleaning
68
69To clean the build result:
70```
71make -f ./targets/riot-stm32f4/Makefile.riot clean
72```
73
74
75### 5. Running JerryScript Hello World! example
76
77You may have to press `RESET` on the board after the flash.
78
79You can use `minicom` for terminal program, and if the prompt shows like this:
80```
81main(): This is RIOT! (Version: ****)
82                                     You are running RIOT on a(n) stm32f4discovery board.
83                                                                                         This board features a(n) stm32f4 MCU.
84```
85please set `Add Carriage Ret` option by `CTRL-A` > `Z` > `U` at the console, if you're using `minicom`.
86
87
88Help will provide a list of commands:
89```
90> help
91```
92
93The `test` command will run the test example, which contains the following script code:
94```
95print ('Hello, World!');
96```
97