-
Couldn't load subscription status.
- Fork 5.3k
Esp32c3 app update #10780
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
base: master
Are you sure you want to change the base?
Esp32c3 app update #10780
Conversation
|
👋 感谢您对 RT-Thread 的贡献!Thank you for your contribution to RT-Thread! 为确保代码符合 RT-Thread 的编码规范,请在你的仓库中执行以下步骤运行代码格式化工作流(如果格式化CI运行失败)。 🛠 操作步骤 | Steps
完成后,提交将自动更新至 如有问题欢迎联系我们,再次感谢您的贡献!💐 |
| * 2023-10-20 WCX1024979076 add wifi application | ||
| */ | ||
|
|
||
| #define RT_BSP_LED_PIN 2 |
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.
redefine
| "target": "ES2020", | ||
| "module": "commonjs", | ||
| "lib": ["ES2020"], | ||
| "outDir": "./dist", |
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.
?? what's this file used for?
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.
Please delete the useless file
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 adds an application update to the ESP32-C3 BSP that introduces a FinSH command for managing application data and configures LED GPIO settings. The purpose is to demonstrate basic RT-Thread functionality including thread management, GPIO control, and shell command integration.
- Added a custom FinSH command (
app_data_cmd) for reading/writing a global application variable - Configured LED GPIO pin definitions in both header and source files
- Extended Kconfig with board-level driver options and application command settings
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| bsp/ESP32_C3/rtconfig.h | Added LED GPIO pin definition placeholder with comment instructions |
| bsp/ESP32_C3/main/main.c | Implemented FinSH command functionality and LED pin definition |
| bsp/ESP32_C3/main/SConscript | Added duplicate build configuration with source file specifications |
| bsp/ESP32_C3/Kconfig | Extended configuration options for board drivers and application features |
Comments suppressed due to low confidence (1)
bsp/ESP32_C3/main/SConscript:1
- Maintainability/可维护性: The entire build configuration is duplicated after line 11, creating redundant and potentially conflicting build rules. This will likely cause build errors.
中文:整个构建配置在第11行后重复,创建了冗余且可能冲突的构建规则。这可能会导致构建错误。
import os
|
|
||
| // Define the GPIO pin number for the on-board LED | ||
| // *** You must replace 'X' with the correct physical GPIO number (e.g., 2, 8, 15, etc.) *** | ||
| #define RT_BSP_LED_PIN X |
Copilot
AI
Oct 11, 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.
Bug/错误: The LED pin is defined as 'X' which is not a valid GPIO number and will cause compilation errors.
中文:LED引脚定义为'X',这不是有效的GPIO编号,会导致编译错误。
| #define RT_BSP_LED_PIN X | |
| #define RT_BSP_LED_PIN 12 |
| #ifndef RT_CONFIG_H__ | ||
| #define RT_CONFIG_H__ | ||
|
|
||
| // Inside bsp/ESP32_C3/board.h |
Copilot
AI
Oct 11, 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.
Documentation/文档: Comment incorrectly references 'board.h' but this code is in 'rtconfig.h'.
中文:注释错误地引用了'board.h',但此代码在'rtconfig.h'中。
| // Inside bsp/ESP32_C3/board.h | |
| // Board-related configuration options |
| * 2023-10-20 WCX1024979076 add wifi application | ||
| */ | ||
|
|
||
| #define RT_BSP_LED_PIN 2 |
Copilot
AI
Oct 11, 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.
Maintainability/可维护性: LED pin definition is duplicated between rtconfig.h and main.c, creating inconsistency risk. The definition should come from a single source.
中文:LED引脚定义在rtconfig.h和main.c之间重复,存在不一致的风险。定义应该来自单一源。
| #define RT_BSP_LED_PIN 2 | |
| #include <rtconfig.h> |
| config BSP_USING_BLE | ||
| bool "Enable Bluetooth Low Energy (BLE) Support" | ||
| default y | ||
| select ESP32C3_BLE_DRV # Link to the underlying chip driver config (name may vary) |
Copilot
AI
Oct 11, 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.
Bug/错误: The config option 'ESP32C3_BLE_DRV' may not exist in the RT-Thread configuration system, which could cause Kconfig errors.
中文:配置选项'ESP32C3_BLE_DRV'可能在RT-Thread配置系统中不存在,这可能导致Kconfig错误。
| select ESP32C3_BLE_DRV # Link to the underlying chip driver config (name may vary) | |
| # select ESP32C3_BLE_DRV # Link to the underlying chip driver config (name may vary) |
| config RT_USING_WIFI | ||
| bool "Enable Wi-Fi Support" | ||
| default y | ||
| select RT_USING_WIFI_DRIVER_ESP32C3 # Link to the underlying driver config (name may vary) |
Copilot
AI
Oct 11, 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.
Bug/错误: The config option 'RT_USING_WIFI_DRIVER_ESP32C3' may not exist in the RT-Thread configuration system, which could cause Kconfig errors.
中文:配置选项'RT_USING_WIFI_DRIVER_ESP32C3'可能在RT-Thread配置系统中不存在,这可能导致Kconfig错误。
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.
please fix code by the comment
|
@supperthomas sure sir I will work on it.. |

RT-Thread Board Support Package for ESP32-C3
📝 Introduction
This is the Board Support Package (BSP) for the Espressif ESP32-C3 series of microcontrollers, built to run the RT-Thread Real-Time Operating System.
This BSP is configured to use the [Specify the name of your specific evaluation/dev board, e.g., 'ESP32-C3-DevKitM-1'].
✨ Features
This BSP provides the standard RT-Thread kernel and system components, and includes the following application features by default:
main.cto blink the onboard LED, demonstrating basic thread management and GPIO control.app_data_cmd) for reading/writing a global application variable.🛠️ Build and Configuration
1. Building the Project
Navigate to the BSP directory:
cd bsp/ESP32_C3Run the SCons build tool:
This generates the firmware image (e.g.,
rtthread.elf).Flashing: Use the standard flash command for your environment (e.g.,
scons --target=download).2. Configuration (
menuconfig)You can modify system settings and enable features using the
menuconfigtool: