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?✗ Incorrect
xTaskCreate() returns pdPASS to indicate success.
Which parameter of
xTaskCreate() specifies the task's priority?✗ Incorrect
The task priority parameter sets the priority level of the created task.
Is it safe to call
xTaskCreate() inside an interrupt service routine (ISR)?✗ Incorrect
xTaskCreate() must be called from a task context, not from an ISR.
What happens if the stack size given to
xTaskCreate() is too small?✗ Incorrect
A too small stack can cause crashes or unpredictable behavior due to stack overflow.
Which of these is NOT a parameter of
xTaskCreate()?✗ Incorrect
xTaskCreate() does not take a task timeout parameter.
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.