Repository navigation
drivers/spi: QEMU virtual SPI loopback bus for utest (#11972) - #11979
cms19859230182-lang wants to merge 2 commits into
Conversation
…1972) Register a pure-software SPI bus (default name spi2) with memcpy loopback xfer so components.drivers.spi.loopback passes on qemu-vexpress-a9 without a PL022 model. Fix utest include/CPPPATH and align Kconfig/rtconfig bus name. Verified: scons + qemu utest_run components.drivers.spi.loopback PASSED. Fixes RT-Thread#11972 (SPI/QEMU checklist item).
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
📌 Code Review Assignment🏷️ 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-11-03 10:14 CST)
📝 Review Instructions
|
Fix the 'Check File Format and License' CI job failure: - put the spi_virt_ops initializer brace on the assignment line - add the missing newline at end of file No functional change.
|
摘要
为
#11972清单里 SPI/QEMU 格增加固件内虚拟 SPI bus(软件 MOSI↔MISO 回环),使现有components.drivers.spi.loopbackutest 在qemu-vexpress-a9上全绿,无需真实 PL022 模型。本 PR 仅覆盖 SPI/QEMU 子项;清单其它设备格不在范围内,勿视为整份 #11972 已完成。
改动文件
components/drivers/spi/utest/spi_virt_bus.c(新建):纯软件 SPI bus,默认名spi2;configure+xfer(memcpy 回环) +rt_spi_bus_register+INIT_BOARD_EXPORTcomponents/drivers/spi/utest/SConscript:纳入spi_virt_bus.c;CPPPATH补utilities/utest与drivers/includecomponents/drivers/spi/utest/Kconfig:RT_UTEST_SPI_LOOPBACK_BUS_NAME默认spi2,补充 qemu 说明bsp/qemu-vexpress-a9/rtconfig.h:打开RT_USING_UTEST/RT_UTEST_SPI_LOOPBACK,bus 名spi2bsp/qemu-vexpress-a9/.config:与上面对齐的 Kconfig 符号验证
摘录:
时钟矩阵 100k–10M Hz;数据长度 1–512 bytes(全双工 sendrecv/transfer/transfer_message)均通过。
English
Add an in-firmware virtual SPI loopback bus (software MOSI↔MISO) so
components.drivers.spi.loopbackpasses onqemu-vexpress-a9without a PL022 model. Default bus namespi2. Fixes the SPI/QEMU checklist item of #11972 only.Fixes #11972