Hm.. thanks @felmue but I doubt that it is the library. Both LED library examples work fine.
Also
void microPhoneInit()
{
InitI2SSpakerOrMic(MODE_MIC);
// <------------
xTaskCreatePinnedToCore(i2sMicroFFTtask, "microPhoneTask", 4096, NULL, 3, NULL, 0);
// <-----------
}
The crashes stop when I exclude this line. Also the LEDs work fine then.
The mic/fft also does not show any minimal sign of signal, also within the 5 seconds before reboot. Maybe the Mic of the Bottom2 is broken? Is there a simple way to check if it is alive?
-- Edit: I updated all libraries. After bit more testing, the line seems to be pretty robust when it comes to the crash. But I also tried to adapt this M5Stick microphone example (M5Core2.h instead of M5Stick.h, the pins ought to be the same) but without success and it leads to a similar line xTaskCreate(mic_record_task, "mic_record_task", 2048, NULL, 1, NULL);
Btw. my Core2s are not flashed to have a lot of memory and maybe the queues are reaching the heap (as f.i. mentioned here). I used uxHighWaterMark = uxTaskGetStackHighWaterMark( NULL );
and I get number of 6100.
---Edit2: I tried this recording example, which is not parallelized by xTaskCreate, and it does not crash. Unfortunately I don't see any results after pressing 'record', it only starts to vibrate after 1-2 sec. and my other Core2 also makes a slight click&rumble sound. Shall I use VSCode+PlatformIO to debug?
--Edit3: I tried to patch tha partition / psram via this guide, I am not totally sure if it worked. And the record.ino. It doesn't crash, but the mic also only does the click/rumble after pressing record for 1.5s as before. Very strange..