Bird
0
0

You need to implement communication between two FreeRTOS tasks, Task1 and Task2, where Task1 sends data and Task2 receives it. Which design best demonstrates tasks as building blocks in this scenario?

hard📝 Application Q8 of 15
FreeRTOS - Task Creation and Management
You need to implement communication between two FreeRTOS tasks, Task1 and Task2, where Task1 sends data and Task2 receives it. Which design best demonstrates tasks as building blocks in this scenario?
ACombine both tasks into one function to avoid context switching
BUse a queue to send data from Task1 to Task2, with each task handling its own processing
CUse global variables without synchronization for data sharing
DMake Task2 call Task1 directly to get data
Step-by-Step Solution
Solution:
  1. Step 1: Understand task communication

    Queues are the recommended method for safe data exchange between tasks.
  2. Step 2: Evaluate other options

    Combining tasks loses multitasking benefits; global variables without sync cause race conditions; direct calls break task independence.
  3. Final Answer:

    Use a queue to send data from Task1 to Task2, with each task handling its own processing -> Option B
  4. Quick Check:

    Queues enable safe inter-task communication [OK]
Quick Trick: Use queues for safe task-to-task data transfer [OK]
Common Mistakes:
  • Using shared variables without synchronization
  • Merging tasks to avoid complexity
  • Calling one task function from another directly

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More FreeRTOS Quizzes