1. What is the Boot Process?
When we press the power button, how does the RK3399 transition from “nothing” to entering the Linux system? This entire process is called the “boot process.”
This can be likened to our daily waking up process:
Open Eyes (BootRom) → Get Up and Get Dressed (Bootloader) → Eat and Wash Up (Kernel) → Go to Work (Rootfs)
2. Internal Structure of RK3399: The Foundation of Booting
The RK3399 chip contains two key components:
1. BootRom (32KB)
- Fixed in the chip and cannot be changed.
- Runs first after power-up.
- The main function is to find and verify the bootloader in the external storage device.
2. SRAM (200KB)
- Available for use immediately after power-up.
- BootRom will load the initial code of the bootloader into SRAM for execution.
3. Boot Devices Supported by RK3399
The RK3399 can boot from the following external devices:
- NAND Flash
- SPI Flash
- eMMC
- SD Card
- USB Type-C (downloading programs from the host via USB)
As long as any one of these devices is available, the system can be re-flashed and boot restored.
4. Complete Explanation of the Boot Process (Relay Race)
The boot process of the RK3399 can be understood as a relay race, where each step prepares for the next:
1. Power Initialization
After powering on, the chip completes initialization of power, voltage, clock, etc.
2. BootRom Execution
BootRom starts executing the program to search for available external boot devices.
If a valid bootloader is found, its initial part is loaded into SRAM for execution.
3. Bootloader First Stage
The bootloader code running in SRAM has the primary task of initializing DDR4 memory.
4. Bootloader Second Stage
After DDR initialization is complete, the full version of the bootloader is loaded into DDR for execution.
It begins searching for the Linux kernel file (kernel.img).
5. Loading the Linux Kernel
The bootloader reads kernel.img from eMMC or SD card and loads it into memory.
6. Mounting rootfs
After the kernel starts, it loads system drivers and mounts the root filesystem (rootfs).
7. Entering User Space
After mounting is complete, the system enters user space, allowing user interaction with the system.
Summary of the Boot Process:
BootRom → Bootloader (small) → Bootloader (full) → Kernel → Rootfs → User Space
5. Detailed Explanation of the Three Boot Modes of RK3399
Depending on different scenarios, the RK3399 provides three boot modes:
1. Normal Mode (Standard Boot)
- Default boot process.
- Boots from BootRom → Bootloader → Kernel → Rootfs step by step into the system.
Applicable scenarios: daily use, development, running systems.
2. Loader Mode (Upgrade Mode)
- Stops at the bootloader after booting, waiting for host commands.
- Can use a computer via USB to flash the system or upgrade firmware.
3. MaskRom Mode (Rescue Mode)
- Automatically enters when the bootloader is damaged or lost, and BootRom verification fails.
- The system remains in a waiting state, waiting for the host to issue a new bootloader via USB or other means.
Recovery requires using official Rockchip tools (such as RKDevTool).
Applicable scenarios: severe system damage, device cannot boot, requiring “brick recovery.”.
6. Comparison of the Three Boot Modes
| Mode | Features | Applicable Scenarios |
|---|---|---|
| Normal | Normal system boot | Daily use, development |
| Loader | Waiting for host flashing commands | Upgrade, maintenance |
| MaskRom | BootRom cannot start, waiting for program download | System damage, brick recovery |
Next Chapter: How to Flash the System (Cross Compilation)
- Use official Rockchip tools (such as RKDevTool)
- Send the bootloader (such as uboot.img) to the development board via USB
- Then download the kernel.img and rootfs files
- Complete system recovery or upgrade