Skip to content

Fix compilation for esp32-c6 - #4

Open
wojcikt wants to merge 2 commits into
dz0ny:mainfrom
wojcikt:main
Open

Fix compilation for esp32-c6#4
wojcikt wants to merge 2 commits into
dz0ny:mainfrom
wojcikt:main

Conversation

@wojcikt

@wojcikt wojcikt commented Mar 15, 2026

Copy link
Copy Markdown

Hey, I was able to fix two things:

  • The project now compiles for ESP32-C6. The header "esp_nimble_hci.h" is not available for this chip, and isn't really needed.
  • There's a race condition that occurred on my ESP32-C6: calling nimble_port_freertos_init might result in the nimble_on_sync_ callback being called before the flag is set. Setting it earlier is fine, as nimble_port_freertos_init can't fail (returns void).

I've tested it on my board, and everything worked.

Before the fix:

Processing esphome-web-110b00 (board: seeed_xiao_esp32c6; framework: espidf; platform: https://github.com/pioarduino/platform-espressif32/releases/download/55.03.37/platform-espressif32.zip)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------
HARDWARE: ESP32C6 160MHz, 320KB RAM, 4MB Flash
 - contrib-piohome @ 3.4.4 
 - framework-espidf @ 3.50502.0 (5.5.2) 
 - tool-cmake @ 4.0.3 
 - tool-esp-rom-elfs @ 2024.10.11 
 - tool-esptoolpy @ 5.1.2 
 - tool-ninja @ 1.13.1 
 - tool-scons @ 4.40801.0 (4.8.1) 
 - toolchain-riscv32-esp @ 14.2.0+20251107
Reading CMake configuration...
No dependencies
Compiling .pioenvs/esphome-web-110b00/src/esphome/components/bthome/bthome.cpp.o
Compiling .pioenvs/esphome-web-110b00/src/esphome/components/i2c/i2c_bus_esp_idf.cpp.o
Compiling .pioenvs/esphome-web-110b00/src/esphome/components/logger/logger.cpp.o
Compiling .pioenvs/esphome-web-110b00/src/esphome/components/sensor/filter.cpp.o
Compiling .pioenvs/esphome-web-110b00/src/esphome/core/application.cpp.o
Compiling .pioenvs/esphome-web-110b00/src/esphome/core/component.cpp.o
Compiling .pioenvs/esphome-web-110b00/src/esphome/core/component_iterator.cpp.o
Compiling .pioenvs/esphome-web-110b00/src/esphome/core/entity_base.cpp.o
Compiling .pioenvs/esphome-web-110b00/src/esphome/core/scheduler.cpp.o
Compiling .pioenvs/esphome-web-110b00/src/esphome/core/util.cpp.o
In file included from src/esphome/components/bthome/bthome.cpp:1:
src/esphome/components/bthome/bthome.h:20:14: fatal error: esp_nimble_hci.h: No such file or directory

******************************************************************************
* Looking for esp_nimble_hci.h dependency? Check our library registry!
*
* CLI  > platformio lib search "header:esp_nimble_hci.h"
* Web  > https://registry.platformio.org/search?q=header:%1B%5Bm%1B%5BKesp_nimble_hci.h
*
******************************************************************************

   20 |     #include "esp_nimble_hci.h"
      |              ^~~~~~~~~~~~~~~~~~
compilation terminated.
*** [.pioenvs/esphome-web-110b00/src/esphome/components/bthome/bthome.cpp.o] Error 1
================================================================== [FAILED] Took 7.70 seconds ==================================================================

@wojcikt wojcikt changed the title Fix comilation for esp32-c6 Fix compilation for esp32-c6 Apr 29, 2026
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.

1 participant