0
0
FreeRTOSprogramming~10 mins

Static vs dynamic allocation (configSUPPORT_STATIC_ALLOCATION) in FreeRTOS - Interactive Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to enable static allocation support in FreeRTOS.

FreeRTOS
#define configSUPPORT_STATIC_ALLOCATION [1]
Drag options to blanks, or click blank then click option'
A0
B-1
C2
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Using 0 disables static allocation.
Using 2 enables static-only mode (no dynamic allocation).
2fill in blank
medium

Complete the function prototype for creating a task with static allocation.

FreeRTOS
TaskHandle_t xTaskCreateStatic( TaskFunction_t pxTaskCode, const char * const pcName, const uint32_t ulStackDepth, void * const pvParameters, UBaseType_t uxPriority, StackType_t * const [1], StaticTask_t * const pxTaskBuffer );
Drag options to blanks, or click blank then click option'
ApvStack
BpxStack
CpuxStackBuffer
DpxStackPtr
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect parameter names causes compilation errors.
Confusing stack buffer with task buffer.
3fill in blank
hard

Fix the error in the following code snippet for static task creation.

FreeRTOS
StaticTask_t xTaskBuffer;
StackType_t xStackBuffer[[1]];
xTaskCreateStatic( vTaskCode, "Task", 128, NULL, 2, xStackBuffer, &xTaskBuffer );
Drag options to blanks, or click blank then click option'
A128
B32
C256
D64
Attempts:
3 left
💡 Hint
Common Mistakes
Using a smaller stack buffer than the stack depth causes runtime errors.
Using a larger buffer wastes memory but is safer.
4fill in blank
hard

Fill both blanks to define a static task and its stack correctly.

FreeRTOS
StaticTask_t [1];
StackType_t [2][256];
Drag options to blanks, or click blank then click option'
AmyTaskBuffer
BtaskStack
CxTaskBuffer
DxStackBuffer
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up the names causes confusion but not errors.
Using inconsistent names reduces code readability.
5fill in blank
hard

Fill all three blanks to create a static task with correct parameters.

FreeRTOS
TaskHandle_t [1] = xTaskCreateStatic( vTaskFunction, "StaticTask", [2], NULL, 1, [3], &xTaskBuffer );
Drag options to blanks, or click blank then click option'
AxHandle
B128
CxStackBuffer
DmyTask
E64
FpxStackBuffer
Attempts:
3 left
💡 Hint
Common Mistakes
Using mismatched stack sizes causes errors.
Incorrect variable names cause compilation failures.