techielew
techielew
DIIDevHeads IoT Integration Server
Created by Sterling on 6/7/2024 in #middleware-and-os
Can anyone share techniques or best practices for memory management in uC/OS-III
This is from the uC/OS user's manual: "Stack space may be allocated dynamically using the C compiler's heap management function (i.e., malloc()... However, care must be taken with fragmentation. If creating and deleting tasks, the process of allocating memory might not be able to provide a stack for the task(s) because the heap will eventually become fragmented. For this reason, allocating stack space dynamically in an embedded system is typically allowed but, once allocated, stacks should not be deallocated. Said another way, it's fine to creae a task's stack from the heap as long as you don't free the stack space back to the heap." - https://www.analog.com/media/en/dsp-documentation/software-manuals/Micrium-uCOS-III-UsersManual.pdf, page 81 So, are you deallocating stack space?
4 replies