diff --git a/ports/esp32/main.c b/ports/esp32/main.c
index d4f79646f6c8932ad5d973d2308b10a04dcc753b..c8dde337c5d95469bd3bb6794eb278aefa04be30 100644
--- a/ports/esp32/main.c
+++ b/ports/esp32/main.c
@@ -151,7 +151,7 @@ soft_reset:
 
 void app_main(void) {
     nvs_flash_init();
-    xTaskCreate(mp_task, "mp_task", MP_TASK_STACK_LEN, NULL, MP_TASK_PRIORITY, &mp_main_task_handle);
+    xTaskCreatePinnedToCore(mp_task, "mp_task", MP_TASK_STACK_LEN, NULL, MP_TASK_PRIORITY, &mp_main_task_handle, MP_TASK_COREID);
 }
 
 void nlr_jump_fail(void *val) {
diff --git a/ports/esp32/mphalport.h b/ports/esp32/mphalport.h
index ff39b7aa1cbcc7fd68d44451b162ebc1aa1e8832..575cdbe720d80e863e0115446a32ab3c4ab494de 100644
--- a/ports/esp32/mphalport.h
+++ b/ports/esp32/mphalport.h
@@ -35,6 +35,9 @@
 #include "freertos/FreeRTOS.h"
 #include "freertos/task.h"
 
+// The core that the MicroPython task(s) are pinned to
+#define MP_TASK_COREID (1)
+
 extern TaskHandle_t mp_main_task_handle;
 
 extern ringbuf_t stdin_ringbuf;
diff --git a/ports/esp32/mpthreadport.c b/ports/esp32/mpthreadport.c
index 6c4ed9b5e357d312b565274ecede6fa9b372b675..9557d4071454a692b6a2b23ac7a3a5e134558a78 100644
--- a/ports/esp32/mpthreadport.c
+++ b/ports/esp32/mpthreadport.c
@@ -27,10 +27,9 @@
 
 #include "stdio.h"
 
-#include "py/mpconfig.h"
-#include "py/mpstate.h"
 #include "py/gc.h"
 #include "py/mpthread.h"
+#include "py/mphal.h"
 #include "mpthreadport.h"
 
 #include "esp_task.h"
@@ -130,7 +129,7 @@ void mp_thread_create_ex(void *(*entry)(void*), void *arg, size_t *stack_size, i
     mp_thread_mutex_lock(&thread_mutex, 1);
 
     // create thread
-    BaseType_t result = xTaskCreate(freertos_entry, name, *stack_size / sizeof(StackType_t), arg, priority, &th->id);
+    BaseType_t result = xTaskCreatePinnedToCore(freertos_entry, name, *stack_size / sizeof(StackType_t), arg, priority, &th->id, MP_TASK_COREID);
     if (result != pdPASS) {
         mp_thread_mutex_unlock(&thread_mutex);
         nlr_raise(mp_obj_new_exception_msg(&mp_type_OSError, "can't create thread"));
diff --git a/ports/esp32/network_ppp.c b/ports/esp32/network_ppp.c
index 80654091580415347d856db088d2103b9030f63d..aca4bbc1e9b5197d7d8dde1c9930538e2b9ad358 100644
--- a/ports/esp32/network_ppp.c
+++ b/ports/esp32/network_ppp.c
@@ -133,7 +133,7 @@ STATIC mp_obj_t ppp_active(size_t n_args, const mp_obj_t *args) {
             ppp_set_usepeerdns(self->pcb, 1);
             pppapi_connect(self->pcb, 0);
 
-            xTaskCreate(pppos_client_task, "ppp", 2048, self, 1, (TaskHandle_t*)&self->client_task_handle);
+            xTaskCreatePinnedToCore(pppos_client_task, "ppp", 2048, self, 1, (TaskHandle_t*)&self->client_task_handle, MP_TASK_COREID);
             self->active = true;
         } else {
             if (!self->active) {