Meaning
Non-volatile software programs stored on embedded chips execute low-level control of hardware peripherals and manage the device’s primary application logic. By interacting directly with register maps, microcontroller firmware configures hardware peripherals and manages external communication interfaces. This program is typically flashed onto the microcontroller during production and runs continuously from the moment the chip receives power.
System Initialization
Execution starts at the reset vector when power is applied to the microcontroller. The code configures the internal system clocks and initializes the memory controllers before running the main program.
Execution Model
Developers structure these programs using either a simple control loop or a real-time kernel. In a bare-metal architecture, the microcontroller firmware runs a continuous super-loop that sequentially checks flags and executes tasks. Interrupt service routines break this flow to handle time-critical events like receiving a packet or sensing a hardware fault.
In more complex devices, a scheduler manages multiple tasks, yielding CPU control based on priority and resource availability. This allows the system to remain responsive to external stimuli while executing heavy processing tasks in the background.
Development Process
Compilation translates the source code written in a language like C into a binary image for the target architecture. Engineers then load this image using programming interfaces such as Joint Test Action Group or Serial Wire Debug.