Red Shirt Jeff cut my Raspberry Pi 4 in half. I'm gonna plug it in and see if I can get it to boot!
And if it boots, it'll basically be a Raspberry Pi 4 model A.
And Raspberry Pi never made one of those! When they DO make one,
the model A is just a small model B, with just one USB port.
See the difference between the Pi 3 model B+ and the model A+? Looking at the Pi 4
with this really cool X-ray tool, it looks like there's a chance this thing could work!
So what if we're on to something? What if making a model A IS as easy as chopping off the ports?
Looking closely at the cut, I noticed Red Shirt Jeff cut through a bit of the circuit
around the audio jack on the board, but hopefully the Pi won't need that.
I told Red Shirt Jeff I'd try it out, but first I had to clean up the edge.
An angle grinder isn't too kind to a 6-layer PCB.
First I used some pliers to pop off a few of the ICs and surface mount bits
that were left dangling over the edge. Then I cleaned up the edge with fine-grit sandpaper,
so none of the internal ground planes or traces were squished into each other.
You can see what the raw edge looked like on the IO side—not
a pretty sight, and if even one trace shorts to ground, the Pi's toast.
So then I was like, let's go for it! I took the Pi over to my desk,
half expecting something to catch fire. But I plugged it into a switched outlet,
turned it on... and the LEDs seemed to light up as if something was working!
But there wasn't any HDMI output. No rainbow screen or anything.
So something wasn't quite right. I tried sanding the edge a little more,
and put a fresh copy of Raspberry Pi OS on a microSD card to try that.
And it seemed like the green activity LED would blink a couple times,
then go really dim. And if I waited a while, it would start getting a little brighter.
So at this point it seemed like some sort of power issue. But
SOMETHING was working—otherwise that series of activity blinks at the beginning wouldn't be happening.
I read through the boot process for the Rasbperry Pi in the documentation,
and it seemed like if it didn't start displaying something on the monitor,
it was getting stuck somewhere in this thing called the 'bootloader'.
The bootloader on the Raspberry Pi is one little piece of the Pi
puzzle that's closed source—the source code behind it is closed off to tinkerers like me
because it's under lock and key from Broadcom.
So I did the next best thing, and posted about this on the Raspberry Pi Forum.
The first thing I learned was the little circuit next to the audio jack
was apparently part of the Pi's switching power supply. And half of that circuit is gone now.
So... maybe that has something to do with the dim green light I'm seeing.
Also, forum user trejan pointed out that for the 8 gig Pi 4, the little
power supply circuit Red Shirt Jeff cut through was actually moved over next to the USB-C port.
So MAYBE Red Shirt Jeff should've cut through an 8 gig Pi... W-wait, no, what am I even
saying? It's hard enough finding Pis this year, I can't give him an excuse to break another one!
I was about to throw in the towel, and not even make a video about this, but then forum user
cleverca22 popped in and was like "those first few blinks on the activity light are from the SPI
clock line of the boot flash... which means part of the bootup works, and I can help you get UART!"
Okay, wow, I'm in over my head. What's UART? And I thought the Raspberry Pi just booted up
into Linux, what do you mean SPI clock line? Well, over the next few days, I learned a LOT
about what it actually takes to boot a Raspberry Pi, and I'll explain it to you so you can understand too.
And hopefully, by the end of this video, you'll see why it's super handy to have one of these.
First, what's UART? UART stands for "Universal Asynchronous Receiver/Transmitter". And that's
a mouthful. Basically, it's a very old and very widely used communication protocol for computers.
Most people would use the terms "UART" and "Serial port" interchangeably.
You might see a serial port on the front of a network switch.
Or a little header on a PCI Express card. Or,
in the old days, we even plugged our mice into a 9-pin serial port on the back of our PCs.
Even the latest and greatest M1 mac like the one I'm using to edit this video has a serial port!
And if you ask my wife about my eating habits,
you might even see a cereal port on the front of my face!
But for things like mice, better protocols like USB are used today. But for debugging,
serial ports and UART are the name of the game since they're so simple to implement and use.
Serial ports, simply put, allow communication at the lowest levels of a system.
In fact, on a Raspberry Pi, you can configure the bootloader itself to send output over the Pi's
serial port using a special option 'BOOT_UART'! But we're getting a bit too far in the weeds.
I have a whole blog post that goes into excruciating detail on the Pi's UART.
The short version? I used this handy USB to TTL Serial adapter. One end plugs into your computer,
the other end into the right GPIO pins on the Pi. This thing's handy since with it,
I can interface with pretty much any device in the world with UART!
I got it connected to the Pi's serial port, and have a `screen` session up
on my Mac displaying any output that comes from the Raspberry Pi.
I tried booting it, and... nothing. No output to the screen.
Maybe it IS truly dead and gone, even after seeing those hopeful activity LED blinks.
But hope abounds, as cleverca posted another message in the Pi Forums.
He said the Raspberry Pi _might_ be able to load
a special "recovery.bin" file from the SD card. And he conjured one up for me.
So I put it on my card and booted, and what do you know?
I got some serial output! It's not much, but seeing that output means at least some part
of the Pi is booting up and able to read data off the microSD card. Not bad for half a Pi!
The way the Pi works, I know at least the VideoCore processor on the SoC is able to run,
since that's what's loading the recovery file. You might not know this, but when the Raspberry
Pi boots up, the first thing that fires off is this tiny little chip,
using a protocol called SPI, or Serial Peripheral Interface.
It contains the 'bootloader' code that fires off everything else on the Pi,
starting with the VideoCore graphics core inside the Pi's System on a Chip.
And for every byte that's read from this chip, the green activity LED flashes once.
So when we see it get kind of bright and blink a couple times, that's actually a
ton of bytes getting sent through the SPI interface to get the Pi booting up.
From that point, the VideoCore GPU takes over and executes a bootloader,
and from there things like the CPU, SDRAM, and other subsystems start coming online.
So something between when the VideoCore takes over and when the CPU comes online is breaking.
At this point, cleverca suggested I try re-flashing the Raspberry Pi's EEPROM—that's
the little bit of flash memory inside that tiny early boot chip.
Now, I should warn you: don't try this at home. At least not with a Raspberry
Pi you care about. You can easily brick a Pi by reflashing the EEPROM.
But seeing as my Pi was, y'know, cut in half already... I figured I'd give it a shot.
I grabbed the bootloader from the Raspberry Pi GitHub, enabled UART in it,
generated a new version, and copied everything off to a microSD card.
Unfortunately... when I booted the Pi with that card, the activity LED just
stayed green, and it didn't seem like the Pi would even do anything.
It must be trying to initialize some bit of hardware that's broken.
So right now, the furthest I can get is running a custom recovery.bin file that boots me up inside
the VPU, or Video processor. I can't get access to the ARM CPU or the system memory.
But there are still some other things I might be able to try,
like desoldering the USB and network chips, rebuilding part of the power circuit by hand,
or debugging even further through some test pads on the bottom of the Pi.
In any case, that'll be for a future video. I just ordered this hot air rework station... and
once that arrives, no circuit board'll be safe. I just have to put a lock on it so Red
Shirt Jeff doesn't get any funny ideas! Until next time, I'm Jeff Geerling.