0
0
FreeRTOSprogramming~10 mins

Stack size allocation in FreeRTOS - Interactive Code Practice

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

Complete the code to define a task stack size of 256 words.

FreeRTOS
const uint16_t taskStackSize = [1];
Drag options to blanks, or click blank then click option'
A256
B1024
C128
D512
Attempts:
3 left
💡 Hint
Common Mistakes
Using bytes instead of words for stack size
Choosing a stack size too small for the task
2fill in blank
medium

Complete the code to create a task with the stack size defined by taskStackSize.

FreeRTOS
xTaskCreate(TaskFunction, "TaskName", [1], NULL, tskIDLE_PRIORITY, NULL);
Drag options to blanks, or click blank then click option'
A128
BtaskStackSize
C512
D1024
Attempts:
3 left
💡 Hint
Common Mistakes
Hardcoding the stack size instead of using the variable
Passing stack size in bytes instead of words
3fill in blank
hard

Fix the error in the stack size definition to use the correct FreeRTOS type.

FreeRTOS
StackType_t [1][256];
Drag options to blanks, or click blank then click option'
AStackBuffer
BStackSize
CTaskHandle
DtaskStack
Attempts:
3 left
💡 Hint
Common Mistakes
Using type names as variable names
Using unclear or reserved names
4fill in blank
hard

Fill both blanks to declare and initialize a static task stack.

FreeRTOS
static [1] [2][configMINIMAL_STACK_SIZE];
Drag options to blanks, or click blank then click option'
AStackType_t
BTaskHandle_t
CtaskStack
DtaskControlBlock
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong types for stack array
Confusing stack with task handle
5fill in blank
hard

Fill all three blanks to create a task with static allocation using stack and control block.

FreeRTOS
xTaskCreateStatic(TaskFunction, "Task", [1], NULL, tskIDLE_PRIORITY, [2], [3]);
Drag options to blanks, or click blank then click option'
AconfigMINIMAL_STACK_SIZE
BtaskStack
CtaskControlBlock
DNULL
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up stack size and stack buffer
Passing NULL instead of control block