-
Notifications
You must be signed in to change notification settings - Fork 5.3k
[BSP] xmc7100外设适配和RTDuino适配 #10824
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BSP] xmc7100外设适配和RTDuino适配 #10824
Conversation
👋 感谢您对 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
-
前往 Actions 页面 | Go to the Actions page
点击进入工作流 → | Click to open workflow → -
点击
Run workflow
| ClickRun workflow
- 设置需排除的文件/目录(目录请以"/"结尾)
Set files/directories to exclude (directories should end with "/") - 将目标分支设置为 \ Set the target branch to:
xmc7100
- 设置PR number为 \ Set the PR number to:
10824
- 等待工作流完成 | Wait for the workflow to complete
格式化后的代码将自动推送至你的分支。
The formatted code will be automatically pushed to your branch.
完成后,提交将自动更新至 xmc7100
分支,关联的 Pull Request 也会同步更新。
Once completed, commits will be pushed to the xmc7100
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!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adapts the XMC7100 BSP to support I2C and SPI peripherals, integrates RTduino (Arduino compatibility layer), adds RW007 Wi-Fi support, and fixes GPIO interrupt handling. It also updates configuration defaults (system workqueue, serial ring buffer) and adds Arduino pinout files and example.
- Add RTduino support and Arduino pin mapping with example sketch
- Integrate RW007 Wi-Fi over SPI and adjust SPI bus/pin mappings for XMC7100
- Fix and extend GPIO interrupt mappings; enable system workqueue and enlarge serial RX buffer
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 9 comments.
Show a summary per file
File | Description |
---|---|
bsp/Infineon/xmc7100d-f144k4160aa/rtconfig.h | Enable system workqueue, enlarge serial RB, enable I2C/SPI; adjust RT_NAME_MAX; toggle UART2 |
bsp/Infineon/xmc7100d-f144k4160aa/board/ports/spi_flash_init.c | Attach SPI device to spi0 when RW007 enabled; select CS pin accordingly |
bsp/Infineon/xmc7100d-f144k4160aa/board/ports/drv_rw007.c | Add RW007 Wi-Fi initialization, GPIO init, and IRQ hook |
bsp/Infineon/xmc7100d-f144k4160aa/board/ports/SConscript | Build RW007 driver conditionally |
bsp/Infineon/xmc7100d-f144k4160aa/board/Kconfig | Add RTduino and RW007 menus and options; add I2C2 and SPI0 toggles |
bsp/Infineon/xmc7100d-f144k4160aa/applications/arduino_pinout/pins_arduino.h | Define Arduino digital pin macros, default I2C/SPI bus names |
bsp/Infineon/xmc7100d-f144k4160aa/applications/arduino_pinout/pins_arduino.c | Map Arduino pins to RT-Thread pins and devices |
bsp/Infineon/xmc7100d-f144k4160aa/applications/arduino_pinout/SConscript | Add RTduino pinout sources to build when RTduino enabled |
bsp/Infineon/xmc7100d-f144k4160aa/applications/arduino_pinout/README.md | Add Arduino compatibility README (needs board-specific content) |
bsp/Infineon/xmc7100d-f144k4160aa/applications/arduino_main.cpp | Add simple RTduino sketch using Serial |
bsp/Infineon/xmc7100d-f144k4160aa/applications/SConscript | Auto-add Arduino example when RTduino is enabled |
bsp/Infineon/xmc7100d-f144k4160aa/README.md | Update supported peripherals and usage instructions |
bsp/Infineon/xmc7100d-f144k4160aa/.config | Sync with new config options (workqueue, SPI/I2C, etc.) |
bsp/Infineon/libraries/HAL_Drivers/drv_spi.c | Add XMC7100-specific SPI0 pin mapping |
bsp/Infineon/libraries/HAL_Drivers/drv_gpio.c | Add XMC7100 GPIO IRQ map and adjust IRQ enable path |
Copilot
AI
Oct 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
English: CYHAL_PORT_22 is mapped to ioss_interrupts_gpio_23_IRQn, which is off-by-one. This will route interrupts for port 22 to the wrong IRQ and break GPIO IRQs on that port. Map 22->22, and also add a mapping entry for CYHAL_PORT_23 if required on this SoC. Example fix: {CYHAL_PORT_22, ioss_interrupts_gpio_22_IRQn} and insert {CYHAL_PORT_23, ioss_interrupts_gpio_23_IRQn} before line 84. 中文:CYHAL_PORT_22 被映射到 ioss_interrupts_gpio_23_IRQn(偏移一位),这会导致 22 号端口的中断被路由到错误的中断号,导致该端口的 GPIO 中断异常。应改为 22->22,并补充 CYHAL_PORT_23 的映射。例如修复:{CYHAL_PORT_22, ioss_interrupts_gpio_22_IRQn},并在第84行前插入 {CYHAL_PORT_23, ioss_interrupts_gpio_23_IRQn}。
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hydevcode 关注下,看起来确实写错了
Copilot
AI
Oct 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
English: rt_pin_irq_enable expects PIN_IRQ_ENABLE/PIN_IRQ_DISABLE, not a boolean. Using RT_TRUE will not match the driver's switch-case and likely fails to enable the IRQ. Replace RT_TRUE with PIN_IRQ_ENABLE. 中文:rt_pin_irq_enable 需要传入 PIN_IRQ_ENABLE/PIN_IRQ_DISABLE,而不是布尔值。使用 RT_TRUE 可能导致驱动中的 switch-case 不匹配,从而无法真正使能中断。请将 RT_TRUE 替换为 PIN_IRQ_ENABLE。
Copilot uses AI. Check for mistakes.
Copilot
AI
Oct 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
English: rw007_dev is defined but never used in this file, which adds confusion and maintenance overhead. Remove this unused variable. 中文:rw007_dev 在该文件中未被使用,会增加困惑和维护成本。建议删除该未使用的变量。
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Copilot
AI
Oct 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
English: The symbol BSP_USING_HW_I2C is not defined in this Kconfig; the existing symbol appears to be BSP_USING_I2C. Selecting a non-existent symbol has no effect and may confuse users. Replace with select BSP_USING_I2C. 中文:Kconfig 中未定义 BSP_USING_HW_I2C,现有符号应为 BSP_USING_I2C。选择一个不存在的符号不会生效且会误导用户。请改为 select BSP_USING_I2C。
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Copilot
AI
Oct 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
English: Avoid printing from SConscript during normal builds; it clutters the build log and CI output. Remove this line or guard it behind a verbose/debug flag. 中文:请避免在正常构建时从 SConscript 打印信息,这会污染构建和 CI 日志。建议删除该行或加调试开关控制。
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Copilot
AI
Oct 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
English: Pin macro names are inconsistent with Arduino conventions (D0/D1 vs D00/D01), which can confuse users and libraries. Define D0 and D1 (and keep D00/D01 as aliases if needed) for consistency. Example: #define D0 0; #define D1 1; #define D00 D0; #define D01 D1. 中文:引脚宏命名与 Arduino 约定不一致(D0/D1 被命名为 D00/D01),容易误导用户与库。为保持一致性请定义 D0、D1(可保留 D00/D01 作为别名)。示例:#define D0 0; #define D1 1; #define D00 D0; #define D01 D1。
Copilot generated this review using guidance from repository custom instructions.
Copilot
AI
Oct 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
English: The comments reference 'Serial6' while the device string is 'uart2'; this is misleading for Arduino users (where default is Serial, or explicitly Serial2). Update comments to reflect the actual UART (e.g., 'Serial2-RX/TX' or 'Serial-RX/TX' per your default). 中文:注释写的是 'Serial6',但设备名为 'uart2',对 Arduino 用户有误导(通常为 Serial 或显式 Serial2)。请将注释改为与实际 UART 一致(如 'Serial2-RX/TX' 或根据默认设置改为 'Serial-RX/TX')。
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Copilot
AI
Oct 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
English: This README content appears copied from another BSP (mentions STM32 and uart6) and does not match the XMC7100 configuration/pinout added in this PR. Please replace the table with the actual XMC7100 pin mapping consistent with pins_arduino.{c,h}, and remove placeholder notes. 中文:该 README 似乎从其他 BSP 复制(出现 STM32、uart6),与本 PR 中的 XMC7100 配置/引脚映射不一致。请用与 pins_arduino.{c,h} 一致的 XMC7100 引脚表替换,并删除占位说明。
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
Copilot
AI
Oct 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
English: This README content appears copied from another BSP (mentions STM32 and uart6) and does not match the XMC7100 configuration/pinout added in this PR. Please replace the table with the actual XMC7100 pin mapping consistent with pins_arduino.{c,h}, and remove placeholder notes. 中文:该 README 似乎从其他 BSP 复制(出现 STM32、uart6),与本 PR 中的 XMC7100 配置/引脚映射不一致。请用与 pins_arduino.{c,h} 一致的 XMC7100 引脚表替换,并删除占位说明。
Copilot uses AI. Check for mistakes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hydevcode 关注下,看起来确实写错了
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
拉取/合并请求描述:(PR description)
[
为什么提交这份PR (why to submit this PR)
适配XMC7100的I2C和SPI,以及RTDuino,RW007,修复GPIO中断问题
你的解决方案是什么 (what is your solution)
请提供验证的bsp和config (provide the config and bsp)
]
当前拉取/合并请求的状态 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