Skip to content

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
#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

### How much RAM does BLE use on ESP32?

BLE stack uses approximately 300 KB of DRAM. This leaves about 200 KB for application code on standard ESP32 modules.

Can I use BLE with Wi-Fi simultaneously?

Yes, ESP32 supports Wi-Fi + BLE coexistence. The controller shares time between both radios. Throughput may drop on both interfaces.

What is the maximum BLE connections?

ESP32 supports up to 9 simultaneous BLE connections as a central and 1 as a peripheral in standard configuration.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro