A comprehensive collection of Real-Time Operating Systems (RTOS) laboratory assignments
From Ain Shams University's Computer and Systems Engineering Program
Progressive Learning • Hands‑On Experience • Educational Focus
This repository contains practical implementations of RTOS concepts using ARM Cortex-M4 microcontrollers (TM4C123GH6PM), progressing from basic manual task switching to advanced FreeRTOS implementations.
Caution
KEIL µVision FreeRTOSConfig.h Version Issue: KEIL5 may install FreeRTOSConfig.h version 2021 by default, which can cause problems and system hangs. It is strongly recommended to use the 2019 version of FreeRTOSConfig.h for stable operation.
Warning
Academic Integrity Notice: This repository is intended for educational purposes. Students should use it as a learning resource while adhering to their institution's academic integrity policies.
Note
Getting Started: Each lab builds upon previous concepts. It's recommended to complete labs in sequence for optimal learning progression.
This repository follows a structured approach to learning RTOS concepts, starting from fundamental task switching concepts and progressing to full RTOS implementation:
| Lab | Title | Focus Area |
|---|---|---|
| Lab01 | Manual Tasks Switch | Cooperative scheduling fundamentals |
| Lab02 | Creating Task Stacks | ARM context switching & stack management |
| Lab03 | Introduction to FreeRTOS | RTOS kernel basics & task creation |
| Lab04 | Multiple Tasks | Advanced multi-tasking & synchronization |
| Lab05 | Adding Multiple Tasks | Task management & scheduling techniques |
| Lab06 | Queues in FreeRTOS | Inter-task communication using queues |
| Lab07 | Semaphores in FreeRTOS | Task synchronization & resource management |
| Lab08 | Mutex in FreeRTOS | Mutual exclusion & priority inheritance |
Some labs may not have full documentation or updated instructions yet. If you encounter missing details, refer to the code and comments within each lab folder. Contributions to improve documentation are welcome!
Click to expand setup requirements
-
Development Environment:
- Install Keil µVision MDK-ARM or Code Composer Studio
- Download TM4C123 device support pack
- Install Windows drivers for TM4C123 LaunchPad
-
Hardware Setup:
- Connect LaunchPad via USB
- Verify device recognition in Device Manager
- Test with basic LED blink program
# 1. Clone the repository
git clone https://github.com/Spafic/ASU_RTOS_Tasks.git
cd ASU_RTOS_Tasks
# 2. Choose your lab (start with Lab01)
cd Lab01_Manual_Tasks_SwitchOpen .uvprojx → Build (F7) → Flash & Debug (Ctrl+F5) → Verify LED behavior
- Each lab is self-contained with its own project files
- Build artifacts are ignored by Git
- Follow coding standards from Lab01
- Refer to
docs/for detailed requirements
- IDE: Keil µVision MDK-ARM 5.37 or later
- Compiler: ARM Compiler 6 (ARMCLANG) for modern C99/C11 support
- Debugger: CMSIS-DAP Debug Unit with live variable monitoring
- Target Device: TM4C123GH6PM with 80MHz ARM Cortex-M4F core
- CPU Clock: 16 MHz default (can be increased to 80 MHz for advanced labs)
- Optimization: -O1 (balanced performance/debug) for learning
- Debug: Full debug information enabled for educational purposes
- Memory Model: Small model (default for TM4C123)
- FPU: Enabled for Labs 3+ (floating-point unit utilization)
- Analysis: Read lab requirements and understand objectives
- Design: Plan your implementation approach
- Implementation: Write code following established patterns
- Testing: Use debugger to verify functionality
- Documentation: Comment your code and understand the concepts
This course provides a structured path through embedded systems and RTOS concepts:
- Foundational Knowledge (Lab 1): Basic task switching and timing
- Low-Level Understanding (Lab 2): ARM architecture and stack management
- RTOS Introduction (Lab 3): Transition to real-time kernel usage
- Advanced Concepts (Lab 4+): Multi-tasking and synchronization
- Embedded Programming: C programming for microcontrollers
- Real-Time Systems: Understanding of timing constraints and deterministic behavior
- Debugging Techniques: Advanced use of IDE debugging tools
- System Architecture: Knowledge of ARM Cortex-M architecture
- RTOS Concepts: Task management, scheduling, and inter-task communication
- Missing Device Pack: Install TM4C123 support pack from Keil
- Compiler Errors: Ensure ARM Compiler 6 is selected
- Include Path Issues: Verify all header files are in project directory
- Board Not Detected: Check USB cable and Windows drivers
- Flash Programming Fails: Ensure no other debugger sessions are active
- LED Behavior Incorrect: Verify GPIO initialization and pin assignments
- System Hangs: Check heap size and stack overflow settings
- Tasks Don't Run: Verify scheduler is started with
vTaskStartScheduler() - Timing Issues: Confirm tick rate configuration matches expected behavior
- Use breakpoints strategically to understand program flow
- Monitor register values to verify hardware configuration
- Utilize memory windows to inspect stack and variable contents
- Enable serial output for runtime debugging information
Important
This repository is designed as a learning tool, not a solution bank:
- Study the concepts before looking at implementations
- Understand the code rather than copying it directly
- Follow your institution's academic integrity policies
- Use this as reference to verify your own implementations
- Feel free to fork and adapt for your own courses
- Contributions that improve educational value are welcome
- Please maintain the academic integrity guidelines
- Fork the repository and create a feature branch
- Maintain code quality and documentation standards
- Test thoroughly on actual hardware before submitting
- Submit pull requests with detailed descriptions of improvements
- TM4C123GH6PM Datasheet
- ARM Cortex-M4 Programming Manual
- FreeRTOS Documentation
- Keil µVision User Guide
- Real-Time Systems textbooks and course materials
- ARM Cortex-M architecture guides
- Embedded systems design principles
- RTOS fundamentals and best practices
This project is licensed under the MIT License - see the LICENSE file for details.
This permissive license allows for educational use, modification, and distribution while maintaining attribution to the original work.
- Course instructors and TAs at ASU Computer and Systems Engineering Department (Shahd-AbouHashem)
- ARM and Texas Instruments for comprehensive documentation and development tools
- FreeRTOS community for excellent RTOS implementation and educational resources
- Keil/ARM for providing industry-standard development tools
- Student contributors who have helped improve and test these implementations
Last Updated: August 2025 | Maintained by:
Spafic, Lucifer3224, ShahdAshraff