An Introduction to Embedded Software Architecture and Design Class 3: Understanding Embedded Software Architectures December 3, 2014 Jacob Beningo, CSDP
Course Overview Introduction to Embedded Software Architecture Software Architecture using UML Understanding Embedded Software Architectures From Architecture to Implementation Software Architecture of a UAV and Review
Session Overview An Example Problem Embedded Software Architecture Importance of time Common patterns Boot-loader Architecture Design Peeling the onion Uml diagrams A few architecture tips
Embedded Software Architectures Embedded Systems Many different flavors Each industry has their own best practices Software architectures deal with three different domain types
Embedded Software Architectures Hard real-time systems Definitive deterministic response to an event Known that response is always within a give time Soft real-time systems Response to an event requires an average time Application systems Timing is not a consideration in the development of the system
Embedded Software Architectures Importance of Time System catastrophes Unexpected behavior How should the architecture handle time? Move time-dependent requirements into the hardware Use interrupts to ensure the hard real-time needs Scheduler can handle the soft real-time needs Everything else is de-coupled!
Embedded Software Architectures Common Embedded Software Patterns Polling Interrupt triggered (blocking) Interrupt triggered (non-blocking) Event driven RTOS Energy Aware
Boot-loader Architecture…. Remote firmware updates System requires periodic firmware updates in the field without the use of specialized hardware Must blink an led in this mode Seamless ability to switch between app and update mode System requires the ability to be updated via UART simulates radio connectivity
Boot-loader Architecture Design Requirements What does the system do? How does it interact with the user? the environment? Real-time Requirements The system “shall” ….. Precisely define what the system not how! Verifiable and testable
Boot-loader Architecture Design Create a high level system architecture
Boot-loader Architecture Design High level software architecture
Boot-loader Architecture Design Create a use case diagram
Boot-loader Architecture Design Create component diagram Component Lists Low level Driver components Inputs and Outputs Timers, PWM, etc Configuration components What needs configuring? Application components Sensor Interfaces Real-world interfaces Timer Digital I/O PWM ADC Sensor Filtering Motor
Boot-loader Architecture Design Boot-loader Component Diagram
Boot-loader Architecture Design Boot-loader Detailed Component Diagram
Boot-loader Architecture Design Statechart design
Boot-loader Architecture Design Sequence Diagram Time or sequence critical architecture
A few architecture tips Where to put different functionality Real-time requirements into hardware as much as possible Create layers and abstractions Highest layers should be portable and easily changed to meet application needs Architecture itself should not be easily changed or changed often
A few architecture tips Planning for change Expect requirements to change! Rarely are they set in stone Plan for diagnostics How are system states, errors, etc going to be logged? Critical to system debugging Plan for testing Testing framework?
Additional Resources Download Course Material for Edraw UML Templates Updated C Doxygen Templates Misc Papers and Websites for further reading From www.beningo.com under - Blog and Articles > Software Techniques > CEC Software Architecture Materials
Jacob Beningo Newsletters P.O. Box 400 Embedded Monthly Linden, Michigan 48451 www.beningo.com Newsletters Embedded Monthly Low Power Design http://eepurl.com/2xJFr Training Bootloaders Embedded Software C/C++ : jacob@beningo.com : 810-844-1522 : Jacob_Beningo : Beningo Engineering : JacobBeningo : Embedded Basics Jacob Beningo Principal Consultant