0
0
FreeRTOSprogramming~30 mins

FreeRTOS architecture overview - Mini Project: Build & Apply

Choose your learning style9 modes available
FreeRTOS Architecture Overview
📖 Scenario: You are learning how FreeRTOS works inside an embedded system. Understanding its architecture helps you write better multitasking programs.
🎯 Goal: Build a simple FreeRTOS program that creates tasks and uses the basic architecture components like tasks, scheduler, and queues.
📋 What You'll Learn
Create task functions with exact names
Create task handles with exact names
Use FreeRTOS API functions with correct parameters
Print output to show task execution order
💡 Why This Matters
🌍 Real World
FreeRTOS is used in embedded devices like IoT gadgets, wearables, and industrial controllers to manage multiple tasks efficiently.
💼 Career
Understanding FreeRTOS architecture is essential for embedded software engineers working on real-time systems and multitasking applications.
Progress0 / 4 steps
1
Create two FreeRTOS tasks
Create two task functions called Task1 and Task2 that each take a void *pvParameters argument. Also, declare two task handles called Task1Handle and Task2Handle initialized to NULL.
FreeRTOS
Need a hint?

Define two functions with the exact names and parameters. Declare two task handles as TaskHandle_t variables set to NULL.

2
Create tasks in main and start scheduler
In the main function, create the two tasks using xTaskCreate with the exact names Task1 and Task2, stack size 100, priority 1, and store their handles in Task1Handle and Task2Handle. Then start the scheduler with vTaskStartScheduler().
FreeRTOS
Need a hint?

Use xTaskCreate to create each task with the exact parameters. Then call vTaskStartScheduler() to start running tasks.

3
Add task code to print messages
Inside the infinite loop of Task1 and Task2, add code to print "Task1 is running" and "Task2 is running" respectively using printf. Add a call to vTaskDelay(1000 / portTICK_PERIOD_MS) after each print to delay for 1 second.
FreeRTOS
Need a hint?

Use printf to show the task running message. Use vTaskDelay to pause the task for 1 second.

4
Run and observe task output
Run the program and observe the output. It should print alternating lines "Task1 is running" and "Task2 is running" every second.
FreeRTOS
Need a hint?

Run the program on your FreeRTOS environment or simulator. You should see the two messages printed repeatedly every second.