Module 3 ยท Lab 3
The boot ROM
When reset is released, the CPU starts at a fixed address inside the system-on-chip, in code written at the factory. That code cannot be changed or erased, which is why a board with broken firmware or boot media can always be brought back.
Where this stage sits
Key ideas
- The boot ROM (also called the mask ROM) is part of the silicon. Its whole job is to find the first stage of the bootloader and start it.
- It tries boot sources in a fixed order, such as SPI flash, eMMC and the SD card. Both course boards have a boot select switch that changes which source is tried first; the schematic's boot page shows how.
- From the first source that holds a valid image, it reads a small first stage, checks its header (and on a secured device, its signature, against keys held in fuses), copies it into on-chip SRAM and jumps to it.
- If no source holds a valid image, or the USB boot button is held at power-on, it waits in USB boot mode for a computer to send the first stage over USB. The Libre Computer app and the recovery tools use this.
On the bench
In short, what you do in lab 3, where the steps are given in full:
- In the Lab 1 log, mark the lines printed before any code from the SPI flash or the boot media ran.
- Flip the boot select switch and power on: watch the boot ROM try its sources in a different order, and write down what you observe.
- Hold the USB boot button at power-on and connect the phone running the app, or a PC running the Amlogic USB boot tool, to the USB Type-C port; let it send the first stage, and see the board start without its own firmware.
Resources
| Resource | Use in this module |
|---|---|
| Troubleshooting boot issues on Amlogic boards | What an Amlogic board prints, and where boots stop |
| boot.libre.computer | The published boot files the app sends to a board in USB boot mode |
| eMMC flashing steps from Linux with pyamlboot | USB boot from a PC instead of a phone, with the Amlogic USB boot tool |