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

Heap memory

The heap is the portion of memory that is used when a dynamic allocation using malloc is called. It is also where a FreeRTOS task stack and task control block (TCB) are stored when they are created by calling xTaskCreate().

In an MCU FreeRTOS system, there will typically be two heaps created:

  • System heap: Defined in the startup and linker scripts described previously. This will not be available for use by the final application code when allocating space for RTOS primitives.
  • FreeRTOS heap: Used when creating tasks and other primitives and defined in Inc\FreeRTOSConfig.h. It can be resized by adjusting the following line:
#define configTOTAL_HEAP_SIZE ((size_t)15360)

Currently, this line is defining a 15 KB heap. This heap must ...

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