This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new dc9882895f2 sim: Add Berry interpreter configuration.
dc9882895f2 is described below

commit dc9882895f28c763e852e42e88296d2c7b27d21b
Author: Frederick Blais <[email protected]>
AuthorDate: Mon Nov 2 18:38:23 2026 -0500

    sim: Add Berry interpreter configuration.
    
    Add a sim:berry configuration for the optional Berry scripting
    interpreter and document its command and dependencies.
    
    Use the current simulator NXInit startup path rather than nsh_main
    so init.rc runs correctly. Enable BINFS for the built-in shell and
    child status support for NXInit. Remove FSUTILS_PASSWD settings whose
    dependencies are disabled, keeping the defconfig normalized against
    current nuttx-apps.
    
    The resulting source tree is identical to the previously tested
    two-commit PR head; this commit squashes the initial addition and
    the follow-up configuration fix at the maintainer's request.
    
    Testing (Ubuntu 24.04 x86_64, GCC 13.3.0):
    - Two consecutive refresh.sh --silent sim:berry runs passed without
      tracked defconfig changes.
    - Clean make -j1 and make -j8 builds passed.
    - The simulator started cleanly, mounted /bin, /etc, /proc and /tmp,
      and cleanly powered off.
    - Berry 1.1.0 printed 42 for berry -e print(40+2);
      file write/read smoke tests on /tmp passed.
    - git diff --check and source-file checkpatch passed.
    - The separately identified apps untracked Berry archive/source CI
      failure is addressed by companion nuttx-apps branch
      speccy88:fix/berry-ci-gitignore, pending upstream merge.
    
    Related: apache/nuttx-apps#3564
    
    Assisted-by: ChatGPT:GPT-6
    Signed-off-by: Frederick Blais <[email protected]>
---
 .../applications/interpreters/berry/index.rst      | 58 ++++++++++++++++++++++
 boards/sim/sim/sim/configs/berry/defconfig         | 49 ++++++++++++++++++
 2 files changed, 107 insertions(+)

diff --git a/Documentation/applications/interpreters/berry/index.rst 
b/Documentation/applications/interpreters/berry/index.rst
new file mode 100644
index 00000000000..c7aeef0201d
--- /dev/null
+++ b/Documentation/applications/interpreters/berry/index.rst
@@ -0,0 +1,58 @@
+==================================
+``berry`` Berry scripting language
+==================================
+
+Berry is a small embedded scripting language implemented in ANSI C99.  The
+``berry`` command provides a compiler, register-based virtual machine, garbage
+collector, file I/O, bytecode loading and saving, and built-in modules for
+small on-device scripts.
+
+Configuration
+=============
+
+Enable Berry with ``CONFIG_INTERPRETERS_BERRY``.  The interpreter is built as 
an
+NSH built-in command with the following options:
+
+``CONFIG_INTERPRETERS_BERRY_PROGNAME``
+  Command name used to start Berry.  The default is ``berry``.
+
+``CONFIG_INTERPRETERS_BERRY_PRIORITY``
+  Task priority for the interpreter.  The default is ``100``.
+
+``CONFIG_INTERPRETERS_BERRY_STACKSIZE``
+  Stack size for the interpreter task.  The default is ``12288`` bytes.
+
+Berry depends on ``CONFIG_ARCH_SETJMP_H``, ``CONFIG_LIBC_FLOATINGPOINT``, and
+``CONFIG_SYSTEM_SYSTEM``.  The default NuttX Berry configuration enables the
+file, JSON, math, time, OS, GC, debug, strict, introspection, and bytecode
+modules.  Shared-library module loading is disabled, so Berry does not require
+``CONFIG_LIBC_DLFCN``.
+
+The math module requires a math library.  Use the NuttX ``LIBM`` config or a
+toolchain-provided math library.
+
+Usage
+=====
+
+Run a script from any mounted filesystem:
+
+.. code-block:: console
+
+   nsh> berry hello.be
+   nsh> berry /scripts/blink.be
+
+Run inline source:
+
+.. code-block:: console
+
+   nsh> berry -e print(40+2)
+   42
+
+Start the interactive prompt:
+
+.. code-block:: console
+
+   nsh> berry
+   Berry 1.1.0 (build in Jun 26 2026, 09:07:01)
+   [GCC 13.2.0] on NuttX (default)
+   >
diff --git a/boards/sim/sim/sim/configs/berry/defconfig 
b/boards/sim/sim/sim/configs/berry/defconfig
new file mode 100644
index 00000000000..b30927c1f95
--- /dev/null
+++ b/boards/sim/sim/sim/configs/berry/defconfig
@@ -0,0 +1,49 @@
+#
+# This file is autogenerated: PLEASE DO NOT EDIT IT.
+#
+# You can use "make menuconfig" to make any modifications to the installed 
.config file.
+# You can then do "make savedefconfig" to generate a new defconfig file that 
includes your
+# modifications.
+#
+# CONFIG_NSH_CMDOPT_HEXDUMP is not set
+CONFIG_ARCH="sim"
+CONFIG_ARCH_BOARD="sim"
+CONFIG_ARCH_BOARD_SIM=y
+CONFIG_ARCH_CHIP="sim"
+CONFIG_ARCH_SIM=y
+CONFIG_BOARDCTL_POWEROFF=y
+CONFIG_BOARD_LOOPSPERMSEC=0
+CONFIG_BOOT_RUNFROMEXTSRAM=y
+CONFIG_BUILTIN=y
+CONFIG_DEBUG_SYMBOLS=y
+CONFIG_DEV_LOOP=y
+CONFIG_ETC_FATDEVNO=2
+CONFIG_ETC_ROMFS=y
+CONFIG_ETC_ROMFSDEVNO=1
+CONFIG_EXAMPLES_HELLO=y
+CONFIG_FAT_LCNAMES=y
+CONFIG_FAT_LFN=y
+CONFIG_FS_BINFS=y
+CONFIG_FS_FAT=y
+CONFIG_FS_PROCFS=y
+CONFIG_FS_ROMFS=y
+CONFIG_IDLETHREAD_STACKSIZE=4096
+CONFIG_INIT_ENTRYPOINT="init_main"
+CONFIG_INTERPRETERS_BERRY=y
+CONFIG_LIBC_ENVPATH=y
+CONFIG_LIBC_EXECFUNCS=y
+CONFIG_LIBC_FLOATINGPOINT=y
+CONFIG_LIBC_MAX_EXITFUNS=1
+CONFIG_LIBM=y
+CONFIG_NSH_BUILTIN_APPS=y
+CONFIG_NSH_FILE_APPS=y
+CONFIG_NSH_READLINE=y
+CONFIG_PATH_INITIAL="/bin"
+CONFIG_READLINE_TABCOMPLETION=y
+CONFIG_SCHED_CHILD_STATUS=y
+CONFIG_SCHED_HAVE_PARENT=y
+CONFIG_START_MONTH=6
+CONFIG_START_YEAR=2008
+CONFIG_SYSTEM_NSH=y
+CONFIG_SYSTEM_NXINIT=y
+CONFIG_SYSTEM_SYSTEM=y

Reply via email to