Design and Implementation of Lightweight Asynchronous Logging Scheme for Bare-Metal Systems

WANG Pengzhang, SUN Hao, LIANG Jian, WANG Haoyan

Integrated Circuits and Embedded Systems ›› 0

Integrated Circuits and Embedded Systems ›› 0 DOI: 10.20193/j.ices2097-4191.2026.0029

Design and Implementation of Lightweight Asynchronous Logging Scheme for Bare-Metal Systems

  • WANG Pengzhang, SUN Hao, LIANG Jian, WANG Haoyan
Author information +
History +

Abstract

In real-time embedded bare-metal systems such as relay protection devices, traditional synchronous logging schemes suffer from high interrupt response latency, poor thread safety, and significant resource consumption. This paper proposes a lightweight asynchronous logging scheme tailored for bare-metal systems. The scheme adopts a dual-buffer asynchronous write mechanism: only raw parameter values are saved in interrupt service routines, while log formatting and storage operations are completed in the background main loop. Critical section protection is achieved through interrupt disabling, ensuring thread safety in interrupt nesting environments. A unified storage strategy is designed for both AMP architecture and single-core bare-metal scenarios, supporting log level filtering, Hexdump memory dumping, and power-fail safe storage. Experimental results on the RockChip 4-core processor show that the scheme reduces single log recording time to within 1.1μs, achieving a 6x performance improvement compared to standard formatting printing interfaces, with peak buffer occupancy of 65%. The dual-buffer design and flow control mechanism effectively guarantee high real-time performance and reliability of the system.This solution is suitable for embedded bare-metal systems in fields such as relay protection, industrial control, and aerospace, where real-time performance and reliability are of the utmost importance.

Key words

bare-metal system / asynchronous logging / interrupt nesting / dual buffer / real-time performance / embedded system

Cite this article

Download Citations
WANG Pengzhang, SUN Hao, LIANG Jian, WANG Haoyan. Design and Implementation of Lightweight Asynchronous Logging Scheme for Bare-Metal Systems[J]. Integrated Circuits and Embedded Systems. 0 https://doi.org/10.20193/j.ices2097-4191.2026.0029

Accesses

Citation

Detail

Sections
Recommended

/