Skip to content

juhokup/Software_Development_for_Embedded_Systems

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Software Development for Embedded Systems

Traffic Light Controller – nRF5340 (RTOS)

Category Details
Platform nRF5340 Audio DK
Language C

Project Overview

This school project was a part of my third year Information Technology studies implements a traffic light control system on the nRF5340 Audio DK development board using C and an RTOS. The system simulates real-world traffic lights and demonstrates:

  • Task-based embedded design
  • Real-time scheduling
  • Hardware input handling
  • UART communication
  • Performance measurement
  • Automated testing

Objectives

The goal of the project was to practice:

  • Designing concurrent embedded software
  • Using an RTOS to control multiple tasks
  • Interfacing with hardware inputs (push buttons)
  • Implementing serial communication (UART)
  • Measuring task execution time
  • Writing automated tests

Main Components

Component Description
Traffic Light tasks Control red, yellow, and green light states
Input Control Handles pushbutton inputs (initial control method)
UART Control Allows external control via serial communication
Scheduler (RTOS) Manages task timing and execution
Timing for debug reasons Measures how long tasks take to run

System Evolution

The project was developed in stages, and weekly progress was documented in separate branches.

1️. Basic RTOS Traffic Lights

  • Each traffic light controlled by a separate RTOS task
  • Fixed timing cycle (Red → Green → Yellow)

2️. Pushbutton Control

  • Board pushbuttons used to:
    • Change light states
    • Trigger events
  • Introduced event-based task interaction

3️. UART Control Added

  • Serial interface implemented
  • Traffic lights could be controlled from a PC terminal
  • Enabled more complex task interactions

4️. Additional Tasks

  • New tasks like user set lights sequence introduced to extend system functionality

5. Unit and system testing

  • Google tests and Robot Framework testing were made to validate functionality

Debugging & Performance Measurement

Task execution timing was measured to analyze real-time behavior. Method used:

  • Timestamps captured before and after task execution
  • Execution duration calculated
  • Used for:
    • Debugging
    • Performance validation

Testing

Google Test (Unit Tests)

Used to test:

  • Traffic light state logic
  • Utility/helper functions

Robot Framework Tests

Used for higher-level testing such as:

  • System behavior validation
  • Command handling through UART

Learning Outcomes

Through this project, the following skills were developed:

  • RTOS-based system design
  • Multitasking in embedded systems
  • Serial communication
  • Performance measurement
  • Writing automated tests

About

Software Development for Embedded Systems (course homework)

Topics

Resources

Stars

Watchers

Forks