0
0
FreeRTOSprogramming~5 mins

xTaskCreate() function in FreeRTOS - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the purpose of the xTaskCreate() function in FreeRTOS?
The xTaskCreate() function is used to create a new task and add it to the list of tasks that are ready to run in FreeRTOS.
Click to reveal answer
beginner
What are the main parameters of xTaskCreate()?
The main parameters are: the task function pointer, a name for the task, stack size in words, a pointer to parameters passed to the task, task priority, and a handle to the created task.
Click to reveal answer
beginner
What does the return value of xTaskCreate() indicate?
It returns pdPASS if the task was created successfully, or errCOULD_NOT_ALLOCATE_REQUIRED_MEMORY if the task creation failed (usually due to insufficient memory).
Click to reveal answer
intermediate
Why is the stack size parameter important in xTaskCreate()?
The stack size defines how much memory the task has for its local variables and function calls. Too small a stack can cause crashes, too large wastes memory.
Click to reveal answer
intermediate
Can xTaskCreate() be called from an interrupt service routine (ISR)?
No, xTaskCreate() must be called from a task context, not from an ISR. For creating tasks from ISRs, other mechanisms are needed.
Click to reveal answer
What does xTaskCreate() return when a task is created successfully?
ApdPASS
BpdFAIL
CNULL
D0
Which parameter of xTaskCreate() specifies the task's priority?
ATask function pointer
BTask priority
CStack size
DTask name
Is it safe to call xTaskCreate() inside an interrupt service routine (ISR)?
AOnly if interrupts are disabled
BYes, always
CNo, never
DOnly for low priority tasks
What happens if the stack size given to xTaskCreate() is too small?
ATask runs faster
BTask priority increases
CTask uses less CPU
DTask may crash or behave unpredictably
Which of these is NOT a parameter of xTaskCreate()?
ATask timeout
BTask name
CTask function pointer
DTask handle pointer
Explain how to use xTaskCreate() to create a new task in FreeRTOS.
Think about what each parameter means and what the function returns.
You got /7 concepts.
    Describe why choosing the correct stack size is important when creating a task with xTaskCreate().
    Consider what happens if the stack is too small or too big.
    You got /5 concepts.