-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
seeed_xiao_esp32c5 support (IDF v5.5) #17912
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
Conversation
|
Thanks for the contribution. Please can you separate the changes here into two commits:
|
d66fea2 to
24a0bda
Compare
|
@dpgeorge |
|
@Vincent1-python WOW! That's cool! |
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.
Couple of minor suggestions, but this PR looks mostly good to me.
Although it would be good to have a ESP32_GENERIC_C5 board as well as the SEEED board.
Note we currently do all nightly builds with IDF v5.4.2, so we won't be able to start building ESP32-C5 in nightly builds (or CI) until we bump that version. (Same applies for ESP32-P4 support, I think).
|
@projectgus OK,I resolved conversation : ) |
e0cdaec to
3b53f8d
Compare
projectgus
left a comment
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.
I see you've changed the XIAO board to ESP32_GENERIC_C5, but some additional changes are needed to add this as a generic board.
I have a C5 Devkit on order, so I can help test this PR when it arrives.
|
Compiled with a no-name ESP3C5 board using esp-idf v5.5.1. At first, the firmware was too large for the factory partition, ~32k overflow. SO I added the line below to sdkconfig.board, which reduces the firmware size by about 90k. The line does not have any impact on performance.
|
|
@AZKKXL the esp32 port now uses IDF v5.5.1, so this C5 support should work. Can you please rebase this on latest master? |
Already rebase. |
|
Code size report: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #17912 +/- ##
=======================================
Coverage 98.38% 98.38%
=======================================
Files 171 171
Lines 22294 22294
=======================================
Hits 21933 21933
Misses 361 361 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
8d5f308 to
be6b7b1
Compare
|
@AZKKXL Something went wrong when you rebased (it had 255 commits showing in the PR). I've rebased again and squashed down to one commit so we can re-review. If you need to make any more local changes then you'll need to reset your local branch to match this remote branch, first. (To do this, run |
projectgus
left a comment
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.
@AZKKXL Looks like this PR only needs some minor cleanup and we can merge it.
I apologize for only seeing this now due to personal reasons. Could you confirm if the current submission format is correct? If not, please let me know. I will pay close attention to this in the coming days and strive to complete this PR. |
82f4f46 to
a98ada0
Compare
|
I tested building the new ESP32_GENERIC_C5 board, and it doesn't build due to two reasons:
For the first problem, I suggest dynamically calculating the I2C bus frequency using (in @@ -263,7 +263,13 @@ static void machine_hw_i2c_init(machine_hw_i2c_obj_t *self, bool first_init) {
.master.clk_speed = self->freq,
};
i2c_param_config(self->port, &conf);
- int timeout = i2c_ll_calculate_timeout_us_to_reg_val(I2C_SCLK_FREQ, self->timeout_us);
+ #if CONFIG_IDF_TARGET_ESP32C5
+ uint32_t i2c_sclk_freq;
+ check_esp_err(esp_clk_tree_src_get_freq_hz(I2C_CLK_SRC_DEFAULT, ESP_CLK_TREE_SRC_FREQ_PRECISION_APPROX, &i2c_sclk_freq));
+ #else
+ uint32_t i2c_sclk_freq = I2C_SCLK_FREQ;
+ #endif
+ int timeout = i2c_ll_calculate_timeout_us_to_reg_val(i2c_sclk_freq, self->timeout_us);
i2c_set_timeout(self->port, (timeout > I2C_LL_MAX_TIMEOUT) ? I2C_LL_MAX_TIMEOUT : timeout);
i2c_driver_install(self->port, I2C_MODE_MASTER, 0, 0, 0);
}For the second problem, include the |
|
Oh, and I think a dependencies lock file needs to be added for C5 as well. |
Sorry, could we ask you to handle the maintenance of this after merging the PR later? |
|
OK, I've now added to this PR the following:
|
Signed-off-by: yuan_mo <[email protected]> Signed-off-by: Damien George <[email protected]>
Signed-off-by: yuan_mo <[email protected]>
Signed-off-by: Damien George <[email protected]>
f7f8d4b to
336d463
Compare
Summary
The is esp32c5 officially supported in IDF v5.5
Pulling together changes and generic board support needed here.
Some details
Tesing
machine.pin
machine.i2c
machine.adc
machine.pwm
machine.timer