From 8515963e07234953eca6f83ad43f4453b2ea97fb Mon Sep 17 00:00:00 2001 From: Ashley Strahle Date: Tue, 30 Jun 2026 12:34:00 +0000 Subject: [PATCH] pre_build.py: remove CONFIG_BT_ENABLED from sdkconfig patching (fixes BT pre-init conflict with USB) --- pre_build.py | 5 +++-- src/main.cpp | 7 +++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/pre_build.py b/pre_build.py index 9b383e1..e232cc2 100644 --- a/pre_build.py +++ b/pre_build.py @@ -70,8 +70,9 @@ def patch_sdkconfig_bt(): content = f.read() defines = { - "CONFIG_BT_ENABLED": 1, - "CONFIG_BT_NIMBLE_ENABLED": 1, + # Do NOT set CONFIG_BT_ENABLED here — that forces the Arduino + # framework to pre-init the BT controller at startup, which + # conflicts with USB. NimBLEDevice::init() handles its own init. "CONFIG_BTDM_CTRL_MODE_BLE_ONLY": 1, "CONFIG_BT_NIMBLE_MAX_CONNECTIONS": 1, "CONFIG_BT_NIMBLE_TASK_STACK_SIZE": 6144, diff --git a/src/main.cpp b/src/main.cpp index 0832ada..4aee710 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -346,10 +346,9 @@ void setup() { switch_driver.set_mux(&mux); switch_driver.begin(); - // BLE disabled for crash diagnosis - // Serial.println("[INIT] Initializing BLE MIDI..."); - // delay(1000); - // ble_midi_transport.begin(); + Serial.println("[INIT] Initializing BLE MIDI..."); + delay(1000); + ble_midi_transport.begin(); Serial.println("[INIT] Initializing USB MIDI..."); midi_transport.begin();