diff --git a/Documentation/platforms/arm/stm32h7/boards/linum-stm32h753bi/index.rst b/Documentation/platforms/arm/stm32h7/boards/linum-stm32h753bi/index.rst index 3e2c85d0d9c..65d38f22a9a 100644 --- a/Documentation/platforms/arm/stm32h7/boards/linum-stm32h753bi/index.rst +++ b/Documentation/platforms/arm/stm32h7/boards/linum-stm32h753bi/index.rst @@ -1087,6 +1087,37 @@ that the USB host and the SDMMC peripheral coexist:: nsh> mount -t vfat /dev/mmcsd0 /data nsh> ls /data +**Typing from the serial console instead.** The terminal reads a keyboard +device, and it does not care which one, so it can be driven from the serial +console with no keyboard plugged in at all. This configuration enables +``UINPUT_KEYBOARD``, which registers a virtual keyboard on +``/dev/ukeyboard``, and ``system/kbd``, which injects into it. + +Point the terminal at the virtual keyboard and bridge the console into it:: + + nsh> lvglterm /dev/ukeyboard & + nsh> kbd -i /dev/ukeyboard + +Everything typed on the serial console from that point on appears on the +display. This is how to work on the terminal without the keyboard at hand, +and how to reach the board over a serial link from another machine. + +To use both at once, forward the USB keyboard into the same virtual +keyboard before starting the terminal:: + + nsh> kbd -i /dev/ukeyboard /dev/kbda & + nsh> lvglterm /dev/ukeyboard & + nsh> kbd -i /dev/ukeyboard + +The USB keyboard and the serial console now feed the same terminal, which +an application cannot do on its own since it opens a single device. + +``UINPUT_KEYBOARD_BUFNUMBER`` is raised to 128 here. It counts events +rather than keys, so the default of eight holds four keystrokes, and a +console hands over a whole line at once. The keyboard upper half overwrites +the oldest event when the buffer is full, so a line typed at the console +would arrive with its beginning silently missing. + tone ---- diff --git a/boards/arm/stm32h7/linum-stm32h753bi/configs/lvglterm_kbda/defconfig b/boards/arm/stm32h7/linum-stm32h753bi/configs/lvglterm_kbda/defconfig index 490dc686d07..60c8ff2e28e 100644 --- a/boards/arm/stm32h7/linum-stm32h753bi/configs/lvglterm_kbda/defconfig +++ b/boards/arm/stm32h7/linum-stm32h753bi/configs/lvglterm_kbda/defconfig @@ -30,7 +30,8 @@ CONFIG_DEBUG_FEATURES=y CONFIG_DEBUG_SYMBOLS=y CONFIG_DRIVERS_VIDEO=y CONFIG_EXAMPLES_LVGLTERM=y -CONFIG_EXAMPLES_LVGLTERM_INPUT_KBD_USB=y +CONFIG_EXAMPLES_LVGLTERM_INPUT_KBD=y +CONFIG_EXAMPLES_LVGLTERM_KBD_DEV="/dev/kbda" CONFIG_FAT_DMAMEMORY=y CONFIG_FAT_LCNAMES=y CONFIG_FAT_LFN=y @@ -40,6 +41,7 @@ CONFIG_FS_PROCFS=y CONFIG_GRAN=y CONFIG_GRAN_INTR=y CONFIG_GRAPHICS_LVGL=y +CONFIG_HIDKBD_NOGETREPORT=y CONFIG_INIT_ENTRYPOINT="nsh_main" CONFIG_INTELHEX_BINARY=y CONFIG_LIBC_EXECFUNCS=y @@ -81,11 +83,15 @@ CONFIG_STM32_PWR=y CONFIG_STM32_RTC=y CONFIG_STM32_SDMMC1=y CONFIG_STM32_USART1=y +CONFIG_SYSTEM_KBD=y CONFIG_SYSTEM_NSH=y CONFIG_TASK_NAME_SIZE=0 CONFIG_TESTING_RAMTEST=y +CONFIG_UINPUT_KEYBOARD=y +CONFIG_UINPUT_KEYBOARD_BUFNUMBER=128 CONFIG_USART1_SERIAL_CONSOLE=y CONFIG_USBHOST=y +CONFIG_USBHOST_ASYNCH=y CONFIG_USBHOST_HIDKBD=y CONFIG_USEC_PER_TICK=1000 CONFIG_VIDEO_FB=y