Skip to content

Commit 3737a28

Browse files
authored
Update NuttX target to releases/10.2 (#4822)
JerryScript-DCO-1.0-Signed-off-by: Roland Takacs roland.takacs@h-lab.eu
1 parent 2899582 commit 3737a28

File tree

6 files changed

+223
-118
lines changed

6 files changed

+223
-118
lines changed

targets/nuttx-stm32f4/Kconfig

+7-17
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,18 @@
33
# see the file kconfig-language.txt in the NuttX tools repository.
44
#
55

6-
config JERRYSCRIPT
7-
bool "Jerryscript"
6+
config INTERPRETERS_JERRYSCRIPT
7+
bool "Jerryscript JavaScript engine"
88
default n
9-
---help---
10-
Enable Jerryscript ECMAScript 5.1 interpreter
119

12-
if JERRYSCRIPT
10+
if INTERPRETERS_JERRYSCRIPT
1311

14-
config JERRYSCRIPT_PROGNAME
15-
string "Program name"
16-
default "jerry"
17-
depends on BUILD_KERNEL
18-
---help---
19-
This is the name of the program that will be
20-
use when the NSH ELF program is installed.
21-
22-
config JERRYSCRIPT_PRIORITY
23-
int "Jerryscript task priority"
12+
config INTERPRETERS_JERRYSCRIPT_PRIORITY
13+
int "Jerryscript priority"
2414
default 100
2515

26-
config JERRYSCRIPT_STACKSIZE
16+
config INTERPRETERS_JERRYSCRIPT_STACKSIZE
2717
int "Jerryscript stack size"
2818
default 16384
2919

30-
endif # JERRYSCRIPT
20+
endif # INTERPRETERS_JERRYSCRIPT

targets/nuttx-stm32f4/Make.defs

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
ifeq ($(CONFIG_JERRYSCRIPT),y)
16-
CONFIGURED_APPS += interpreters/jerryscript
15+
ifeq ($(CONFIG_INTERPRETERS_JERRYSCRIPT),y)
16+
CONFIGURED_APPS += $(APPDIR)/interpreters/jerryscript
1717
endif

targets/nuttx-stm32f4/Makefile

+21-12
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,17 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
-include $(TOPDIR)/Make.defs
15+
include $(APPDIR)/Make.defs
1616

1717
# Jerryscript built-in application information.
18-
CONFIG_JERRYSCRIPT_PRIORITY ?= SCHED_PRIORITY_DEFAULT
19-
CONFIG_JERRYSCRIPT_PROGNAME ?= jerry$(EXEEXT)
20-
CONFIG_JERRYSCRIPT_STACKSIZE ?= 16384
18+
PROGNAME = jerry
19+
PRIORITY = $(CONFIG_INTERPRETERS_JERRYSCRIPT_PRIORITY)
20+
STACKSIZE = $(CONFIG_INTERPRETERS_JERRYSCRIPT_STACKSIZE)
2121

22-
PROGNAME = $(CONFIG_JERRYSCRIPT_PROGNAME)
23-
PRIORITY = $(CONFIG_JERRYSCRIPT_PRIORITY)
24-
STACKSIZE = $(CONFIG_JERRYSCRIPT_STACKSIZE)
25-
26-
# Path to the JerryScript project. If not specified, it is supposed
27-
# that JerryScript is located next to the nuttx-apps folder.
22+
# Path to the JerryScript and NuttX projects. If not specified, it is
23+
# supposed that JerryScript is located next to the nuttx folder.
2824
JERRYSCRIPT_ROOT_DIR ?= ../../../jerryscript
25+
NUTTX_ROOT_DIR ?= $(JERRYSCRIPT_ROOT_DIR)/../nuttx
2926

3027
CFLAGS += -std=c99
3128
CFLAGS += -I$(JERRYSCRIPT_ROOT_DIR)/jerry-core/include
@@ -35,7 +32,6 @@ CFLAGS += -I$(JERRYSCRIPT_ROOT_DIR)/jerry-math/include
3532
# These libs should be copied from the JerryScript project.
3633
LIBS = libjerry-core.a libjerry-ext.a libjerry-math.a
3734

38-
APPNAME = jerry
3935
ASRCS = setjmp.S
4036
CSRCS = jerry_port.c jerry_module.c
4137
MAINSRC = jerry_main.c
@@ -55,8 +51,21 @@ updateobjs:
5551
cleanlibs: updateobjs
5652
rm -f $(OBJS)
5753

54+
.PHONY: libjerry
55+
libjerry:
56+
$(JERRYSCRIPT_ROOT_DIR)/tools/build.py \
57+
--clean \
58+
--lto=OFF \
59+
--jerry-cmdline=OFF \
60+
--jerry-math=ON \
61+
--amalgam=ON \
62+
--mem-heap=70 \
63+
--profile=es.next \
64+
--compile-flag="--sysroot=${NUTTX_ROOT_DIR}" \
65+
--toolchain=$(abspath $(JERRYSCRIPT_ROOT_DIR)/cmake/toolchain_mcu_stm32f4.cmake)
66+
5867
clean:: cleanlibs
5968

60-
.built: $(LIBS) updateobjs
69+
archive: libjerry $(LIBS) updateobjs
6170

6271
include $(APPDIR)/Application.mk

targets/nuttx-stm32f4/Makefile.travis

+5-10
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ install-kconfig:
3939

4040
# Fetch nuttx/{apps,nuttx} repositories.
4141
install-clone-nuttx:
42-
git clone https://github.com/apache/incubator-nuttx-apps.git ../apps -b releases/9.0
43-
git clone https://github.com/apache/incubator-nuttx.git ../nuttx -b releases/9.0
42+
git clone https://github.com/apache/incubator-nuttx-apps.git ../apps -b releases/10.2
43+
git clone https://github.com/apache/incubator-nuttx.git ../nuttx -b releases/10.2
4444

4545
# Perform all the necessary (JerryScript-independent) installation steps.
4646
install-noapt: install-kconfig install-clone-nuttx
@@ -49,22 +49,17 @@ install: install-apt-get-deps install-noapt
4949

5050
## Targets for building NuttX with JerryScript.
5151

52-
# Build JerryScript.
53-
script-build-jerryscript:
54-
tools/build.py --clean --toolchain cmake/toolchain_mcu_stm32f4.cmake --profile=es.next --jerry-cmdline OFF --lto OFF --jerry-math ON --amalgam ON --jerry-port-default OFF --mem-heap 70 --compile-flag='--sysroot=../nuttx'
55-
5652
# Link in the NuttX JerryScript target directory under the NuttX apps tree.
5753
script-add-jerryscript-app:
5854
ln -s ../../jerryscript/targets/nuttx-stm32f4 ../apps/interpreters/jerryscript
5955

6056
# Configure USB shell.
6157
script-configure-usbnsh:
62-
cd ../nuttx/tools && PATH=$(LOCAL_INSTALL)/bin:$$PATH ./configure.sh stm32f4discovery/usbnsh
58+
cd ../nuttx/tools && PATH=$(LOCAL_INSTALL)/bin:$$PATH ./configure.sh stm32f4discovery:usbnsh
6359

6460
# Configure and build the firmware (NuttX with JerryScript).
65-
script: script-build-jerryscript script-add-jerryscript-app script-configure-usbnsh
66-
echo 'CONFIG_HOST_LINUX=y' >> ../nuttx/.config
61+
script: script-add-jerryscript-app script-configure-usbnsh
6762
echo 'CONFIG_ARCH_FPU=y' >> ../nuttx/.config
68-
echo 'CONFIG_JERRYSCRIPT=y'>> ../nuttx/.config
63+
echo 'CONFIG_INTERPRETERS_JERRYSCRIPT=y'>> ../nuttx/.config
6964
PATH=$(LOCAL_INSTALL)/bin:$$PATH $(MAKE) -C ../nuttx olddefconfig
7065
PATH=$(LOCAL_INSTALL)/bin:$$PATH $(MAKE) -C ../nuttx

0 commit comments

Comments
 (0)