How to Hack Any Micro-controller with a Raspberry Pi Pico. Easy Fault-Injection by Traffic Mocking
Tongren Chen (Cyber Security Engineer and Researcher · Consulting Firm in Tokyo)
CODE BLUE 2025 · Day 1 · Track 1 (Hall B)
Overview
In this CODE BLUE talk, Tongren Chen presents a groundbreaking and significantly simplified approach to performing precise fault injection on microcontrollers. The core challenge in hardware hacking, particularly with fault injection, often lies in the intricate and time-consuming process of developing custom drivers to understand and interact with target chips. Chen's research tackles this hurdle head-on, proposing a novel methodology that bypasses the need for full-fledged driver implementation by leveraging "traffic mocking" – essentially recording and replaying legitimate communication.

Key moments
- 0:00 Introduction and object of the talk
- 6:00 Real-world challenges: Acquiring a trigger without a driver
- 10:30 The new approach: Record and replay traffic
- 14:00 Solution circuit for isolating bidirectional communication
- 20:00 Proof of concept: Hacking the RO78 chip
- 23:30 Hardware implementation with Raspberry Pi Pico
- 32:30 Bonus: Chip boot sequence and magic firmware
How to Hack Any Micro-controller with a Raspberry Pi Pico. Easy Fault-Injection by Traffic Mocking
Speakers: Tongren Chen, Cyber Security Engineer and Researcher, Consulting Firm in Tokyo
Conference: CODE BLUE
YouTube: https://www.youtube.com/watch?v=hR_4U0hddnE
Overview
In this CODE BLUE talk, Tongren Chen presents a groundbreaking and significantly simplified approach to performing precise fault injection on microcontrollers. The core challenge in hardware hacking, particularly with fault injection, often lies in the intricate and time-consuming process of developing custom drivers to understand and interact with target chips. Chen's research tackles this hurdle head-on, proposing a novel methodology that bypasses the need for full-fledged driver implementation by leveraging "traffic mocking" – essentially recording and replaying legitimate communication.
The talk introduces an accessible and target-independent method for hardware-level attacks, making advanced techniques like voltage glitching more attainable for researchers and practitioners. By utilizing the affordable and highly precise Raspberry Pi Pico, Chen demonstrates how to achieve fine-grained control over glitch timing and effectively exploit microcontroller vulnerabilities. This approach not only minimizes the effort traditionally associated with hardware reverse engineering but also opens new avenues for security analysis of embedded systems, offering crucial insights for both attackers and defenders.
Background
▶ Watch: Introduction and object of the talk (0:00)
Fault injection is a potent hardware attack technique targeting integrated circuits, where electronic errors are deliberately introduced into a circuit to induce undefined behaviors. These behaviors can range from data corruption to the skipping of critical instructions, potentially leading to security bypasses or privilege escalation. Among the various fault injection methods, voltage glitching is particularly effective. It involves briefly shorting the integrated circuit's power supply to ground, causing transient voltage drops that disrupt internal operations. This disruption, often attributed to "ringing" in the circuit or setup time violation (where components don't have enough time to charge and stabilize before an operation), can force the chip into an exploitable state.
Prior work, such as the crowbar voltage glitching method popularized by ChipWhisperer, has established the efficacy of precise timing control over glitch parameters (offset, width, steps). To perform a successful precise voltage glitching attack, several key steps are typically required:
- Identifying the vulnerable moment: Pinpointing the exact time within a chip's operation where a glitch would be most impactful.
- Identifying and capturing a digital trigger: An identifiable signal or event that can automatically initiate the glitch.
- Defining a stop signal: An event indicating the attack's success, prompting a halt to avoid further unintended effects.
- Issuing exploit commands: Sending specific instructions to the now-vulnerable chip to achieve the attacker's objective, such as firmware dumping.
While academic research often assumes a "perfect trigger" (e.g., toggling a GPIO pin just before critical logic), real-world scenarios are far more complex. Acquiring a reliable trigger in a production device necessitates understanding the chip's internal operations and its communication protocols. Historically, this has involved observing chip communication on lines like debug interfaces (e.g., PS4 hacks using the 200 debugger line) or external storage interfaces (e.g., PS Vita hacks on eMMC lines). The challenge here is that making sense of these analog signals and translating them into meaningful commands requires developing a driver.
The implementation of a custom driver is often the most arduous part of hardware reverse engineering. A driver's primary function is to interpret analog voltage readings into bits (Step 1), then bits into bytes (Step 2), and finally, bytes into structured communication frames (Step 3). While the first two steps typically involve straightforward logic and are often publicly documented (e.g., in official chip specifications), Step 3—parsing bytes into frames with lexical structure and grammar—is immensely difficult. The frame structure is frequently undocumented, making debugging nearly impossible without a working reference. This necessitates extensive reverse engineering, validation of assumptions without clear feedback, and often sequential capture, making the process time-consuming and prone to errors. This complexity is precisely what Tongren Chen's new approach seeks to mitigate.
Key Findings
▶ Watch: The new approach: Record and replay traffic (10:30)
The central discovery presented in this talk is that it is possible to achieve precise fault injection on microcontrollers without the need for a full-fledged, custom driver. Instead, the speaker demonstrates that by recording and replaying (or mocking) communication traffic, researchers can effectively interact with, analyze, and exploit target chips with significantly reduced effort. This approach overcomes the major hurdle of complex protocol parsing (Step 3: byte to frame conversion) that traditionally plagues hardware hacking efforts.
The methodology relies on two key technical innovations:
- Isolation of Bidirectional Single-Wire Communication: A simple, yet effective, circuit design using a single resistor (R1) allows for the unambiguous identification of the sender and receiver on a shared communication line, even without understanding the underlying protocol. This enables clear separation of inbound and outbound traffic.
- Systematic Record and Replay of Analog Signals: By utilizing a logic analyzer to capture raw analog voltage data, the first two steps of driver functionality (voltage to bit, bits to byte) can be performed with documented rules. This raw, timestamped byte data can then be selectively replayed to identify critical communication sequences, pinpoint vulnerable moments, and construct effective attack payloads.
Crucially, the talk highlights the Raspberry Pi Pico as an ideal and affordable platform for implementing this attack. Its specialized PIO (Programmable I/O) state machines enable incredibly precise timing control (down to single clock cycles, or approximately 16 nanoseconds), which is essential for generating effective voltage glitches. Furthermore, its dual-core architecture allows for parallel execution of tasks—simultaneously sending attack signals and monitoring for success signals—streamlining the fault injection process.
The practical application of this methodology was successfully demonstrated by dumping the firmware from a Renesas RO78 microcontroller, bypassing its security protections. This proof of concept validates the effectiveness and accessibility of the proposed traffic mocking technique for hardware security analysis.
Technical Deep Dive
▶ Watch: Solution circuit for isolating bidirectional communication (14:00)
The core challenge addressed by this research is the complexity of developing a full driver for microcontroller communication, particularly the "byte to frame" parsing (Step 3). This step involves understanding the lexical structure and grammar of a chip's proprietary protocol, which is often undocumented, making reverse engineering, debugging, and validation extremely difficult. To circumvent this, Chen proposes a record and replay (or traffic mocking) approach, but this introduces two new challenges: isolating bidirectional communication on a single wire and precisely recording/replaying analog signals.
Solution 1: Isolating Bidirectional Single-Wire Communication
Many microcontrollers use single-wire serial protocols for debugging or communication, where both the host (e.g., debugger) and the target chip transmit and receive on the same physical line. Without understanding the protocol, it's impossible to distinguish who is sending what. Chen's elegant solution involves adding a tiny resistor (R1) (e.g., 220 ohms) in series with the communication line and then probing the voltage on both sides of this resistor.
The principle is based on observing voltage differences when a digital zero is transmitted. When a sender transmits a digital zero, it effectively pulls its side of the line to ground. Due to the resistor (R1), a slight voltage drop occurs across it. Consequently, the probe on the sender's side will always register a slightly lower voltage than the probe on the receiver's side when a digital zero is being sent. This phenomenon is amplified by the receiver's internal pull-up resistors (often connected to VCC), which try to pull the line high. By analyzing the voltage difference (delta V) between the two probes, the attacker can reliably identify the direction of communication (who is talking) at any given moment, even for protocols they don't understand. This simple circuit effectively isolates the bidirectional traffic into two logical, unidirectional streams for analysis.
Solution 2: Recording and Replaying Analog Signals
With bidirectional traffic isolated, the next step is to accurately record and replay the communication. Chen argues that Step 1 (voltage to bit conversion) and Step 2 (bits to byte conversion) are generally simpler and often documented in chip datasheets, unlike the complex Step 3 (byte to frame).
- Recording: Instead of trying to implement a full driver, a logic analyzer is used to capture the raw analog voltage waveforms at high speed (millions of samples per second). This raw data, consisting of timestamped voltage readings, can then be processed offline. The process involves identifying voltage drops (falling edges), then using documented timing rules (e.g., counting half the bit length from the falling edge, identifying start bits, data bits, and stop bits) to reconstruct the actual bytes and their associated timestamps and direction. This yields a complete, reconstructible log of all communication.
- Replaying (Traffic Mocking): Once the communication is captured and parsed into bytes with directions and timestamps, the attacker can selectively replay specific chunks of traffic.
- Initial Capture: First, "good" communication is captured by connecting a debugger to a fresh, unprogrammed target chip and performing standard operations (e.g., memory dump).
- Critical Chunk Identification: By replaying the entire debugger traffic, the attacker can verify the setup works. Then, by replaying progressively smaller segments, or by replaying only the part after a suspected critical operation, the attacker can pinpoint specific "critical chunks" of communication. For example, if replaying only the data extraction commands fails, it indicates that earlier commands were crucial for setting up the chip. This iterative process allows identification of essential handshake sequences, security checks (like security ID and checksum exchanges), and other critical logic.
- Exploit Crafting: The identified critical chunks then serve as templates. The attacker can modify or inject specific commands, or, more importantly for fault injection, identify specific points within these chunks to trigger a glitch. For instance, a digital trigger can be defined as pausing before sending the last one or two bytes of a security ID verification command, providing a precise window for glitching.
Raspberry Pi Pico as the Attacker Platform
The Raspberry Pi Pico is central to this methodology due to its unique capabilities as a microcontroller:
- Precision with PIO: Unlike general-purpose computers, the Pico features PIO (Programmable I/O) state machines. These are dedicated hardware blocks that can execute custom assembly-like instructions at extremely high speeds, with "all PIO instructions execut[ing] in one clock cycle." At the Pico's default clock speed of 125MHz, this translates to an instruction execution time of 8 nanoseconds, allowing for precise control of GPIO pins down to approximately 16 nanoseconds for a complete toggle (on and off). This level of precision is paramount for generating effective, narrow voltage glitches.
- Dual-Core Architecture: The Pico boasts two ARM Cortex-M0+ cores. This dual-core design is leveraged to run parallel tasks: one core can handle the "sending" logic (setting up the attack, generating the glitch at the precise trigger), while the other continuously monitors for the "receiving" logic (detecting the stop signal from the target chip). This parallel processing capability simplifies the attack implementation significantly.
- Affordability: At a fraction of the cost of a Raspberry Pi or dedicated hardware glitching tools, the Pico makes advanced hardware hacking techniques highly accessible.
The physical glitch mechanism involves the Pico toggling a GPIO pin, which controls a high-speed NPN transistor (BJT or MOSFET). When activated, the transistor briefly shorts a critical pin of the target IC (e.g., the core's power supply or a specific internal signal line) to ground, causing the intended voltage glitch. While the Pico can generate a spike in ~16ns, the actual effective glitch duration, considering transistor response and circuit parasitics, was observed to be around 150-400 nanoseconds, still well within the precise control capabilities required for fault injection.
Demo / Proof of Concept
▶ Watch: Hardware implementation with Raspberry Pi Pico (23:30)
Tongren Chen demonstrated the efficacy of his traffic mocking approach by successfully performing a firmware dumping attack on a Renesas RO78 microcontroller. The goal was to extract the embedded firmware, typically protected against unauthorized access.
The hardware setup for the demonstration was remarkably simple and affordable. It consisted of:
- A Raspberry Pi Pico as the attack orchestrator.
- The Renesas RO78 target chip on a development board.
- A simple probing circuit featuring the crucial R1 resistor (e.g., 220 ohms) for isolating bidirectional communication on the target's SWD (Serial Wire Debug) line.
- Two high-speed NPN transistors (BJT or MOSFET), controlled by the Pico, to implement the voltage glitch by briefly shorting a specific pin of the RO78 (e.g., the GC pin connected to the core) to ground.
- A reset line connected to the Pico, allowing for programmatic resets of the target chip without powering down the Pico (which needs to maintain its state and glitch parameters).
- An oscilloscope and/or logic analyzer for visualizing the communication and the injected glitches.
The attack flow followed the methodology outlined:
- Preparation: The target RO78 chip was brought to a known, vulnerable state (e.g., by initiating a firmware update or debug session).
- Digital Trigger Identification: Through the traffic mocking process, a critical communication sequence involving a security ID and checksum exchange was identified. The digital trigger for the glitch was set just before the final 1-2 bytes of this sequence were sent by the debugger, creating a precise window for disruption.
- Glitch Injection: Upon detecting this trigger, the Raspberry Pi Pico rapidly toggled its GPIO pin, activating the transistor to momentarily short the RO78's core to ground. The precise timing of the Pico's PIO state machines ensured the glitch was delivered with nanosecond accuracy.
- Stop Signal Detection: Concurrently, the Pico's second core actively monitored the target's response for a specific "success unlock" hex string. This string was previously identified by comparing captured traffic from successful versus failed unlock attempts.
- Iterative Attack and Exploit: If the "success unlock" signal was received, the attack was deemed successful, and the Pico proceeded to replay the pre-recorded data extraction commands to dump the firmware. If the attack failed (no success signal or an error response), the target chip was rebooted via the reset line, and the process was repeated with slightly adjusted glitch parameters (offset, width) until success was achieved.
The presentation included oscilloscope captures clearly showing the precise voltage spikes generated by the Pico and the resulting glitch waveforms on the target chip. The speaker confirmed that this iterative process successfully dumped the firmware from the Renesas RO78, even when protection mechanisms were ostensibly enabled. This practical demonstration underscored the power and accessibility of the traffic mocking and Pico-based fault injection technique.
Defensive Implications
▶ Watch: Bonus: Chip boot sequence and magic firmware (32:30)
The detailed demonstration of precise fault injection via traffic mocking with a Raspberry Pi Pico highlights several critical areas for embedded system designers and defenders to consider:
- Robust Hardware Design Against Voltage Glitching:
- Power Delivery Integrity: Microcontrollers, especially during critical operations, should have highly stable and resilient power delivery. The talk noted that slightly undervolting a chip can increase its susceptibility. Designers must ensure robust power regulation and filtering to prevent transient voltage drops, regardless of external conditions.
- Physical Protection: As fault injection requires physical access, secure enclosures, tamper-detection mechanisms, and anti-tamper measures (e.g., active mesh, environmental sensors) become even more crucial.
- Glitch-Resistant Circuitry: Implementing internal voltage monitoring, redundant power rails for critical components, or hardware-based glitch detection and response mechanisms can help mitigate these attacks.
- Secure Firmware and Software Development Practices:
- Redundant Security Checks: Critical security operations, such as security ID verification, checksum validation, or protection state checks, should not rely on a single execution path. Implement redundant checks, multiple stages of verification, and diverse algorithms to make it harder for a single glitch to bypass all defenses.
- Timing Independence: Design critical code paths to be less sensitive to precise timing disruptions. Introduce randomized delays or execution paths that make it difficult for an attacker to reliably hit a specific instruction with a glitch.
- Secure Boot and Firmware Updates: The "bonus" section of the talk detailed how understanding the boot sequence (program counter, monitor ROM, OCD code injection) could allow for manipulating the chip's debug mode. This emphasizes the importance of a secure boot process, ensuring only authenticated and verified firmware can execute. Firmware updates must also be cryptographically signed and validated before flashing.
- Protection of Monitor ROM and Debug Interfaces: The ability to force On-Chip Debugger (OCD) mode or bypass protections by flashing "magical firmware" (as shown in the bonus slides) underscores the need to harden these interfaces. Monitor ROM regions should be immutable and contain only trusted code, and debug ports should be permanently disabled or require strong authentication after manufacturing.
- Mitigation of Program Commander Vulnerabilities: The speaker mentioned other vulnerable parts like the "program commander." Designers and developers should be aware of and proactively mitigate known vulnerabilities in such critical components.
- Supply Chain Security:
- The accessibility of this attack method means that microcontrollers can be compromised at various stages of the supply chain. Ensuring the integrity of chips from manufacturing through deployment is paramount. This includes secure provisioning, anti-tamper seals, and thorough inspection.
In essence, while the traffic mocking technique simplifies the attacker's task, it simultaneously provides defenders with a clearer understanding of the attack surface. By focusing on robust hardware design, implementing comprehensive software security, and securing the entire product lifecycle, the risks posed by such precise fault injection attacks can be significantly reduced.
Key Takeaways
- Simplified Fault Injection: Precise fault injection on microcontrollers no longer necessitates extensive, custom driver development. The "traffic mocking" approach, involving recording and replaying legitimate communication, offers a significantly easier and more accessible alternative.
- Effective Bidirectional Communication Isolation: A simple hardware modification—adding a small resistor (R1) to the communication line and probing both sides—allows for reliable identification of the sender and receiver on a single-wire, bidirectional protocol, even without protocol knowledge.
- Raspberry Pi Pico as a Powerful Attack Platform: The Raspberry Pi Pico is an exceptionally affordable and capable tool for hardware hacking, particularly for precise timing attacks. Its PIO (Programmable I/O) state machines enable nanosecond-level control over glitch injection, and its dual-core architecture facilitates parallel tasks like sending attacks and monitoring for success.
- Strategic Communication Analysis: Understanding the patterns of chip communication, even without full protocol parsing, is crucial. By selectively replaying recorded traffic, attackers can quickly identify critical handshake sequences, security checks, and vulnerable moments to craft effective digital triggers and exploits.
- Vulnerability of Protected Microcontrollers: The successful firmware dumping from a Renesas RO78 chip, even with protections enabled, demonstrates that even ostensibly secure microcontrollers can be vulnerable to precise voltage glitching, highlighting the need for deeper defensive strategies.
- Multi-Layered Defense is Essential: Defending against such attacks requires a combination of robust hardware design (e.g., stable power, physical tamper detection), secure firmware development (e.g., redundant checks, timing independence, secure boot), and awareness of supply chain vulnerabilities.
About the Speaker(s)
Tongren Chen is a cyber security engineer and researcher currently working at a consulting firm in Tokyo. He is also known by the name Shen. His work focuses on hardware security and exploring novel methods for analyzing and exploiting embedded systems.
Reviews
Dr. Zero (Offensive Security Researcher) — STRONG ACCEPT
Genuinely useful methodology that lowers the barrier to hardware glitching by sidestepping the driver-development hell that stops most people. The resistor trick for isolating bidirectional single-wire traffic is elegant and immediately reusable. Not a novel vulnerability class, but a solid contribution to the practitioner's toolkit.
Heather Calloway (CISO) — SOLID
Solid hardware security research that lowers the barrier to fault injection attacks on microcontrollers. The Pico-based approach is clever and reproducible, but the strategic implications are narrow — this matters most if you're running embedded device programs or IoT supply chains, less so for general enterprise security.