0
0
FreeRTOSprogramming~20 mins

FreeRTOS architecture overview - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
FreeRTOS Architecture Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Core components of FreeRTOS

Which of the following is NOT a core component of the FreeRTOS architecture?

AMemory management unit (MMU)
BTask scheduler
CQueues for inter-task communication
DSoftware timers
Attempts:
2 left
💡 Hint

Think about what FreeRTOS provides for multitasking and communication, and what hardware features it does not include.

Predict Output
intermediate
2:00remaining
FreeRTOS task states output

Given the following FreeRTOS task state code snippet, what will be the output?

FreeRTOS
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");
}
AUnknown state
BTask is ready
CTask is blocked
DTask is running
Attempts:
2 left
💡 Hint

Look at the value assigned to state and which case it matches.

🔧 Debug
advanced
2:00remaining
Diagnosing priority inversion in FreeRTOS

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?

APriority inversion
BDeadlock
CStarvation
DRace condition
Attempts:
2 left
💡 Hint

Think about what happens when a higher priority task waits for a resource held by a lower priority task.

📝 Syntax
advanced
2:00remaining
Correct FreeRTOS task creation syntax

Which of the following code snippets correctly creates a FreeRTOS task?

AxTaskCreate(TaskFunction, Task1, 1000, NULL, 2, NULL);
BxTaskCreate(TaskFunction, "Task1", 1000, NULL, 2, NULL);
CxTaskCreate(TaskFunction, "Task1", 1000, NULL, "2", NULL);
DxTaskCreate(TaskFunction, "Task1", 1000, NULL);
Attempts:
2 left
💡 Hint

Check the function parameters and their types carefully.

🚀 Application
expert
2:00remaining
Determining FreeRTOS queue length after operations

A FreeRTOS queue is created with length 3. The following operations occur in order:

  1. Send one item to the queue
  2. Receive one item from the queue
  3. Send two items to the queue
  4. Receive one item from the queue

How many items remain in the queue after these operations?

A3
B2
C1
D0
Attempts:
2 left
💡 Hint

Track the queue count step-by-step after each send and receive.