mirror of
https://github.com/esphome/esphome.git
synced 2026-05-29 06:27:24 +08:00
[esp32_ble] Enable CONFIG_BT_RELEASE_IRAM on ESP32-C2 (#14109)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -9,6 +9,7 @@ from esphome import automation
|
|||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
from esphome.components import socket
|
from esphome.components import socket
|
||||||
from esphome.components.esp32 import add_idf_sdkconfig_option, const, get_esp32_variant
|
from esphome.components.esp32 import add_idf_sdkconfig_option, const, get_esp32_variant
|
||||||
|
from esphome.components.esp32.const import VARIANT_ESP32C2
|
||||||
import esphome.config_validation as cv
|
import esphome.config_validation as cv
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
CONF_ENABLE_ON_BOOT,
|
CONF_ENABLE_ON_BOOT,
|
||||||
@@ -387,6 +388,15 @@ def final_validation(config):
|
|||||||
f"Name '{name}' is too long, maximum length is {max_length} characters"
|
f"Name '{name}' is too long, maximum length is {max_length} characters"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# ESP32-C2 has very limited RAM (~272KB). Without releasing BLE IRAM,
|
||||||
|
# esp_bt_controller_init fails with ESP_ERR_NO_MEM.
|
||||||
|
# CONFIG_BT_RELEASE_IRAM changes the memory layout so IRAM and DRAM share
|
||||||
|
# space more flexibly, giving the BT controller enough contiguous memory.
|
||||||
|
# This requires CONFIG_ESP_SYSTEM_PMP_IDRAM_SPLIT to be disabled.
|
||||||
|
if get_esp32_variant() == VARIANT_ESP32C2:
|
||||||
|
add_idf_sdkconfig_option("CONFIG_BT_RELEASE_IRAM", True)
|
||||||
|
add_idf_sdkconfig_option("CONFIG_ESP_SYSTEM_PMP_IDRAM_SPLIT", False)
|
||||||
|
|
||||||
# Set GATT Client/Server sdkconfig options based on which components are loaded
|
# Set GATT Client/Server sdkconfig options based on which components are loaded
|
||||||
full_config = fv.full_config.get()
|
full_config = fv.full_config.get()
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<<: !include common.yaml
|
||||||
|
|
||||||
|
esp32_ble:
|
||||||
|
io_capability: keyboard_only
|
||||||
|
disable_bt_logs: false
|
||||||
Reference in New Issue
Block a user