Budapest University of Technology and Economics, Faculty of Electrical Engineering and Informatics

    címtáras azonosítással

    vissza a tantárgylistához   nyomtatható verzió    

    Embedded Software Development

    A tantárgy neve magyarul / Name of the subject in Hungarian: Beágyazottszoftver-fejlesztés

    Last updated: 2023. október 22.

    Budapest University of Technology and Economics
    Faculty of Electrical Engineering and Informatics
    Course ID Semester Assessment Credit Tantárgyfélév
    VIMIAC17 5 2/2/0/v 5  
    3. Course coordinator and department Dr. Orosz György,
    Web page of the course
    4. Instructors

    Dr. György Orosz, associate professor, MIT

    Balázs Scherer, master lecturer, MIT

    Gábor Naszály, master lecturer, MIT
    5. Required knowledge C programming language, basics of digital technique
    6. Pre-requisites
    7. Objectives, learning outcomes and obtained knowledge

    The primary aim of the subject is to introduce the students to the topics of embedded software development.

    The following main topics are introduced:

    • Basics of C programming in embedded systems, properties of cross compilers, steps and requirements of compiling. Handling of memory-mapped peripherals and related standardization processes (e.g., CMSIS-Core)
    • Hardware abstraction layers from low-level hardware libraries, firmware libraries to board and application-level libraries. Coding rules: commenting, naming conventions, restriction of language usage (MISRA-C), standards and examples. Coding examples for DMA-based (Direct Memory Access) hardware handling, porting of LibC library.
    • Operating modes of an embedded software with special emphasis on diagnostic and energy saving modes.
    • Debugging process in embedded systems, tracing and debugging tools in modern embedded systems.
    • Software architectures like simple round-robin scheduling, function queues, embedded operating systems (OS). Basic problems and solutions of parallel programming are presented in theory and in practice through FreeRTOS examples: creating threads, using shared resources, synchronization of threads, stack usage, timing, scheduling and other OS features.
    8. Synopsis


    1. Basics of embedded C programming: Cross compiling, compiling of C code in embedded systems. Startup codes in a microcontroller, what happens before calling the main() function.

    2. Memory-mapped registers and peripherals: Traditional solutions with pointers. Advanced structure blocks for peripheral handling and standardization: introduction of CMSIS core and related standards for structure and coding conventions.

    3. Hardware abstraction layers - the microcontroller level abstraction: Purpose of microcontroller-level abstraction. Structure of modern firmware libraries. Intention for standardization, CMSIS driver, API, coding and naming conventions. Porting the standard C library onto and embedded hardware.

    4. Interrupt-based peripheral handling: Process of interrupt handling. Vector-based interrupt handler. Examples for interrupt handling in embedded systems.

    5. DMA-based (Direct Memory Access) peripheral handling. Basics of DMA process. Typical parameters of DMA. System design considerations for effective DMA process. Examples.

    6. Hardware abstraction layer (board-level abstraction): Necessity of board-level abstraction. Why abstraction layers are used in well-structured programs? Examples and standardization aims.

    7. Operating modes of an embedded software: The typical states and modes in an embedded software. Implementation and properties of most common modes: energy saving mode, fail stop, fail safe, fail reduced, calibration, diagnostic modes.

    8. Operating modes of an embedded software: Purpose of calibration and diagnostic modes: support of testing, real-time monitoring, configuration, logging of error events. Remote software update: bootloader. Introduction of an industrial diagnostic protocol: XCP (Universal Measurement and Calibration Protocol).

    9. Debugging and testing an embedded software: The debugging possibilities provided by modern microcontrollers. The connection between the microcontroller and development environment (IDE): debug hardware (e.g, CMSIS-DAP), GDB server, GDB RSP, GDB command line. Tracing capabilities: DWT, ITM and their integration into an IDE.

    10. Non-preemptive software architectures, introduction to RTOS (Real-time operating system): Round robin scheduling (basic and extended with interrupts), scheduling based on function queue. Basics of embedded operating systems through FreeRTOS: structure, operation, scheduling, modes of threads.

    11. Basics of parallel programing (shared resources and mutual exclusion): Problems of using shared resources. Theory and practice of solutions for problems, e.g., mutual exclusion.

    12. Basics of parallel programing (synchronization and communication between threads): Introduction of theory and practice of solutions for communication between threads. Role of semaphore and queue in the communication between different threads, and between threads and interrupts.

    13. Basics of parallel programing (typical problems): The typical problems of threads using the same memory segment and related solutions, stack problems. Scheduling problems and realization of scheduling. Thread properties: response time and execution time. Measurement of execution time, and calculation of response time.

    Demonstrations and exercises related to the lectures:

    1.Introduction to an integrated development environment (IDE) and development board: Creation of sample projects. Investigation of stages of compiling and startup process.

    2. Programming of a simple peripheral: GPIO programming: Programming of a simple peripheral with memory pointers and CMSIS-Core structures.

    3. Programming of a simple peripheral using firmware library: Peripheral programming using Firmware library, examples: GPIO and UART. Porting LibC for using printf() with UART.

    4. Handling of a peripheral using interrupts: Implementation of an interrupt routine for a peripheral. Practical examples for interrupt handing.

    5. Handling of a peripheral using DMA: Programming of the DMA controller for a memory-peripheral transaction. Comparing of DMA and interrupt-based operation.

    6. Board-level abstraction layer: Interfacing an external sensor (e.g., I2C temperature sensor). Creating API for the sensor, and choosing between DMA, interrupt, or polling-based handling.

    7. Testing energy saving modes: Checking mode-dependent energy consumption. Which parts of the processor remain awake in different modes? Writing simple codes for waking up a microcontroller from energy saving mode with push-button or timer.

    8. Diagnostic modes: Porting an existing protocol (XCP), and creating a simple command line interface (CLI).

    9. Debugging: Introduction to traditional debug possibilities. How debug commands are sent from the IDE to the microcontroller. Watch, live watch functionalities, tracing of interrupts, how trace console is integrated into IDE.

    10. Embedded operating systems (OS): Starting FreeRTOS on demo board. Creating a simple demo program with 1-2 threads.

    11. Mutual exclusion:  Demonstration of problems of using shared resources. Application of different solutions for solving problems of shared resources: examples for mutexes.

    12. Communication and synchronization between threads:  Tools for synchronization and communication between different threads and between threads and interrupts. Transmission of events and messages using semaphores and queues.

    13. Demonstrating and solving problems of an embedded OS: Stack-overflow problem and stack protection. Tracking the timing and scheduling by instrumenting the kernel.

    9. Method of instruction Lectures extended with demonstrations and exercises.
    10. Assessment Midterm exam and homework.
    Written exam.
    11. Recaps

    Mid-term exam can be once repeated during teaching period.

    Late homework submission: until the end of repeat period with applicable fees according to Code of Studies and Exams. Homework cannot be submitted during exam period.
    12. Consultations On demand, upon agreement with the lecturer in advance.
    13. References, textbooks and resources On the homepage of the subject.
    14. Required learning hours and assignment
    Kontakt óra56
    Félévközi készülés órákra10
    Felkészülés zárthelyire8
    Házi feladat elkészítése36
    Kijelölt írásos tananyag elsajátítása8
    15. Syllabus prepared by

    Dr. Orosz György, associate professor, MIT

    Scherer Balázs, master lecturer, MIT

    Naszály Gábor, master lecturer, MIT

    Dr. Kovácsházy Tamás, associate professor, MIT