Recall & Review
beginner
What is static allocation in FreeRTOS?
Static allocation means reserving memory at compile time. The memory for tasks, queues, or other objects is fixed and does not change during program execution.
Click to reveal answer
beginner
What is dynamic allocation in FreeRTOS?
Dynamic allocation means reserving memory at runtime using functions like pvPortMalloc. Memory can be allocated and freed as the program runs.
Click to reveal answer
intermediate
What does the configSUPPORT_STATIC_ALLOCATION setting control?
It controls whether FreeRTOS allows creating tasks and other objects using static allocation. If set to 1, static allocation is supported; if 0, only dynamic allocation is allowed.
Click to reveal answer
intermediate
Name one advantage of static allocation over dynamic allocation in FreeRTOS.
Static allocation avoids fragmentation and runtime memory failures because memory is fixed and known at compile time.
Click to reveal answer
intermediate
Why might dynamic allocation be risky in embedded systems?
Dynamic allocation can cause memory fragmentation and allocation failures during runtime, which may lead to system instability or crashes.
Click to reveal answer
What happens if configSUPPORT_STATIC_ALLOCATION is set to 0 in FreeRTOS?
✗ Incorrect
Setting configSUPPORT_STATIC_ALLOCATION to 0 disables static allocation, so only dynamic allocation can be used.
Which of the following is a benefit of static allocation?
✗ Incorrect
Static allocation fixes memory size at compile time, avoiding fragmentation during runtime.
In FreeRTOS, which function is commonly used for dynamic memory allocation?
✗ Incorrect
pvPortMalloc is the FreeRTOS wrapper for dynamic memory allocation.
What is a key difference between xTaskCreate and xTaskCreateStatic?
✗ Incorrect
xTaskCreate allocates memory dynamically, while xTaskCreateStatic requires the user to provide memory buffers.
Why is static allocation preferred in safety-critical embedded systems?
✗ Incorrect
Static allocation ensures memory is reserved ahead of time, preventing runtime allocation failures important for safety.
Explain the difference between static and dynamic allocation in FreeRTOS and when you might use each.
Think about memory timing and reliability.
You got /5 concepts.
Describe the role of configSUPPORT_STATIC_ALLOCATION in FreeRTOS configuration.
Focus on what the config option controls.
You got /4 concepts.