Skip to Content
Hands-On RTOS with Microcontrollers
book

Hands-On RTOS with Microcontrollers

by Brian Amos
May 2020
Intermediate to advanced
496 pages
13h 54m
English
Packt Publishing
Content preview from Hands-On RTOS with Microcontrollers

Task memory allocation

One of the parameters for xTaskCreate() defines the task's stack size. But where does the RAM being used for this stack come from? There are two options – dynamically allocated memory and statically allocated memory. 

Dynamic memory allocation is implemented with a heap. FreeRTOS ports contain several different options regarding how heaps are implemented. Chapter 15, FreeRTOS Memory Management, provides details on how to select an appropriate heap implementation for a given project. For now, it is sufficient to assume a heap is available.

Static allocation permanently reserves RAM for a variable for the life of the program. Let's see what each approach looks like.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On RTOS with Microcontrollers - Second Edition

Hands-On RTOS with Microcontrollers - Second Edition

Jim Yuill, Penn Linder

Publisher Resources

ISBN: 9781838826734Supplemental Content