This project applies knowledge from the embedded programming part of the course and provides hands-on experience with RTOS concepts such as:
- Tasks
- Timers
- Queues
- Semaphores
The project is implemented using FreeRTOS on the target emulation board provided via Eclipse CDT Embedded. The key components include:
-
Tasks:
- Three sender tasks: Two with the same priority and one with a higher priority.
- One receiver task.
-
Timers:
- Each sender task has an associated timer.
- The receiver task has its own timer.
-
Queues:
-
Semaphores:
- Semaphores are used to synchronize the timers and tasks.
- Sender Tasks: Sleep for a random period (
Tsender
), then send a message to the queue. If the queue is full, a counter for blocked messages is incremented. - Receiver Task: Sleeps for a fixed period (
Treceiver
), then checks the queue for messages, processes one message if available, and increments a counter for received messages.
- Sender Timer Callback: Unblocks the corresponding sender task by releasing its semaphore.
- Receiver Timer Callback: Unblocks the receiver task by releasing its semaphore and periodically resets the system state every 1000 messages.
This function performs the following:
- Prints statistics of sent and blocked messages.
- Resets the counters for messages.
- Clears the queue.
- Updates the
Tsender
period to new values from predefined arrays. - Destroys timers and stops execution when all values are used.
- The project collects and plots the number of sent, received, and blocked messages as functions of the average sender timer period.
- Comparisons are made with different queue sizes (3 and 10).
The project documentation includes:
- System Design: Illustrates the overall flow of the program, task communication, and synchronization.
- Results: Contains graphs and interpretation of the data collected during the execution.
- References: Lists any references used.