JorgeGzm opened a new pull request, #19579:
URL: https://github.com/apache/nuttx/pull/19579

   ## Summary
   
   Adds a configuration that runs NXDoom on the board's LCD, played with a USB 
HID
   keyboard and reading the game data from the microSD card, so it exercises the
   LTDC frame buffer, the OTG FS host and the SDMMC peripheral at once.
   
   Three settings are needed that are not obvious, and each one is documented in
   the board page with the symptom it cures, because each cost a while to find:
   
   * `CONFIG_FAT_FORCE_INDIRECT` : the FAT layer otherwise reads whole sectors
     straight into the caller's buffer, and the SDMMC IDMA cannot reach that
     buffer when it lives in external SDRAM. The failure appears part way 
through
     startup, once internal RAM has filled and allocations start coming from
     SDRAM, and looks like a truncated file:
     `w_read_lump: only read 0 of 5192 on lump 1070`.
   
   * `CONFIG_HIDKBD_NOGETREPORT` (with `CONFIG_USBHOST_ASYNCH`) : the keyboard
     accepts GET_REPORT on the control pipe but always answers with an empty
     report, and only delivers key data on its interrupt endpoint. The symptom 
is
     a keyboard that enumerates as `/dev/kbda`, reports no error at all, and 
never
     produces a key.
   
   * `CONFIG_STM32_LTDC_L1_L8` with the frame buffer colour map, DOOM is 
natively
     palettised, so letting the display convert the palette while it scans out
     removes the conversion from the blit and halves the amount of data written
     per frame.
   
   The zmodem commands are enabled as well, so the IWAD can be copied over the
   serial console when no card reader is at hand. Note that the board's existing
   `zmodem` configuration uses CDCACM, which cannot be used here because the OTG
   FS port is in host mode for the keyboard; the transfer goes over USART1
   instead.
   
   Also included:
   
   * `arch/arm/src/stm32h7: fix LTDC format specifier for the CLUT index`,
     `chromakey` is a `uint32_t` and was printed with `%d`. The line is only
     compiled when `CONFIG_STM32_FB_CMAP` is enabled, which is why it had gone
     unnoticed; this configuration is the first to enable it.
   * `Documentation/applications/games/nxdoom: document the display options`, 
the
     options added by PR B were only described in their Kconfig help, where
     someone bringing the game up on a new board is unlikely to find them.
   
   ## Impact
   
   * **Users:** new configuration only. The LTDC fix changes no behaviour.
   * **Build:** none outside the new configuration.
   * **Hardware:** LINUM-STM32H753BI only.
   * **Documentation:** the board page gains an `nxdoom` section; the NXDoom
     application page gains a section on the display options.
   * **Compatibility:** the board's other configurations (`lvgl`, `lvglterm`,
     `lvglterm_kbda`) are untouched and keep RGB565; each has its own defconfig.
   * **Security:** none.
   
   ## Testing
   
   **Host:** Linux x86_64, `arm-none-eabi-gcc`.
   **Board:** LINUM-STM32H753BI with the 1024x600 LCD, a USB HID keyboard, and a
   microSD card holding `doom1.wad`.
   
   Built warning-free; `nxstyle` reports 0 warnings on the changed source file.
   The board's other LTDC configurations were rebuilt to confirm they are
   unaffected.
   
   Game running on the board:
   
   ```
   nsh> mount -t vfat /dev/mmcsd0 /mnt
   nsh> nxdoom -iwad /mnt/doom1.wad
                                NXDoom v0.0.0
   zone memory: Using native C allocator.
   Using /mnt/ for configuration and saves
   W_Init: Init WADfiles.
    adding /mnt/doom1.wad
   ===========================================================================
                               DOOM Shareware
   ===========================================================================
   i_init: Setting up machine state.
   m_init: Init miscellaneous info.
   r_init: Init DOOM refresh daemon - [                   ]...................
   p_init: Init Playloop state.
   d_check_net_game: Checking network game status.
   startskill 2  deathmatch: 0  startmap: 1  startepisode: 1
   player 1 of 1 (1 nodes)
   Emulating the behavior of the 'Doom 1.9' executable.
   hu_init: Setting up heads up display.
   st_init: Init status bar.
   ```
   
   The game plays from the USB keyboard and runs stably; it was left running for
   minutes at a time without an assertion. Available memory before starting,
   showing the 6 MiB contiguous SDRAM region the game's zone comes from:
   
   ```
   nsh> free
         total       used       free    maxused    maxfree  nused  nfree name
       7070988      10980    7060008      11776    6291440     44      6 Umem
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to