aboutsummaryrefslogtreecommitdiff
path: root/ports/esp32/mphalport.h
diff options
context:
space:
mode:
authorJim Mussared2020-08-19 10:46:09 +1000
committerDamien George2020-09-08 12:53:24 +1000
commit311b8519af75be9fe4215b5ee8f77e91d089d5df (patch)
tree7ef1b06fda38732fe049d5a879220a6c2df34bfb /ports/esp32/mphalport.h
parent99a29ec705b463290d5a2ac1eabc46fb7f2a83b0 (diff)
esp32: Pin MicroPython and NimBLE tasks to core 0.
MicroPython and NimBLE must be on the same core, for synchronisation of the BLE ringbuf and the MicroPython scheduler. However, in the current IDF versions (3.3 and 4.0) there are issues (see e.g. #5489) with running NimBLE on core 1. This change - pinning both tasks to core 0 - makes it possible to reliably run the BLE multitests on esp32 boards.
Diffstat (limited to 'ports/esp32/mphalport.h')
-rw-r--r--ports/esp32/mphalport.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/ports/esp32/mphalport.h b/ports/esp32/mphalport.h
index 1f78d820a..60cc308d6 100644
--- a/ports/esp32/mphalport.h
+++ b/ports/esp32/mphalport.h
@@ -35,8 +35,11 @@
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
-// The core that the MicroPython task(s) are pinned to
-#define MP_TASK_COREID (1)
+// The core that the MicroPython task(s) are pinned to.
+// Until we move to IDF 4.2+, we need NimBLE on core 0, and for synchronisation
+// with the ringbuffer and scheduler MP needs to be on the same core.
+// See https://github.com/micropython/micropython/issues/5489
+#define MP_TASK_COREID (0)
extern TaskHandle_t mp_main_task_handle;