Skip to content

esp-idf-hal: esp32s31 80 MHz clock source is REF_F80M from ESP-IDF v6.1.1 - #634

Merged
ivmarkov merged 1 commit into
esp-rs:masterfrom
ImTheSquid:s31-ref-f80m
Nov 17, 2026
Merged

ivmarkov merged 1 commit into
esp-rs:masterfrom
ImTheSquid:s31-ref-f80m

Conversation

@ImTheSquid

@ImTheSquid ImTheSquid commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Submission Checklist 📝

  • I have updated existing examples or added new ones (if applicable).
  • I have used cargo fmt command to ensure that all changed code is formatted correctly.
  • I have used cargo clippy command to ensure that all changed code passes latest Clippy nightly lints.
  • My changes were added to the CHANGELOG.md of the affected crate(s) in the proper section.

Pull Request Details 📖

Description

ESP-IDF v6.1.1 renamed the esp32s31's 80 MHz clock source from PLL_F80M to REF_F80M (soc/esp32s31/include/soc/clk_tree_defs.h: SOC_MOD_CLK_REF_F80M). It came with the S31 clock-tree fix fix(esp32s31): break clk_tree and deadlock with PERIPH_RCC. esp-idf-hal names the old constants for the esp32s31 in three places, so it does not compile against v6.1.1:

  • rmt.rs: RMT_CLK_SRC_PLL_F80M
  • timer.rs: GPTIMER_CLK_SRC_PLL_F80M
  • uart.rs: UART_SCLK_PLL_F80M

On the esp32s31, each arm now takes the REF_F80M constant under esp_idf_version_at_least_6_1_1, and the PLL_F80M constant below it. The other chips are unchanged. ClockSource::PLLF80M keeps its name, so no caller changes.

Testing

  • Built esp-idf-hal for the esp32s31 against ESP-IDF v6.1.1, as part of a firmware that uses RMT, the GPTimer and the UART driver.
  • Ran that firmware on an ESP-Mosaico (ESP32-S31 rev v0.0).
  • cargo +nightly clippy -p esp-idf-hal --lib --no-deps --target riscv32imafc-esp-espidf -Zbuild-std=std,panic_abort -- -Dwarnings passes with MCU=esp32s31 and ESP_IDF_VERSION=v6.1.1, with picolibc (--cfg espidf_picolibc) and with newlib (sdkconfig.defaults.newlib). CI's matrix stops at v6.1, so it does not reach the new arms.
  • The v6.1.0 arms are the previous code under a narrower cfg; CI's esp32s31 / v6.1 jobs cover them.
  • cargo fmt passes on the three files.

Not in this PR

esp-idf-svc's Classic Bluetooth controller config (bt.rs) does not compile for the esp32s31 against v6.1.1 either: v6.1.1 moved the S31's BR/EDR and LE controller configs into common/btdm_bredr.h and common/btdm_le.h, as esp_bt_ctrl_bredr_config_t and esp_bt_ctrl_le_config_t, with new fields and versions. That is a port of BT_CONTROLLER_INIT_CONFIG_DEFAULT rather than a rename, so it belongs in its own PR.

@ivmarkov

Copy link
Copy Markdown
Collaborator

Thanks!

@ivmarkov
ivmarkov merged commit 9b05e56 into esp-rs:master Nov 17, 2026
67 of 68 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants