Embedded Tech 2026 9 min read

Protecting Embedded Devices: A Total Guide to Secure Boot and Over-the-Air Updates

A
Akash Chawla Embedded Software Trainer · 11+ Years Experience
20th NOV 2026
3:30 PM
Technoscripts

Introduction

This guide covers the essentials of secure boot and over-the-air updates, along with the challenges that are currently relevant to the embedded systems industry.

Embedded systems are becoming more and more connected to the internet, mobile applications, cloud computing and industrial networks. Information exchange between smart devices and external systems is now commonplace in automotive, medical and industrial equipment. Connectivity makes these products more useful, but it also exposes them to cybersecurity risks. A critical task for embedded developers is to make sure that only trusted code runs on the device.

The two key technologies that protect connected embedded systems are secure boot and Over-the-Air (OTA) firmware updates. Secure boot ensures that firmware is authentic before it is executed, and OTA updates allow manufacturers to deliver new firmware without physical access to the device.

It's vital for embedded engineers to understand these technologies, as products today must stay secure for their entire lifetime.

What is Secure Boot?

Secure boot is a security feature that prevents a microcontroller from running firmware that is not trusted by the device's manufacturer or another trusted source.

Normally, when a microcontroller powers on, it begins execution at a fixed address in memory. Without secure boot, an attacker who gains access to the programming interface or boot firmware might be able to run modified or malicious firmware.

Secure boot adds a verification step at the beginning of the boot process. The device can determine whether the firmware image is legitimate and whether it has been altered.

It typically uses cryptographic digital signatures. The manufacturer signs the firmware image with a private key, and the matching public key is stored on, or securely provided to, the embedded device.

The bootloader checks the firmware's signature when the device boots up. If the signature is valid, the application can run. If verification fails, the device rejects the firmware and falls back to a preprogrammed recovery process.

This helps prevent unauthorized firmware from running on the device.

Understanding the Secure Boot Process

A typical secure boot design starts with a Root of Trust. This is the first trusted component, and it establishes trust for the rest of the software.

Depending on the microcontroller architecture, the Root of Trust can be implemented using immutable boot ROM, hardware security features or protected bootloader code.

When power is turned on, the processor starts running the first boot code. This code locates the firmware image and runs integrity and authenticity checks.

The next phase is to verify the bootloader or application image with a trusted cryptographic key. If verification succeeds, execution is passed to the next authorized software component.

This process can be extended into a chain of trust, where every stage verifies the next stage before handing over control.

An example of a secure boot architecture would be: hardware Root of Trust, first-stage bootloader, second-stage bootloader and application firmware.

What is essential is that every software element is checked before it is trusted.

What Is an OTA Firmware Update?

Over-the-Air firmware updating is the ability to send and install new software over a wireless or network connection.

Traditionally, embedded developers updated firmware by attaching a programmer or debugger to the microcontroller. This works well during development, but it is impractical for thousands of devices deployed at various locations.

OTA updates address this by enabling manufacturers to send firmware updates over the Internet.

For instance, smart meters installed in residential buildings may need a firmware update to fix a communications problem. Instead of visiting every installation, the manufacturer can send the update through a gateway or network server.

Likewise, software upgrades can be delivered to connected car controllers, industrial equipment and IoT devices in the field without physically accessing each unit.

OTA updates can deliver new functionality, bug fixes, performance enhancements and security patches.

How Does an OTA Update Work?

Typically, an OTA update involves a device, an update server and a firmware management system.

The manufacturer first creates a new firmware image and signs it. This firmware package is then uploaded to an update server.

The device periodically checks whether a new update is available. This can happen over Wi-Fi, Ethernet, cellular or a gateway.

When an update is available, the device downloads the firmware package. Depending on the architecture, either the full image or a differential update can be sent.

The device must validate the firmware package before installing it. It should verify the digital signature, image integrity, compatibility and version information.

