Meaning
Microcontroller initialisation programs manage two separate flash memory banks to enable safe over-the-air firmware updates without interrupting device operation. Implementing a dual-bank bootloader allows target devices to download incoming software images into an inactive memory bank while continuing execution from the active bank. The mechanism operates at the boundary between raw flash memory partitions and system reset routines.
Hardware watchdog timeouts trigger automatic fallback to the primary memory bank if the secondary image fails verification upon startup.
Execution Swap
Vector table relocation directs CPU instruction fetching to the newly verified partition upon reboot. The bootloader inspects image metadata, cryptographic signatures, and CRC checksums prior to altering active memory pointers. Swapping execution addresses occurs in milliseconds, minimizing system downtime during field updates.
If execution halts due to corrupt binary code, hardware watchdogs trigger a reboot back to the known good partition. This immediate recovery prevents device bricking across distributed remote deployments.
Flash Architecture
Flash memory geometry requires two equal physical or logical memory banks capable of independent erase and write operations. Internal memory controllers must support read-while-write functionality when updates run concurrently with main application execution. System designers allocate identical memory footprints for both banks to accommodate future application expansion.
Rollback Protection
Security policies enforce minimum version numbers to prevent malicious downgrades to vulnerable firmware builds. Non-volatile register flags record boot status attempts and increment error counters when startup failures occur. Exceeding maximum allowed boot attempts causes the system to lock out the corrupted bank permanently.