Environment
- Board: BPI-F3 (SpacemiT K1)
- Prerequisite: TFTP server already running on the host machine
Setting Up IP Addresses
Find the host IP:
| |
In U-Boot, set the board and server IPs:
| |
Make sure both are on the same subnet.
Configuring PXE Files
On the host, set up the TFTP directory:
.
├── Image
├── k1-x_deb1.dtb
└── pxelinux.cfg
└── 01-fe-fe-fe-81-b4-a8
Image— the Linux kernel imagek1-x_deb1.dtb— the device tree blobpxelinux.cfg/— directory containing PXE config files
Config File Naming
PXE looks up config files by a priority order based on U-Boot variables. The highest priority is the MAC address. Check it in U-Boot:
| |
The config filename is the MAC address in lowercase, separated by hyphens, prefixed with 01- (the ARP hardware type for Ethernet):
01-fe-fe-fe-81-b4-a8
Config File Content
The format is identical to extlinux.conf:
default linux
label linux
kernel Image
fdt k1-x_deb1.dtb
append earlycon=sbi earlyprintk console=ttyS0,115200 loglevel=8 clk_ignore_unused swiotlb=65536 rdinit=/init workqueue.default_affinity_scope=system root=/dev/mmcblk2p6 rootwait rootfstype=ext4
Booting
In U-Boot:
| |
Pitfall: Missing fdt_addr_r
If the kernel hangs during boot, check the log for something like:
## Flattened Device Tree blob at 7deb2e10
Booting using the fdt blob at 0x7deb2e10
This address (0x7deb2e10) is not where your DTB was loaded — it’s fdtcontroladdr, U-Boot’s own internal device tree. This means PXE didn’t know where to load the DTB you specified.
PXE loads the kernel to kernel_addr_r and the DTB to fdt_addr_r. On this board, kernel_addr_r was set but fdt_addr_r was not:
| |
The fix:
| |
After this, pxe get && pxe boot works correctly — the DTB is loaded to the right address and the kernel boots with the proper device tree.