Independent learning for embedded-systems engineersHardware · Firmware · Software
TEA-107CORE EMBEDDED SYSTEMS TOPICFOUNDATION

Embedded software architecture

Structure software so that responsibilities, control flow, data ownership and failure containment remain understandable as the product grows and changes.

After this module, you should be able to:

  • Decompose software around stable responsibilities
  • Describe structure and runtime behaviour using complementary views
  • Control dependencies, state and shared resources
  • Connect architectural decisions to verification evidence
01 / PURPOSE

Architecture makes the difficult software decisions visible.

Embedded software architecture defines the major elements, their responsibilities, the rules by which they interact and the constraints that protect important system qualities. It sits between system allocation and detailed implementation.

A useful architecture explains more than a source tree. It shows where behaviour lives, which component owns each state and item of data, how events flow, what may block, how faults are contained and which elements depend on hardware.

RESPONSIBILITYWhat does each element own?Decisions, state, data, hardware resources and error handling
INTERACTIONHow does work flow?Calls, events, queues, interrupts, schedules and state transitions
CONSTRAINTWhat must remain true?Timing, safety, security, memory, testability and dependency rules
Architecture is not folder structure.Packages and files are implementation containers. The architecture must expose behavioural responsibilities, runtime interactions and the rules that prevent unwanted coupling.
02 / DECOMPOSITION

Separate policies from mechanisms and hardware detail.

AreaArchitectural decisionQuestions to answer
Application behaviourState machines, use-case controllers or event handlers.Who owns the operational state and validates transitions?
Domain logicAlgorithms and decisions independent of device drivers.Can core behaviour be tested without target hardware?
Hardware abstractionTyped interfaces above registers, buses and vendor libraries.Which hardware differences are hidden and which must remain visible?
ExecutionTasks, interrupts, priorities, queues and synchronisation.Where may code block, pre-empt or share a resource?
DataOwnership, lifetime, validity, persistence and configuration.Who may change the value, and how does a consumer know it is current?
Fault managementDetection, reporting, containment, safe response and recovery.Can failure in one element corrupt control elsewhere?
External interfacesProtocol adaptation, validation and version boundaries.Where is untrusted or malformed input converted into trusted internal data?

Common patterns—layers, pipelines, publish/subscribe, active objects, supervisors and hardware-abstraction layers—are useful only when their trade-offs match the system. Combining patterns deliberately is normal; allowing accidental dependencies is not.

03 / VIEWS

Use several views because no single diagram answers every question.

  1. Context and allocation. Show external interfaces and the system behaviours assigned to software.
  2. Static structure. Show components, responsibilities, provided interfaces and permitted dependencies.
  3. Runtime behaviour. Trace critical scenarios across interrupts, tasks, queues and state transitions.
  4. Data view. Define important data, ownership, units, validity, retention and concurrency controls.
  5. Deployment view. Map executables, boot stages and software elements to processors and memory regions.
  6. Safety and security view. Show trust boundaries, privilege, isolation, monitors and protection mechanisms.
  7. Decision records. Capture alternatives, rationale, assumptions and consequences for major choices.

Worked example: multi-channel thermal controller

Four channels share an MCU, but each channel must retain independent state, sensor validity and output limits.

Driver eventsChannel servicesControl algorithmsSafety supervisorOutput arbitrationDiagnostics

Drivers publish typed observations rather than changing application state directly. Each channel service owns its state machine. A separate supervisor compares commanded and measured behaviour, while one output arbiter is the only component permitted to energise heaters. This makes authority explicit and enables algorithms and state logic to run in host-based tests.

04 / EVIDENCE

Show that the implemented software preserves the architecture.

Architecture description

Complementary views, component responsibilities, interfaces, constraints and conventions.

Traceability

Allocation of system and software requirements, hazards and security controls to elements.

Interface definitions

Types, units, ownership, timing, errors, preconditions and postconditions.

Decision records

Alternatives, rationale, assumptions, quality-attribute impact and approval.

Conformance checks

Dependency rules, static analysis, code review and tests that detect architectural erosion.

Scenario evidence

Traces showing start-up, control, shutdown, update and fault behaviour across elements.

Common failure patterns

Global-state architecture

Any component can change shared data, so ownership and sequencing become unknowable.

Driver-led behaviour

Application decisions leak into hardware drivers and cannot be tested or changed independently.

Diagram without rules

Boxes look orderly, but nothing prevents forbidden calls, blocking or cross-layer access.

Architecture frozen too early

The description is not updated after learning from implementation, integration or risk analysis.

05 / REFERENCES

Further learning

KEY TAKEAWAY

Make ownership and dependency rules explicit.

A durable embedded software architecture shows who owns behaviour and data, how execution flows and which constraints protect timing, safety, security and testability.