Close

Sneaky Bugs

A project log for Raspberry Pi Pico Emulator

Live-coding an Open-Source Pico Emulator from Scratch

uri-shakedUri Shaked 03/05/2021 at 19:040 Comments

This time, we deciphered the internals of the bootrom, while hunting for two subtle bugs that made our emulator go crazy. We thickened our virtual RP2040 with a bunch of new instructions: MOV, SBCS, ANDS, ADDS, SUBS, ORRS and ADD/SUB with the stack pointer (SP).

You can watch the complete stream here:

I personally find the bug-hunting process most interesting. The first part starts at 1:15:44, where you see how I close down on the bug until it has no choice but to reveal itself, while teaching me a painful lesson about writing good test cases.

The second hunt starts at 2:18:30, where we try to figure out why BL jumps to the wrong memory address.

So it feels like we made a good progress, but we're not quite there yet. There are a few more missing instructions, and then... 🤞

You can join the next live stream on Tuesday to figure it out together. And if you are forgetful like me, why not add it to your calendar?

Discussions