Skip to content

Pin ESP32 to core 1 once again ftw #7258

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion ports/esp32/boards/sdkconfig.ble
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ CONFIG_BT_NIMBLE_ENABLED=y

CONFIG_BT_NIMBLE_MAX_CONNECTIONS=4

# Pin to the same core as MP.
# 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
Expand Down
11 changes: 8 additions & 3 deletions ports/esp32/mphalport.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,15 @@
#include "freertos/task.h"

// 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
// Now that we have IDF 4.2.0+, we are once again able to pin to core 1
// and avoid the Wifi/BLE timing problems on the same core.
// Best effort here to remain backwards compatible in rare version edge cases...
// See https://github.com/micropython/micropython/issues/5489 for history
#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 2, 0)
#define MP_TASK_COREID (1)
#else
#define MP_TASK_COREID (0)
#endif

extern TaskHandle_t mp_main_task_handle;

Expand Down