If verification succeeds, the update process starts. The new firmware is written to the designated memory region, and the device restarts with the new application.

A reliable OTA architecture also needs a recovery mechanism. If the update fails or the new firmware does not boot, the device should be able to roll back to a known good version.

The Role of the Bootloader in OTA Updates

The bootloader is the key element of secure firmware updates.

A bootloader is a piece of software that runs before the main application. It initializes and validates the firmware, manages firmware updates and passes control to the application.

A dual-bank or A/B firmware architecture is often used. Here, one memory region holds the currently running firmware, while another stores the new firmware image.

Once the download is complete, the bootloader checks the new image. After successful validation, the device tries to boot from the newly validated region.

The application can then run simple self-tests to confirm the firmware is working properly. If it is, the update can be marked as permanent.

If the new firmware fails to boot, the bootloader can roll back to the previous working firmware.

This helps prevent a device from being permanently bricked by a firmware update that was cut short or interrupted.

Key Security Considerations for OTA Systems

Securing an OTA implementation takes more than just downloading a firmware file.

Digital signatures are required to ensure that an update comes from an authorized source. Hash functions help detect unintended or malicious firmware changes.

Where necessary, encryption protects firmware while it is transmitted or stored. Device authentication ensures that only approved devices can communicate with the update infrastructure.

An anti-rollback feature stops attackers from flashing an older firmware version with known vulnerabilities. This can be done using protected version counters or other trusted mechanisms.

Key storage is essential too. Private signing keys must be protected within the manufacturer's infrastructure, and device-side verification keys must be securely provisioned and protected from unauthorized modification.

Update servers and devices should communicate using authenticated and encrypted protocols.

Implementing Secure Boot and OTA on STM32

STM32 microcontrollers are a helpful platform for learning about secure boot and firmware updates.

Depending on the STM32 family, developers can explore hardware security features, cryptographic libraries, secure boot options and firmware update frameworks.

For instance, STM32Trust offers security-related software and hardware features on supported STM32 platforms. Available features depend on the specific MCU family and should be checked against the relevant reference manual and documentation.

The first step for an STM32 developer is to build a bootloader that checks an application image stored in Flash memory, verifies its digital signature and then runs it.

The next step is to create a communication interface for receiving new firmware. Depending on the application and development board, this can be UART, USB, Ethernet or a wireless link.

Developers then need to implement firmware validation, Flash writing, version checking and recovery logic.

Testing should cover power interruptions during download, corrupted firmware images, invalid signatures, insufficient Flash space and failed application startup.

Common Challenges Faced by Embedded Developers

Memory constraints are among the main challenges. Small microcontrollers sometimes don't have enough Flash memory to hold two firmware images.

Communication reliability is another issue. Wireless connections can drop during a firmware download, so protocols need to be able to securely resume or restart the download.

Power failure is another important factor. The device should never be left unusable if power is lost during Flash programming.

Security key management needs careful planning. Even a technically secure system can be undermined by a weak key management process.

Lastly, firmware compatibility has to be taken into account. An update built for one hardware revision may not be compatible with another.

Skills Engineers Should Learn

Engineers interested in secure firmware development should learn Embedded C, Flash memory architecture, bootloader design, interrupt handling and microcontroller startup procedures.

An understanding of cryptographic hashing, digital signatures, encryption, secure communication and key management is also useful.

Practical experience with STM32CubeIDE, STM32CubeProgrammer, debugging tools and hardware development boards helps engineers understand how secure firmware systems work in practice.

Conclusion

Secure boot and OTA firmware updates are two critical technologies for today's connected embedded devices. Secure boot establishes trust at startup, and OTA updates let manufacturers maintain and improve deployed products remotely.

Knowing how to design bootloaders, sign firmware images, manage Flash memory and recover from failed updates is crucial for embedded developers building reliable and secure firmware. These skills are especially relevant in automotive electronics, industrial automation, IoT and connected consumer products.