如何烧录BuildRoot构建的Intel Edison镜像及启动问题排查
Hey there, let's break down how to resolve your U-Boot boot failure and correctly flash the BuildRoot-generated bzImage and root filesystem image to your Intel Edison.
First: Troubleshooting the U-Boot Boot Failure
Your U-Boot flashed successfully but won't boot—here are the most likely fixes to check:
Verify U-Boot Alignment & Build Configuration
- The
truncate -s %4096 u-boot.bincommand is meant to align the image to 4096-byte sectors, but double-check if it’s working correctly. Runstat -c %s u-boot.binbefore and after truncate to confirm the size is a multiple of 4096. If not, use this more explicit command instead:truncate -s $(( $(stat -c %s u-boot.bin) + 4095 & ~4095 )) u-boot.bin - Ensure your BuildRoot
edison_defconfigmatches your specific Edison hardware variant. Runmake menuconfigand confirm under Target options thatIntel Edisonis selected, and under Bootloaders the U-Boot configuration is set toedison_defconfig.
- The
Confirm DFU Device ID & Mode
- When entering DFU mode, double-check the device ID with
lsusb. Some Edison models show up as8087:0a98instead of8087:0a99. If yours differs, update thedfu-utilcommand to use the correct ID. - Make sure you’re entering DFU mode properly: Hold the small DFU button, press the Reset button, wait 2-3 seconds, then release the DFU button. The board should appear in
lsusbimmediately.
- When entering DFU mode, double-check the device ID with
Check U-Boot Boot Logs via Serial
- Connect a USB-to-TTL serial adapter to Edison’s UART pins (use 3.3V logic only!) and monitor the boot output at 115200 baud, 8N1. This will show exact errors (e.g., missing kernel, invalid partition) that are causing the boot failure.
Properly Flashing BuildRoot's bzImage & Root Filesystem Image
Once you’ve fixed the U-Boot issue, here’s how to flash the full BuildRoot image stack:
Step 1: Enter DFU Mode
Follow the steps above to get Edison into DFU mode, and confirm the device appears in lsusb.
Step 2: Flash the Kernel (bzImage)
Navigate to your BuildRoot output/images directory, then run:
# Replace 8087:0a99 with your actual device ID if needed dfu-util -v -d 8087:0a99 --alt kernel -D bzImage
- If the command fails, run
dfu-util -lto list all available DFU partitions. Some Edison boards usekernel0orkernel1instead ofkernel—use the correct partition name from the list.
Step 3: Flash the Root Filesystem Image
BuildRoot generates a root filesystem image (usually rootfs.img or rootfs.ext2). Flash it with:
dfu-util -v -d 8087:0a99 --alt rootfs -D rootfs.img
- Again, use
dfu-util -lto confirm the root partition name if you get an error (some boards userootfs0).
Step 4: Reboot the Board
Either press the Reset button on the Edison, or trigger a reboot via DFU:
dfu-util -v -d 8087:0a99 --alt reset -R
Alternative: Flashing via U-Boot Console (For Debugging)
If you prefer using U-Boot's command line (great for troubleshooting), follow these steps:
- Interrupt Edison's boot process by pressing any key when U-Boot starts (monitor via serial).
- Set up a TFTP server on your host, and place
bzImageandrootfs.imgin the TFTP root directory. - Run these U-Boot commands (replace IPs with your network details):
setenv ipaddr 192.168.1.100 # Edison's IP address setenv serverip 192.168.1.10 # Host's TFTP server IP tftpboot 0x80000000 bzImage tftpboot 0x80800000 rootfs.img run update_kernel run update_rootfs saveenv reset
内容的提问来源于stack exchange,提问作者pritam

