I'm working on an app that is returning -1 on xTaskCreate after I've previously created a few tasks. The heap indicates....
heap_caps_get_free_size(MALLOC_CAP_8BIT) = 1657700
heap_caps_get_free_size(MALLOC_CAP_32BIT) = 1703316
stack free of the calling (creating) task = 7980
When I call uxTaskGetNumberOfTasks, I get 14. There is nothing unusual about the call to xTaskCreate. If I move it up above the previous task create then it works and the next one that previously worked fails. I also commented out a call to another part of the app that creates a task and then it's fine. I'm wondering if there is a different memory that is used that wouldn't be reported in those two heap checks that would affect the ability to create a task.
I know this isn't specific to the ESP32. But I thought maybe there was something specific to the port to the ESP32 that might be a limitation.
John
Anyone hit a task limit?
Re: Anyone hit a task limit?
More info....
I just made a loop and was able to create 65 tasks before getting an error return from xTaskCreate. I had 4M of heap left (wrover board) and 5K of stack space on the creating task (i.e. main task). So now the question is... What do I need to look at to see if I'm about out of resources to create a task?
John A
I just made a loop and was able to create 65 tasks before getting an error return from xTaskCreate. I had 4M of heap left (wrover board) and 5K of stack space on the creating task (i.e. main task). So now the question is... What do I need to look at to see if I'm about out of resources to create a task?
John A
Re: Anyone hit a task limit?
https://esp-idf.readthedocs.io/en/lates ... l-ram.htmlExternal RAM cannot be used as task stack memory
Re: Anyone hit a task limit?
Well that explains it. Now I just need to figure out how to make sure I reserve memory for task creation.
Re: Anyone hit a task limit?
Awesome!
Re: Anyone hit a task limit?
Well, you can't just double it from 32768 to 65536. You get this....
E (1171) cpu_start: Could not reserve internal/DMA pool!
But 48000 did work.
E (1171) cpu_start: Could not reserve internal/DMA pool!
But 48000 did work.
Re: Anyone hit a task limit?
Is there a call that I can make to see how much internal ram is left available?
John A
edit: Found it.... heap_caps_get_free_size(MALLOC_CAP_INTERNAL)
John A
edit: Found it.... heap_caps_get_free_size(MALLOC_CAP_INTERNAL)
Who is online
Users browsing this forum: No registered users and 73 guests