Lightweight Two-Stage Secure Boot with Automatic Rollback for STM32 IoT Devices
Abstract
Secure firmware updates are critical for embedded and Internet of Things (IoT) devices, as any failure during the update process can render the system permanently unavailable. Existing secure boot solutions often depend on dedicated hardware security modules or offer only limited recovery mechanisms, which are impractical for low-cost, resource-constrained microcontrollers. This study presents a novel architecture for safe boot using a lightweight two-stage system with
automatic rollback features, implemented on an STM32 microcontroller. The system allocates security and update functions between two bootloaders (BL1 and BL2) via a metadata-governed state machine and dual-bank flash memory, thereby obviating the need for supplementary hardware. We have implemented common security protocols within this framework, including AES for encryption, SHA-256 for integrity verification, and RSA-2048 for authentication. We also added a Time-based One-Time Password (TOTP)-based Multi-Factor Authentication (MFA) system to safeguard data transmission over UART. Experimental results conducted on the STM32-F746 IoT hardware platform showed that the proposed solution achieved significant efficiency in boot data recovery across diverse error scenarios and effectively thwarted unauthorized attacks and system degradation. The performance parameters for total system boot delay ranged from 5 to 15.5 seconds, while public key authentication latency consistently remained below 258.8 ms. The suggested methodology is appropriate for IoT devices that use low-capacity microcontroller units, such as STM32 platforms. The findings validate that resource-limited IoT devices can attain strong security and assured system resilience without the need for specialist hardware.
References
A. Marchand, Y. Imine, H. Ouarnoughi, T. Tar-ridec, and A. Gallais, “Firmware integrity protec-tion: A survey,” IEEE Access, vol. 11, pp. 77 952–77 979, 2023.
L. Catuogno and C. Galdi, “Secure firmware update: Challenges and solutions,” Cryptography,vol. 7, no. 2, 2023.
L. Zhao, H. Shuang, S. Xu, W. Huang, R. Cui, P. Bettadpur, and D. Lie, “A survey of hardware improvements to secure program execution,” ACM Comput. Surv., vol. 56, no. 12, Oct. 2024.
O. F. Adeojo, “The importance of secure firmware updates in maintaining system integrity,” Progress in Electronics and Communication Engineering, Sep 2024.
N. Asokan, T. Nyman, N. Rattanavipanon, A.-R. Sadeghi, and G. Tsudik, “Assured: Architecture for secure software update of realistic embedded de-vices,” IEEE Transactions on Computer-Aided Design
of Integrated Circuits and Systems, vol. 37, no. 11, pp. 2290–2300, 2018.
P. Gupta, A. Sinha, P. K. Srivastava, A. Perti, and
A. K. Singh, “Security implementations in iot us-ing digital signature,” in Innovations in Electrical and Electronic Engineering. Springer Singapore, 2021, pp. 523–535.
C. Profentzas, M. Günes, Y. Nikolakopoulos, O. Landsiedel, and M. Almgren, “Performance of secure boot in embedded systems,” in 2019 15th International Conference on Distributed Computing in Sensor Systems (DCOSS), 2019, pp. 198–204.
“Trusted Firmware-M Implementation Overview — SimpleLink™ CC13XX/CC26XX SDK TI 15.4-Stack User’s Guide 6.41.00.00 documentation.” [Online]. Available: https://software-dl.ti.
com/simplelink/esd/simplelink_cc13xx_cc26xx_sdk/latest/exports/docs/ti154stack/html/security-tfm/tfm_architecture.html
B. Moran, H. Tschofenig, and H. Birkholz, “A Manifest Information Model for Firmware Updates in Internet of Things (IoT) Devices,”
Internet Engineering Task Force, Request for Comments RFC 9124, Jan. 2022, num Pages: 40. [Online]. Available: https://datatracker.ietf.org/doc/rfc9124/
“TUF Getting started,” section: docs. [Online]. Available: https://theupdateframework.io/docs/getting-started/
L. Keleman, D. Mati´c, M. Popovi´c, and I. Kaštelan, “Secure firmware update in embedded systems,” in 2019 IEEE 9th International Conference on Con-sumer Electronics (ICCE-Berlin), 2019, pp. 16–19.
S. Falas, C. Konstantinou, and M. K. Michael, “A hardware-based framework for secure firmware updates on embedded systems,” in 2019 IFIP/IEEE 27th International Conference on Very Large Scale
Integration (VLSI-SoC), 2019, pp. 211–216.
NIST, “Platform firmware resiliency guidelines,” NIST Special Publication 800-193, Tech. Rep., 2018.
J. Daemen and V. Rijmen, “Advanced encryption standard (AES),” Federal Information Processing Standards Publication (FIPS) 197, Tech. Rep., 2001.
I. Hammad, K. El-Sankary, and E. El-Masry, “Ad-vanced encryption standard (aes) implementation in embedded systems,” in Embedded Systems: Hard-ware, Design, and Implementation. John Wiley & Sons, 2012, pp. 291–317.
NIST, “Secure hash standard (shs),” Federal In-formation Processing Standards Publication (FIPS) 180-4, Tech. Rep., 2015.
K. Moriarty, B. Kaliski, J. Jonsson, and A. Rusch, “Pkcs #1: Rsa cryptography specifications version 2.2,” RSA Laboratories’ Public-Key Cryptography Standards (PKCS), RFC 8017, 2016.
D. M’Raihi, S. Machani, M. Pei, and J. Rydell, “TOTP: Time-based one-time password algorithm,” Internet Requests for Comments,
IETF, RFC 6238, May 2011. [Online]. Available: https://www.rfc-editor.org/rfc/rfc6238
DOI: http://dx.doi.org/10.21553/rev-jec.455
Copyright (c) 2026 REV Journal on Electronics and Communications
ISSN: 1859-378X Copyright © 2011-2026 |
|