Fix BLE crash: move all NimBLE calls to Core 0

Root cause: Arduino Core 3.x breaks cross-core NimBLE API calls.
Calling BLEMidiServer.controlChange() from loop() on Core 1 while
NimBLE host runs on Core 0 causes immediate crash.

Fix:
- Move ble_midi_transport.begin() to ble_init_task on Core 0
- All BLE MIDI sends use queue_cc() (cross-core safe flag setter)
- ble_midi_transport.update() processes queued sends on Core 0
- Pin NimBLE-Arduino to v1.4.3 (stable LTS for BLE MIDI)
- Keep CONFIG_BT_ENABLED out of sdkconfig.h (causes double-init)
This commit is contained in:
ash
2026-07-01 06:46:15 +00:00
parent 62d1e430d5
commit 762500e227
6 changed files with 43 additions and 15 deletions
+1
View File
@@ -9,6 +9,7 @@ lib_deps =
adafruit/Adafruit TinyUSB [email protected]
fastled/FastLED@^3.9.0
max22/ESP32-BLE-MIDI@^0.3.2
h2zero/NimBLE-Arduino@^1.4.3
build_unflags =
-DARDUINO_USB_MODE=1