ESP32S3 TinyML with tensorflow and wifi crashing

antonskoumoller
Posts: 2
Joined: Thu Jul 25, 2024 9:22 am

ESP32S3 TinyML with tensorflow and wifi crashing

Postby antonskoumoller » Thu Jul 25, 2024 9:35 am

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!

ESP_Sprite
Posts: 9545
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32S3 TinyML with tensorflow and wifi crashing

Postby ESP_Sprite » Fri Jul 26, 2024 1:54 am

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.

lbernstone
Posts: 777
Joined: Mon Jul 22, 2019 3:20 pm

Re: ESP32S3 TinyML with tensorflow and wifi crashing

Postby lbernstone » Fri Jul 26, 2024 2:10 am

antonskoumoller wrote:
Thu Jul 25, 2024 9:35 am
I tried increasing stack size
How? Changing ARDUINO_LOOP_STACK_SIZE

antonskoumoller
Posts: 2
Joined: Thu Jul 25, 2024 9:22 am

Re: ESP32S3 TinyML with tensorflow and wifi crashing

Postby antonskoumoller » Fri Aug 02, 2024 8:42 am

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!

Who is online

Users browsing this forum: No registered users and 31 guests