Create task in task #5
Replies: 1 comment
-
Make sure that you are passing the taskHandle correctly, following the instructions in task.h. Also, depending on the total size of the Heap that you have, you may need to adjust the Stack size for each task to fit in. Trying to do something complex (like task in task creation), means that you need to understand and manage memory usage clearly. Using heap_3.c the malloc() function is not the best and most deterministic method for doing this. I've used malloc() only because it works automatically across all of the different Arduino hardware types, without special configuration. I don't recommend it otherwise. To best manage your memory usage, it is best to use heap_1.c, or heap_2,c, which assigns heap from within a global array, which you define depending on the actual RAM size of your hardware. See configTOTAL_HEAP_SIZE here. When using either of these heap mechanisms, freeRTOS offers functions to track heap usage, and you can then see how much is free at any point in your program, simply by printing the free heap value on your serial port. |
Beta Was this translation helpful? Give feedback.
-
I'm trying create on task in task is currently running but overflow heap error. what can i do do to fix it.
P/s: if i create both 2 task in setup it ok.
Beta Was this translation helpful? Give feedback.
All reactions