This is an automated email from the ASF dual-hosted git repository. xiaoxiang781216 pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit 7a4f2704929b28db2ae972bbb62690d69bfbd22c Author: Jorge Guzman <[email protected]> AuthorDate: Thu Jul 2 12:32:10 2026 -0300 boards/arm/stm32h7: linum-stm32h753bi: add LVGL terminal configuration Add an "lvglterm" configuration that runs the on-screen NuttShell terminal (apps/examples/lvglterm, touch input variant) on the display: an on-screen LVGL keyboard driven by the FT5X06 touchscreen feeds the shell and the NSH output is rendered in an LVGL text area. Update the apps/examples/lvglterm documentation to describe the two input variants (on-screen touch keyboard and physical keyboard) and their configuration options (input source, keyboard device and font choices). Signed-off-by: Jorge Guzman <[email protected]> --- .../applications/examples/lvglterm/index.rst | 78 +++++++++++++++++--- .../examples/lvglterm/lvglterm-kbd.png | Bin 0 -> 220952 bytes .../examples/lvglterm/lvglterm-touch.png | Bin 0 -> 214588 bytes .../arm/stm32h7/boards/linum-stm32h753bi/index.rst | 14 ++++ .../linum-stm32h753bi/configs/lvglterm/defconfig | 82 +++++++++++++++++++++ 5 files changed, 165 insertions(+), 9 deletions(-) diff --git a/Documentation/applications/examples/lvglterm/index.rst b/Documentation/applications/examples/lvglterm/index.rst index a6547069119..0b236f81c58 100644 --- a/Documentation/applications/examples/lvglterm/index.rst +++ b/Documentation/applications/examples/lvglterm/index.rst @@ -2,12 +2,72 @@ ``lvglterm`` LVGL Terminal for NuttShell (NSH) ============================================== -LVGL application that executes NuttShell (NSH) commands entered with a -Touchscreen Keyboard and displays the NSH output. Prerequisite configuration -settings: - -- ``CONFIG_NSH_CONSOLE=y`` – NSH must be configured to use a console. -- ``CONFIG_LIBC_EXECFUNCS=y`` – posix_spawn() must be enabled. -- ``CONFIG_PIPES=y`` – Pipes must be enabled. -- ``CONFIG_GRAPHICS_LVGL=y`` – LVGL graphics must be enabled. -- ``CONFIG_LV_FONT_UNSCII_16=y`` – LVGL font UNSCII 16 must be enabled. +LVGL application that runs an interactive NuttShell (NSH) on the display. NSH +is started with its standard streams redirected through pipes, its output is +rendered in an LVGL text area, and the input comes from one of two sources +selected at build time. + +The shared code lives in ``lvglterm.c`` (NSH startup, output rendering, main +loop); ``lvglterm_touch.c`` and ``lvglterm_kbd.c`` implement the two input +variants. + +Input variants +============== + +The input source is chosen with the *LVGL Terminal input source* Kconfig +choice (only one is built at a time): + +On-screen keyboard (touch) + ``CONFIG_EXAMPLES_LVGLTERM_INPUT_TOUCH`` (default). An LVGL keyboard + widget operated by touch; a command line is typed and submitted with + Enter. Suits touchscreen boards and keeps the original behaviour. + + .. figure:: lvglterm-touch.png + :align: center + :width: 500px + :alt: LVGL Terminal with the on-screen touch keyboard + + On-screen keyboard (touch) variant + +Physical keyboard + ``CONFIG_EXAMPLES_LVGLTERM_INPUT_KBD``. Key events are read from a + ``/dev/kbdN`` keyboard device and streamed to the shell; the output fills + the whole screen. Requires ``CONFIG_INPUT_KEYBOARD``. + + The device defaults to ``CONFIG_EXAMPLES_LVGLTERM_KBD_DEV`` + (``/dev/kbd0``) and can be overridden at run time by passing the path as + the first argument (``lvglterm /dev/kbd1``) when more than one keyboard is + present. Keyboards that report the Fn navigation cluster as cursor keys + can scroll the output with Up/Down. + + .. figure:: lvglterm-kbd.png + :align: center + :width: 500px + :alt: LVGL Terminal driven by a physical keyboard + + Physical keyboard variant + +Font +==== + +The monospaced terminal font is chosen with the *LVGL Terminal font* choice: +``CONFIG_EXAMPLES_LVGLTERM_FONT_UNSCII_16`` (default), or the smaller +``CONFIG_EXAMPLES_LVGLTERM_FONT_UNSCII_8`` for low-resolution displays where +UNSCII 16 shows too few columns. + +Configuration +============= + +- ``CONFIG_LIBC_EXECFUNCS=y`` -- ``posix_spawn()`` must be enabled. +- ``CONFIG_PIPES=y`` -- Pipes must be enabled. +- ``CONFIG_SYSTEM_NSH=y`` -- the NSH library must be enabled. +- ``CONFIG_GRAPHICS_LVGL=y`` and ``CONFIG_LV_USE_NUTTX=y`` -- LVGL with its + NuttX integration. +- A display (``CONFIG_LV_USE_NUTTX_LCD`` or a framebuffer). The touch variant + also needs a touchscreen input (``CONFIG_LV_USE_NUTTX_TOUCHSCREEN``); the + keyboard variant needs a keyboard driver (``CONFIG_INPUT_KEYBOARD``). +- The selected font (``CONFIG_LV_FONT_UNSCII_8`` or + ``CONFIG_LV_FONT_UNSCII_16``) is enabled automatically by the font choice. + +Reference: `NuttX RTOS for PinePhone: LVGL Terminal for NSH Shell +<https://lupyuen.github.io/articles/terminal>`_. diff --git a/Documentation/applications/examples/lvglterm/lvglterm-kbd.png b/Documentation/applications/examples/lvglterm/lvglterm-kbd.png new file mode 100644 index 00000000000..bb08362e905 Binary files /dev/null and b/Documentation/applications/examples/lvglterm/lvglterm-kbd.png differ diff --git a/Documentation/applications/examples/lvglterm/lvglterm-touch.png b/Documentation/applications/examples/lvglterm/lvglterm-touch.png new file mode 100644 index 00000000000..e67c3cfc190 Binary files /dev/null and b/Documentation/applications/examples/lvglterm/lvglterm-touch.png differ diff --git a/Documentation/platforms/arm/stm32h7/boards/linum-stm32h753bi/index.rst b/Documentation/platforms/arm/stm32h7/boards/linum-stm32h753bi/index.rst index 0adfaf55625..ff07a5230f7 100644 --- a/Documentation/platforms/arm/stm32h7/boards/linum-stm32h753bi/index.rst +++ b/Documentation/platforms/arm/stm32h7/boards/linum-stm32h753bi/index.rst @@ -895,6 +895,20 @@ Once the **fd** command works, run the lvgl examples. :: **WARNING:** For this example, the total SDRAM size was reduced from 8M to 6M and the LTDC base address was moved to address 0xC0600000 to avoid video memory invasion since the SDRAM was mapped to use the nuttx heap. If using the example with 2 layers, the reserved value will need to be doubled. +lvglterm +-------- + +Runs the ``lvglterm`` example: an interactive NuttShell (NSH) terminal on the +display. This board uses the touch input variant -- an on-screen LVGL keyboard, +driven by the FT5X06 touchscreen, feeds the commands while the NSH output is +rendered in an LVGL text area.:: + + nsh> lvglterm + +Type a command on the on-screen keyboard and press Enter; the command line +``nsh> <command>`` and its output appear in the terminal area above the +keyboard. + tone ---- diff --git a/boards/arm/stm32h7/linum-stm32h753bi/configs/lvglterm/defconfig b/boards/arm/stm32h7/linum-stm32h753bi/configs/lvglterm/defconfig new file mode 100644 index 00000000000..ff3ae84419b --- /dev/null +++ b/boards/arm/stm32h7/linum-stm32h753bi/configs/lvglterm/defconfig @@ -0,0 +1,82 @@ +# +# 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_STANDARD_SERIAL is not set +# CONFIG_STM32_FB_CMAP is not set +# CONFIG_STM32_LTDC_L1_CHROMAKEYEN is not set +# CONFIG_STM32_LTDC_L2 is not set +CONFIG_ARCH="arm" +CONFIG_ARCH_BOARD="linum-stm32h753bi" +CONFIG_ARCH_BOARD_LINUM_STM32H753BI=y +CONFIG_ARCH_CHIP="stm32h7" +CONFIG_ARCH_CHIP_STM32=y +CONFIG_ARCH_CHIP_STM32H753BI=y +CONFIG_ARCH_CHIP_STM32H7=y +CONFIG_ARCH_CHIP_STM32H7_CORTEXM7=y +CONFIG_ARCH_STACKDUMP=y +CONFIG_ARMV7M_DCACHE=y +CONFIG_ARMV7M_DCACHE_WRITETHROUGH=y +CONFIG_ARMV7M_DTCM=y +CONFIG_ARMV7M_ICACHE=y +CONFIG_BOARD_LOOPSPERMSEC=43103 +CONFIG_BUILTIN=y +CONFIG_DEBUG_FEATURES=y +CONFIG_DEBUG_SYMBOLS=y +CONFIG_DRIVERS_VIDEO=y +CONFIG_EXAMPLES_LVGLTERM=y +CONFIG_FB_OVERLAY=y +CONFIG_FS_PROCFS=y +CONFIG_FT5X06_SINGLEPOINT=y +CONFIG_GRAPHICS_LVGL=y +CONFIG_INIT_ENTRYPOINT="nsh_main" +CONFIG_INPUT=y +CONFIG_INPUT_FT5X06=y +CONFIG_INTELHEX_BINARY=y +CONFIG_LIBC_EXECFUNCS=y +CONFIG_LIBM=y +CONFIG_LINE_MAX=64 +CONFIG_LV_FONT_MONTSERRAT_24=y +CONFIG_LV_MEM_SIZE_KILOBYTES=128 +CONFIG_LV_USE_DEMO_BENCHMARK=y +CONFIG_LV_USE_DEMO_WIDGETS=y +CONFIG_LV_USE_NUTTX=y +CONFIG_LV_USE_NUTTX_TOUCHSCREEN=y +CONFIG_LV_USE_PERF_MONITOR=y +CONFIG_LV_USE_SYSMON=y +CONFIG_MM_REGIONS=5 +CONFIG_NSH_BUILTIN_APPS=y +CONFIG_NSH_DISABLE_IFUPDOWN=y +CONFIG_NSH_FILEIOSIZE=512 +CONFIG_NSH_READLINE=y +CONFIG_PIPES=y +CONFIG_PREALLOC_TIMERS=4 +CONFIG_RAM_SIZE=245760 +CONFIG_RAM_START=0x20010000 +CONFIG_RAW_BINARY=y +CONFIG_RR_INTERVAL=200 +CONFIG_RTC_ALARM=y +CONFIG_RTC_DATETIME=y +CONFIG_RTC_DRIVER=y +CONFIG_SCHED_HPWORK=y +CONFIG_SCHED_WAITPID=y +CONFIG_START_DAY=6 +CONFIG_START_MONTH=12 +CONFIG_START_YEAR=2011 +CONFIG_STM32_FMC=y +CONFIG_STM32_I2C3=y +CONFIG_STM32_LTDC=y +CONFIG_STM32_LTDC_FB_BASE=0xC0600000 +CONFIG_STM32_LTDC_FB_SIZE=2097152 +CONFIG_STM32_PWR=y +CONFIG_STM32_RTC=y +CONFIG_STM32_USART1=y +CONFIG_SYSTEM_NSH=y +CONFIG_TASK_NAME_SIZE=0 +CONFIG_TESTING_RAMTEST=y +CONFIG_USART1_SERIAL_CONSOLE=y +CONFIG_USEC_PER_TICK=1000 +CONFIG_VIDEO_FB=y
