Which of the following is NOT a core component of the FreeRTOS architecture?
Think about what FreeRTOS provides for multitasking and communication, and what hardware features it does not include.
FreeRTOS includes a task scheduler, queues, and software timers as core components. The Memory Management Unit (MMU) is a hardware feature, not part of FreeRTOS architecture.
Given the following FreeRTOS task state code snippet, what will be the output?
eTaskState state = eRunning;
switch(state) {
case eRunning:
printf("Task is running\n");
break;
case eReady:
printf("Task is ready\n");
break;
case eBlocked:
printf("Task is blocked\n");
break;
default:
printf("Unknown state\n");
}Look at the value assigned to state and which case it matches.
The variable state is set to eRunning, so the output is "Task is running".
Consider a FreeRTOS system where a low priority task holds a mutex, and a high priority task is blocked waiting for it. What problem is this an example of?
Think about what happens when a higher priority task waits for a resource held by a lower priority task.
This is a classic example of priority inversion, where a high priority task is blocked by a lower priority task holding a resource.
Which of the following code snippets correctly creates a FreeRTOS task?
Check the function parameters and their types carefully.
Option B uses the correct syntax with a string task name, stack size, parameters, priority as integer, and task handle pointer.
A FreeRTOS queue is created with length 3. The following operations occur in order:
- Send one item to the queue
- Receive one item from the queue
- Send two items to the queue
- Receive one item from the queue
How many items remain in the queue after these operations?
Track the queue count step-by-step after each send and receive.
Step 1: queue has 1 item
Step 2: queue has 0 items
Step 3: queue has 2 items
Step 4: queue has 1 item remaining