nuttx/arch/arm/src/common
Austin.Chen 5197329b67 arch/arm/stm32h5: add SDMMC1/SDMMC2 driver
Add the STM32H5 SDMMC1/SDMMC2 lower-half SDIO driver (interrupt-mode and
IDMA transfers, SD/SDIO card mode), following the same structure as the
existing STM32H7 SDMMC driver.

Three fixes were needed to get this actually building, selectable, and
correct:

- The driver checked CONFIG_STM32H5_SDMMC1/CONFIG_STM32H5_SDMMC_IDMA/
  CONFIG_STM32H5_SDMMC_XFRDEBUG, but the real Kconfig symbols selected by
  this chip are the shared CONFIG_STM32_SDMMC1/CONFIG_STM32_SDMMC_IDMA/
  CONFIG_STM32_SDMMC_XFRDEBUG (see arch/arm/src/common/stm32/Kconfig.sdio,
  Kconfig.periph). With the old names the driver silently compiled out.
  Renamed all guards in stm32_sdmmc.c to match. Also fixed a similar typo,
  STM32H5_SRAM3_SIZE -> STM32_SRAM3_SIZE, in the IDMA-reach check.

- arch/arm/src/common/stm32/Kconfig.sdio's STM32_SDMMC_IDMA and the
  SDMMC1/2 SDIO-mode/pull-up options depended on ARCH_CHIP_STM32H7 /
  STM32_COMMON_F7_H7 only. Extended STM32_SDMMC_IDMA to also allow
  ARCH_CHIP_STM32H5, and switched the SDIO-mode/pull-up options to
  STM32_COMMON_F7_H7_H5, matching the pattern already used for other
  STM32H5 peripherals (Ethernet, ADC, SPI, timers).

- stm32_sdmmc.c was only added to Make.defs, not to CMakeLists.txt, so
  the driver would silently be omitted from CMake builds. Added it to
  the same unconditional source list as stm32_exti_gpio.c.

Also ports a fix from a related STM32H7 SDMMC commit
(2cb7b7c03e): stm32_recvdma()'s aligned
IDMA receive path invalidated the destination buffer before the DMA but
never again after it completed, so a speculative cache prefetch into
that buffer between those two points could shadow the freshly-received
data with a stale line. Added the missing post-DMA invalidate, matching
the pattern already used elsewhere on this chip for other DMA-capable
peripherals (e.g. stm32_ethernet.c's RX path).

Needed for a custom STM32H5 board that uses SDMMC1 in SDIO mode with
IDMA to talk to an onboard WiFi module.

Co-authored-by: Liam Howatt <liamhowatt@geotab.com>
Signed-off-by: Marwan Madkour <marwanmadkour@geotab.com>
2026-09-25 18:30:40 +08:00
..
ameba sched/semaphore: Remove the return value check of nxsem_init/nxmutex_init 2026-09-25 10:37:43 +02:00
gnu arch/atomic: remove up_testset in spinlock 2026-09-08 08:58:54 +08:00
iar arch/atomic: remove up_testset in spinlock 2026-09-08 08:58:54 +08:00
stm32 arch/arm/stm32h5: add SDMMC1/SDMMC2 driver 2026-09-25 18:30:40 +08:00
arm_allocateheap.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
arm_backtrace_fp.c
arm_backtrace_sp.c
arm_backtrace_unwind.c
arm_checkstack.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
arm_createstack.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
arm_exit.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
arm_fork.c arch/arm: Build fork() children from the caller's syscall frame on armv7-a. 2026-08-10 08:57:30 -03:00
arm_fork.h
arm_getintstack.c
arm_hostfs.c fs/hostfs: fix pre-existing nxstyle issues in touched files 2026-08-28 18:35:37 +08:00
arm_idle.c
arm_initialize.c
arm_internal.h serial/uart_rpmsg: add _raw version of driver 2026-02-23 09:19:57 -03:00
arm_lowputs.c
arm_modifyreg.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
arm_nputs.c
arm_poweroff.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
arm_pthread_start.c
arm_registerdump.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
arm_releasestack.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
arm_semi_syslog.c
arm_signal_dispatch.c arch/arm: Add support to disable signals actions related data struct 2026-01-18 08:24:13 -03:00
arm_stackframe.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
arm_task_start.c
arm_tls.c arch/arm: Fix TLS initialization to account for padding between sections 2026-01-09 21:48:28 +08:00
arm_usestack.c include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
CMakeLists.txt arch/atomic: remove up_testset in spinlock 2026-09-08 08:58:54 +08:00
crt0.c
hwcap.h
Make.defs arch/atomic: remove up_testset in spinlock 2026-09-08 08:58:54 +08:00
README_lwl_console.txt
Toolchain.defs arch/arm: Say which linker is missing when FDPIC has none. 2026-09-09 10:21:21 +08:00