FreeRTOS Memory Management
So far, we’ve worked through many examples of creating FreeRTOS primitives, such as tasks, semaphores, queues, etc. However, when these primitives were initially created, there wasn’t much of an explanation as to where the memory was coming from. In this chapter, we’ll learn exactly where the memory comes from, along with when and how it is allocated. Choosing when and how memory is allocated allows us to make trade-offs between coding convenience, timing determinism, potential regulatory requirements, and code standards. We’ll conclude by looking at different measures that can be taken to ensure application robustness.
The chapter has three example-programs, and they are in the IDE-project Chapter_14
.
In a nutshell, this chapter covers the following:
- Understanding memory allocation
- Static and dynamic allocation of FreeRTOS primitives
- FreeRTOS heap implementations
- Replacing
malloc
andfree
...