Skip to content

[bsp][esp32-c6] compile SPI when it is selected - #11846

Open
cms19859230182-lang wants to merge 2 commits into
RT-Thread:masterfrom
cms19859230182-lang:bsp/esp32c6-spi-link
Open

cms19859230182-lang wants to merge 2 commits into
RT-Thread:masterfrom
cms19859230182-lang:bsp/esp32c6-spi-link

Conversation

@cms19859230182-lang

@cms19859230182-lang cms19859230182-lang commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Selecting BSP_USING_SPI on ESP32-C6 now links the IDF SPI master. The default image still leaves SPI off.
  • The shared ESP driver no longer falls through SPI modes, returns the transferred byte count, and takes the chip-select pin from SPI2_IOMUX_PIN_NUM_CS. C6 asks for SPI_DMA_DISABLED. Other chips keep SPI_DMA_CH_AUTO.
  • spi_configure() returns -RT_EINVAL when configuration is null. The unused esp32_spi_init() call that passed NULL is gone.
  • The peripheral table is unchanged. SPI stays unsupported. The GPIO7 to GPIO2 loopback was not run again.

Test plan

  • ESP32-C6 with RT_USING_SPI, BSP_USING_SPI and BSP_USING_SPI2 added to rtconfig.h, RT_USING_ADC kept: scons exit 0. rtthread.bin is 466416 bytes. text is 371342. The link includes drv_spi, spi_common, spi_master, spi_hal and gdma.
  • Those three lines removed, then scons again: exit 0. rtthread.bin is 445408 bytes. text is 340218. The link does not include drv_spi.
  • Not flashed. The loopback was not run again.

Selecting BSP_USING_SPI on C6 links the IDF SPI master. The default image still leaves SPI off, and the peripheral table stays unsupported.
@github-actions

Copy link
Copy Markdown

👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread!

为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。
To ensure your code complies with RT-Thread's coding style, please run the code formatting workflow by following the steps below (If the formatting of CI fails to run).


🛠 操作步骤 | Steps

  1. 前往 Actions 页面 | Go to the Actions page
    点击进入工作流 → | Click to open workflow →

  2. 点击 Run workflow | Click Run workflow

  • Use workflow from 保持默认分支(通常为 master)
    Keep the default branch (usually master) in Use workflow from
  • 在 branch 输入框填写 PR 分支 bsp/esp32c6-spi-link
    Enter PR branch bsp/esp32c6-spi-link in the branch field
  • 设置需排除的文件/目录(目录请以"/"结尾)
    Set files/directories to exclude (directories should end with "/")
  1. 等待工作流完成 | Wait for the workflow to complete
    格式化后的代码将作为独立提交推送至你的分支。
    The formatting changes will be pushed to your branch as a separate commit.

完成后,提交将自动更新至 bsp/esp32c6-spi-link 分支,关联的 Pull Request 也会同步更新。
Once completed, commits will be pushed to the bsp/esp32c6-spi-link branch automatically, and the related Pull Request will be updated.

如有问题欢迎联系我们,再次感谢您的贡献!💐
If you have any questions, feel free to reach out. Thanks again for your contribution!

@github-actions github-actions Bot added BSP BSP: ESP32 BSP related with ESP labels Sep 29, 2026
@github-actions

github-actions Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

MemBrowse Memory Report

No memory changes detected for:

cppcheck follows spi_configure(NULL, NULL) into a dereference. clang-format also wants the macro backslashes left-aligned and a single space around the enum equals.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BSP: ESP32 BSP related with ESP BSP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant