Embedded systems are more narrowly focused and typically do not run a full fledged operating system as one would find on a desktop or laptop. Firmware is software that is permanently stored in memory and typically initializes hardware subsystems and the state of the system.

When designing a system make sure to create a architecture block diagram, followed by a hierarchical diagram, and finally a software layering view that scales the box representing each module by its complexity. Shared resources, as represented by boxes connected to more than one other box, is one of the key problems associated with embedded system design and development. Driver interfaces typically consist of functions named open, close, read, write, and ioctl, while higher level modules normally make use of init and test methods.

Note that a logging module may significantly impact the timing of a system, especially when in debugging mode. An interface to a logging module needs to be consistent, whether it is writing messages over a serial interface to a computer for debugging or simply blinking an LED in production. Alternatively, a debug packet may be sent over a network connection. Logs may be stored in an external RAM source only available when the system is stopped and the source is read using JTAG.

Watchdog

Safety-critical functions may require an external watchdog if the internal watchdog in the processor does not meet certain requirements. It is fairly unlikely that a modern internal watchdog will not be reliable enough. However an internal watchdog could theoretically be deactivated by software. It also does not handle the case of a system clock failing.

Questions

Clocking

Processors may have Phase Locked Loop-based (PLL) clock generators to generate high frequencies that may be used to drive a system clock.

Memory management

Banked memory or bank switching supports processors with less logical address space than physical memory or limited bus width. A latch is exposed through registers that allows the processor to switch which bank is active.

When logical memory is greater that physical memory the processor may make use of virtual memory, which may swap to disk when no physical memory is available. Tasks should be isolated so that they can use the same address space. A Memory Management Unit (MMU) does translation between logcial and physical addresses. Memory is divided into pages of words, where the MMU translates the page number, but not the word number.

If the MMU is mapped directly into the logical address bus of the processor, which prevents the MMU from getting remapped and lost, then the processor must implement supervisor and user states, where the user state does not have access to the MMU.

Resources

See also