Repository navigation
Conversation
Purpose: 1. Introduce a native OSPI path into RT-Thread SPI driver layer, enabling OSPI alongside existing SPI/QSPI. 2. Make SFUD work over OSPI (read/write/erase/WREN/WRSR/RDSR) while keeping SPI/QSPI behavior unchanged. 3. Keep existing SPI/QSPI behavior unchanged. Description: 1. components/drivers/spi/Kconfig: Add OSPI build options. 2. components/drivers/spi/SConscript: Include "dev_ospi_core.c". 3. components/drivers/spi/dev_ospi_core.c: Implement OSPI core transfer helpers. 4. components/drivers/spi/dev_spi_flash_sfud.c/.h: Add OSPI 1-1-1/8-8-8 paths for transferring messages and probing OSPI device. 5. components/drivers/spi/sfud/inc/sfud_cfg.h, sfud_def.h: Add OSPI enable macros and related definitions. 6. components/drivers/spi/sfud/inc/sfud_flash_def.h: Add MX25LM51245G (OctaFlash, 512Mbit) to device table for testing/verification. 7. components/drivers/spi/sfud/src/sfud.c: Integrate the OSPI path into SFUD for read, write, erase, WREN, WRSR, and RDSR operations while retaining the existing SPI/QSPI paths. 8. components/drivers/include/drivers/dev_spi.h: Add OSPI bus/config/message/device structs. Tested in stm32l4r9-st-eval BSP project: Using "sf probe/read/write/erase/status/bench" to test 1-1-1 and 8-8-8 (OPI STR/DTR) data paths. Signed-off-by: CliffLL <clifflin@mxic.com.cn>
Purpose: Provide a generic OSPI low-level driver under STM32 HAL_Drivers to validate and enable the components-layer OSPI path on STM32 BSPs. Description: 1. bsp/stm32/libraries/HAL_Drivers/drivers/drv_ospi.c/.h: Implement generic OctoSPI init, support transfers in SPI/OSPI mode (1-1-1/8-8-8) and provide helpers for command sequences. 2. bsp/stm32/libraries/HAL_Drivers/drivers/config/l4/ospi_config.h: Add default OCTOSPI mapping for stm32l4xx. 3. bsp/stm32/libraries/HAL_Drivers/drivers/SConscript, drv_config.h: Include the new driver when needed. Tested in stm32l4r9-st-eval BSP project. Signed-off-by: CliffLL <clifflin@mxic.com.cn>
Purpose: 1. Validate the components‑layer OSPI path on a real board by adding board‑level OctaFlash support (1‑1‑1 and OPI STR/DTR). 2. Provide a working BSP setup (clocks/pins/MSP/OSPIM and heap/linker fixes) for out-of-the-box SFUD testing. Description: 1. Provide the OSPI flash driver to attach OSPI device on stm32l4r9‑eval, init bus and provide helpers to enter OPI STR/DTR for upper‑layer tests. 2. Modify the .ioc file and regenerate code to enable OCTOSPI1 and update pin/clock/MSP. 3. Add using OSPI options and include the new driver. 4. Fix heap/linker mismatches observed in GCC run: Align BSP with RT‑Thread heap/layout template to avoid .bss overlap. 5. Document OctaFlash support and usage notes for this board. 6. Regenerate the MDK5 and IAR projects for the BSP. Notes: 1. Default to BSP minimal config per guideline: Only UART (console) and GPIO enabled; DMA off; FinSH MSH‑only; User main with 1Hz LED blink. 2. Dist packaging: created offline dist for testing; GCC build from dist is OK; MDK5 and IAR projects generated by dist are OK. 3. Due to environment limits, MDK5/IAR flashing was not performed. (Build and run were fully verified on GCC; MDK5/IAR projects were generated.) Signed-off-by: CliffLL <clifflin@mxic.com.cn>
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
📌 Code Review Assignment🏷️ Tag: bsp_stm32Reviewers: @Liang1795 @hamburger-os @wdfk-prog Changed Files (Click to expand)
🏷️ Tag: componentsReviewers: @Maihuanyi Changed Files (Click to expand)
🏷️ Tag: components_driver_spiReviewers: @Liang1795 @wdfk-prog Changed Files (Click to expand)
📊 Current Review Status (Last Updated: 2026-10-21 15:22 CST)
📝 Review Instructions
|
|
拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR)
RT-Thread currently lacks a native OSPI path for accessing OctaFlash through its SPI driver layer and SFUD.
This PR adds OSPI support at the components layer while retaining the existing SPI and QSPI paths. To validate the complete path on hardware, it also adds a generic STM32 OctoSPI driver and board-level OSPI Flash support for the stm32l4r9-st-eval BSP. Together, these changes enable SFUD to access the Flash in 1-1-1 and 8-8-8 (OPI STR/DTR) modes.
你的解决方案是什么 (what is your solution)
请提供验证的bsp和config (provide the config and bsp)
bsp/stm32/stm32l4r9-st-eval/Verification
sf probe ospi10,sf read [addr] [size],sf write [addr] [Value1] [Value2]...,sf erase [addr] [size (4096 = 4KB)],sf status 0 [Value], andsf benchto verify the 1-1-1 and 8-8-8 (OPI STR/DTR) data paths. For example:sf probe ospi10,sf read 0x1000 16,sf write 0x1000 0xAA 0xBB 0xCC 0xDD,sf erase 0x1000 4096,sf status 0 0x04,sf status, andsf bench yes.Note: STM32L4 HAL package integration
The STM32L4 HAL package is maintained separately from the main RT-Thread repository and is downloaded for the BSP through
pkgs --update. Therefore, changes to its SConscript are not included in this PR.To build the STM32 OSPI driver, the package's
bsp/stm32/libraries/stm32l4_hal_driver-latest/SConscriptalso needs to includestm32l4xx_hal_ospi.cin itsRT_USING_SPIsource list:Without this change, the required HAL OSPI implementation is not compiled, so the OSPI driver cannot be linked. The verification described in this PR was performed with this package-side change applied locally.
Once this build rule is incorporated into the STM32L4 HAL package, users will be able to use
pkgs --update, enable the required options and build the BSP without modifying the downloaded package manually.]
当前拉取/合并请求的状态 Intent for your PR
必须选择一项 Choose one (Mandatory):
代码质量 Code Quality:
我在这个拉取/合并请求中已经考虑了 As part of this pull request, I've considered the following:
#if 0代码,不包含已经被注释了的代码 All redundant code is removed and cleaned up