sammytranGeo opened a new pull request, #19177: URL: https://github.com/apache/nuttx/pull/19177
## Summary `include/nuttx/spi/qspi.h` currently has `QSPIMEM_QUADIO` for 1-4-4 transfers (address and data both on quad lines) but no way to express 1-1-4 (single-line address, quad-width data only). Several NOR flash devices use this mode for page program commands. This adds `QSPIMEM_QUADDATA` (bit 1) and `QSPIMEM_ISQUADDATA()` to fill that gap, and extends the STM32H5 QSPI driver to set `CCR_DMODE_QUAD` when either `QUADIO` or `QUADDATA` is set. The address-mode selection block is unchanged, so `QUADDATA` keeps `addrmode` at single-line. The GD25 MTD driver is updated as the first user, gaining a `CONFIG_GD25_QSPI` build option that switches it from SPI to QuadSPI. When enabled, `gd25_initialize()` accepts a `qspi_dev_s` pointer and a `bool unprotect`. Both 3- and 4-byte address modes are supported, and the existing SPI path is fully preserved when `CONFIG_GD25_QSPI=n`. ## Impact - `qspi.h`: additive change only — new flag and macro, no existing behaviour changed. - `stm32h5/stm32_qspi.c`: the `else if (QSPIMEM_ISQUADIO(...))` branch gains an `|| QSPIMEM_ISQUADDATA(...)` condition. No impact on existing QUADIO users. - `drivers/mtd/gd25.c`: new `CONFIG_GD25_QSPI` Kconfig option, off by default. Existing SPI users are unaffected. ## Testing **Host:** Linux x86_64, arm-none-eabi-gcc 13.2 **Board:** Custom STM32H563ZI board with GD25Q256 NOR flash on OCTOSPI1 **Config:** Custom board NSH config with `CONFIG_STM32_QSPI1=y`, `CONFIG_MTD_GD25=y`, `CONFIG_GD25_QSPI=y`, `CONFIG_GD25_QSPIFREQUENCY=40000000`, `CONFIG_FS_LITTLEFS=y` LittleFS was mounted on `/dev/mtd0` and a file written and read back to exercise both transfer modes end-to-end: ``` nsh> mount -t littlefs -o forceformat /dev/mtd0 /mnt nsh> echo "hello qspi" > /mnt/test.txt nsh> cat /mnt/test.txt hello qspi ``` -- 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]
