Skip to content

BLE_INIT: controller init failed error with ESP-IDF and Arduino component #432

Description

@moritz89

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>

void setup() {
  delay(2000);
  Serial.begin(115200);
  while (!Serial) {
    ;  // wait for serial port to connect
  }
  Serial.println("INIT");
  NimBLEDevice::init("");
}

void loop() {
  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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions