In the sample code below, if you swap lines 20 and 21, it works or doesn't work properly.
#include <M5StickC.h>
#include <esp_task.h>
void multitask_imu(void* arg) {
static int16_t x,y,z;
while (1) {
M5.IMU.getAccelAdc(&x,&y,&z);
Serial.printf ("%d,%d,%d\n", x, y, z);
}
}
void setup() {
M5.begin();
M5.IMU.Init();
Serial.begin(115200);
disableCore0WDT();
disableCore1WDT();
xTaskCreatePinnedToCore(multitask_imu, "Task0", 512*4, NULL, ESP_TASK_PRIO_MAX, NULL, 0);
// xTaskCreatePinnedToCore(multitask_imu, "Task0", 512*4, NULL, ESP_TASK_PRIO_MAX, NULL, 1);
delay(1000);
}
void loop() {
delay(10000);
}