You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BLE_INIT: controller init failed error with ESP-IDF and Arduino component #432
I am running into this crash as soon as I call NimBLEDevice::init("");
It is based on a clean project with Bluetooth and Bluetooth host NimBLE enabled.
Added the compile definition to the main CMakeLists.txt file:
# The following lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.16)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
# "Trim" the build. Include the minimal set of components, main, and anything it depends on.
idf_build_set_property(MINIMAL_BUILD ON)
project(NimBLE_GATT_Server)
add_compile_definitions(ARDUINO_ARCH_ESP32=1)
The main.cpp file is:
#include<Arduino.h>
#include<NimBLEDevice.h>voidsetup() {
delay(2000);
Serial.begin(115200);
while (!Serial) {
; // wait for serial port to connect
}
Serial.println("INIT");
NimBLEDevice::init("");
}
voidloop() {
Serial.println("loop");
delay(1000);
}
It does not crash if the setup() and loop() are not called but if "Autostart Arduino setup and loop on boot" is enabled it does.
Activity
moritz89 commentedon Jul 30, 2026
One workaround I've found is adding this include at the start of the main.cpp
h2zero commentedon Jul 31, 2026
@moritz89 could you provide more information as to your environment setup? This header is already included through:
esp-nimble-cpp/src/NimBLEDevice.cpp
Line 56 in 6d5a9be
moritz89 commentedon Jul 31, 2026
nimble-test.zip
Here is a minimal example of the crash. Using VS Code and ESP-IDF. Hope it compiles and flashes on your side. Used an ESP32 WROOM dev kit
h2zero commentedon Aug 1, 2026
Thanks, I needed to update the idf version I was using to repro but I have resolved both of your issues in #434
moritz89 commentedon Aug 3, 2026
Thanks for the quick turnaround