What's changed: Initial version
5.2Device drivers & firmware
Covers the role of device drivers, which abstract hardware register operations and interrupt handling, the bootloader, which brings up the system immediately after power-on, and the failsafe and rollback design needed for OTA (Over-The-Air) updates in the field.
Embedded software is tightly coupled to hardware, but if application-layer code keeps directly tracking individual register bit positions, maintainability suffers. The device driver is the layer that mediates this, and the bootloader is the foundation that carries the system from the moment of power-on to a state where the application can run. Furthermore, in recent years OTA updates, which update shipped devices over a network, have become common, and designing so that a failed update does not "brick" the device has become a critical practical concern.
5.2.1Device drivers (register operations / interrupt integration)
- A device driver is a software layer that directly manipulates the registers of specific hardware (a sensor, a communication IC, a timer, etc.) and exposes that hardware's device-specific procedures (initialization sequence, data send/receive procedure, etc.) to the application layer as a uniform interface (function calls). This improves portability and maintainability, since the application layer's calling convention need not change even if the underlying hardware changes.
- Many drivers work in coordination with interrupts. For example, a communication-IC driver typically writes to a register to start transmission upon a send request, detects transmission completion via an interrupt handler (ISR), and has the ISR notify the layer above of completion. In driver design, whether to "wait for completion via polling" or "receive notification via an interrupt" is a trade-off between CPU utilization and real-time responsiveness.
Continue reading — free sign-up
You're reading the free preview. Sign up free to read this section in full, plus every chapter (including 4+) and all questions.

