ESP32 BLE Initialization Fails with Memory Error
DodaTech
Updated 2026-06-26
1 min read
In this tutorial, you'll learn about ESP32 BLE Initialization Fails with Memory Error. We cover key concepts, practical examples, and best practices.
The Problem
ESP32 BLE initialization fails with 'insufficient memory' or 'controller config error'.
Quick Fix
Wrong
BLEDevice::init("ESP32-BLE");
BLEServer* pServer = BLEDevice::createServer();
E (154) BT: esp_bt_controller_mem_release: not enough memory
E (156) BT: set_controller_config: controller not initialized
Right
#include <BLEDevice.h>
void setup() {
BLEDevice::init("ESP32-BLE");
BLEServer* pServer = BLEDevice::createServer();
Serial.println("BLE initialized");
}
BLE initialized
Prevention
Ensure no conflict with Classic Bluetooth. Use ESP_BT_MODE_BTDM for dual mode. Allocate enough memory in menuconfig (BLE: ~300KB). Update ESP32 Arduino core to latest version. Free memory with esp_bt_controller_mem_release() before init.
DodaTech engineers apply these same patterns when building Doda Browser's networking stack, DodaZIP's firmware packaging pipeline, and Durga Antivirus Pro's sensor communication layer.
FAQ
← Previous
ESP32 BLE Write Characteristic Not Updating
Next →
ESP32 Classic Bluetooth Not Discoverable
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro