Page 1 of 1

ESP32S3 TinyML with tensorflow and wifi crashing

Posted: Thu Jul 25, 2024 9:35 am
by antonskoumoller
Hi! I working on a project using a custom ESP32S3 chip and I am experiencing issues when I have both a tensorflow model and Wifi running at the same time. I can have them running seperately but when running together I get

Code: Select all

Guru Meditation Error: Core  1 panic'ed (Unhandled debug exception). Debug exception reason: Stack canary watchpoint triggered (loopTask)
I am not very experienced so I am primarily using chatGPT to help be debug but it's suggestions are not getting me any further.

I tried increasing stack size but using anything other than the original loop() task gives me

Code: Select all

Guru Meditation Error: Core  0 panic'ed (LoadProhibited). Exception was unhandled.
ESP.getFreeHeap(), ESP.getMinFreeHeap(), ESP.getMaxAllocHeap() values looks fine with both individually so I don't understand why everything breaks when I have both running. When I have the wifi initialization first in the setup() it even crashes during the initialization of that before it touches the tensorflow part..

Any suggestions or help is highly appreciated!

Re: ESP32S3 TinyML with tensorflow and wifi crashing

Posted: Fri Jul 26, 2024 1:54 am
by ESP_Sprite
You need to also add the information after that (and possibly decode the backtrace) to find out what task caused the issue, then specifically increase the stack allocated to that task. Also note that this is not a heap problem, so you won't find anything looking there.

Re: ESP32S3 TinyML with tensorflow and wifi crashing

Posted: Fri Jul 26, 2024 2:10 am
by lbernstone
antonskoumoller wrote:
Thu Jul 25, 2024 9:35 am
I tried increasing stack size
How? Changing ARDUINO_LOOP_STACK_SIZE

Re: ESP32S3 TinyML with tensorflow and wifi crashing

Posted: Fri Aug 02, 2024 8:42 am
by antonskoumoller
I tried allocating extra stack size for a certain task but the solution was to just increase it with

Code: Select all

SET_LOOP_TASK_STACK_SIZE(16 * 1024);
Thanks for the responses!