aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Mussared2019-10-14 23:40:04 +1100
committerDamien George2019-10-15 17:22:15 +1100
commit4b2b05718a5b07a4cdf678fbe1005162b1e043ca (patch)
treef370a556374c85435b45a2df7b2bb187e2080b54
parent423e67d0a000bb2379f0c2f2a93989bfa17157e0 (diff)
esp32: Run NimBLE on the app core.
This prevents issues with concurrent access to the ringbuf. MICROPY_BEGIN_ATOMIC_SECTION is only atomic to the same core. We could address this with a mutex, but it's also not safe to call mp_sched_schedule across cores.
-rw-r--r--ports/esp32/boards/sdkconfig.ble7
1 files changed, 7 insertions, 0 deletions
diff --git a/ports/esp32/boards/sdkconfig.ble b/ports/esp32/boards/sdkconfig.ble
index 2c7c97b61..15422903c 100644
--- a/ports/esp32/boards/sdkconfig.ble
+++ b/ports/esp32/boards/sdkconfig.ble
@@ -3,5 +3,12 @@ CONFIG_BT_ENABLED=y
CONFIG_BTDM_CTRL_MODE_BLE_ONLY=y
CONFIG_BTDM_CTRL_MODE_BR_EDR_ONLY=
CONFIG_BTDM_CTRL_MODE_BTDM=
+
CONFIG_BT_NIMBLE_ENABLED=y
+
CONFIG_BT_NIMBLE_MAX_CONNECTIONS=4
+
+# Pin to the same core as MP.
+CONFIG_BT_NIMBLE_PINNED_TO_CORE_0=n
+CONFIG_BT_NIMBLE_PINNED_TO_CORE_1=y
+CONFIG_BT_NIMBLE_PINNED_TO_CORE=1