← All projects

2025 · ECE 455 · Real-Time Systems · Team of 2

Real-Time Systems on FreeRTOS

Two projects on the STM32F4 Discovery board: a sensor-driven traffic-light controller built from FreeRTOS primitives, and a deadline-driven (EDF) scheduler implemented on top of FreeRTOS's priority mechanism.

STM32F4 Discovery board wired to a breadboard with a strip of green, amber and red LEDs representing traffic and lights
Project 1 hardware — the STM32F4 drives shift registers that light a lane of "cars" and the traffic signals.

Project 1 — Traffic Light System

A one-lane intersection simulated in hardware: a potentiometer sets the traffic density, LEDs driven through shift registers show cars advancing toward the light, and the signal timing adapts to the measured flow. The design decomposes cleanly into four FreeRTOS tasks — flow measurement (ADC), traffic generation, light control, and display — communicating over queues, with software timers sequencing the green/yellow/red phases. Heavier traffic shortens the red phase; light traffic lengthens it.

Project 2 — Deadline-Driven Scheduler

FreeRTOS schedules by fixed priority; this project adds true earliest-deadline-first scheduling on top. A highest-priority DDS task owns three linked lists (active, completed, overdue) and processes release/complete/overdue events from a request queue. It sorts released tasks by absolute deadline with an insertion algorithm, then manipulates FreeRTOS priorities so only the earliest-deadline task runs. A generator releases periodic task sets and a monitor reports list states, letting us validate the schedule against hand-drawn Gantt charts across three test benches — including a deliberately overloaded 100%-utilization case where deadline misses are expected and correctly detected.

Architecture diagram: task generator, user tasks and monitor task sending requests to the deadline-driven scheduler which manages active, completed and overdue lists
DDS architecture — auxiliary tasks communicate with the scheduler exclusively through a request queue.

Highlights

FreeRTOS STM32F4 C EDF scheduling Queues · Timers ADC · GPIO

Files & downloads

Source files were reconstructed from the code appendices of the two reports.