marwan-geotab opened a new pull request, #20234: URL: https://github.com/apache/nuttx/pull/20234
## Summary Adds the STM32H5 SDMMC1/SDMMC2 lower-half SDIO driver: interrupt-mode and IDMA data transfers, SD/SDIO card mode, following the same structure as the existing STM32H7 SDMMC driver (arch/arm/src/stm32h7/stm32_sdmmc.c). Needed for a board that uses SDMMC1 in SDIO mode with IDMA to talk to an onboard WiFi module. This also fixes two problems that would otherwise leave the driver dead or unusable: - stm32_sdmmc.c originally guarded everything on CONFIG_STM32H5_SDMMC1 / CONFIG_STM32H5_SDMMC_IDMA / CONFIG_STM32H5_SDMMC_XFRDEBUG, but the actual Kconfig symbols this chip selects are the shared CONFIG_STM32_SDMMC1 / CONFIG_STM32_SDMMC_IDMA / CONFIG_STM32_SDMMC_XFRDEBUG defined in arch/arm/src/common/stm32/Kconfig.sdio and Kconfig.periph. With the old names none of the guards would ever be true, so the whole driver would silently compile out. Renamed every guard to match, and fixed the same kind of typo (STM32H5_SRAM3_SIZE -> STM32_SRAM3_SIZE) in the IDMA-reach check. - arch/arm/src/common/stm32/Kconfig.sdio restricted CONFIG_STM32_SDMMC_IDMA and the SDMMC1/2 SDIO-mode and pull-up options to STM32H7 (ARCH_CHIP_STM32H7 / STM32_COMMON_F7_H7) only, so even with the guards fixed there was no way to actually enable this for STM32H5 through normal Kconfig. Extended STM32_SDMMC_IDMA to also allow ARCH_CHIP_STM32H5, and switched the SDIO-mode/pull-up options to the existing STM32_COMMON_F7_H7_H5 composite symbol, matching the pattern already used for other STM32H5 peripherals (Ethernet, ADC, SPI, timers). ## Testing - Build-only regression: nucleo-h563zi:nsh (in-tree STM32H5 board, SDMMC not selected) builds cleanly with no changes in behavior. - Functional build: with CONFIG_STM32_SDMMC1=y, CONFIG_STM32_SDMMC_IDMA=y, CONFIG_SDMMC1_SDIO_MODE=y, CONFIG_MMCSD_SDIO=y, CONFIG_SDIO_BLOCKSETUP=y enabled on top of nucleo-h563zi:nsh (plus temporary board.h SDMMC1 pin/clock defines, since this board does not wire SDMMC1 -- reverted before this commit), stm32_sdmmc.c compiles and links into nuttx.bin with no warnings. - ./tools/checkpatch.sh -g HEAD passes clean. Note: ./tools/checkpatch.sh -f on the whole file reports pre-existing-style false positives (bad switch/case alignment, etc.) that nxstyle also reports on the already-merged arch/arm/src/stm32h7/stm32_sdmmc.c this driver mirrors, so they were left as-is rather than reformatted away from the established pattern. - Real hardware validation (a Geotab STM32H5 board with the SDMMC1 bus wired) is planned separately; this PR is opened as a draft pending that. -- 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]
