使用QEMU仿真BeagleBone Black运行U-Boot遇问题求助
Hey there! Let's work through your issues step by step—totally normal to hit these snags when you're just starting out with embedded Linux and QEMU.
1. RealView-PB-A8 is NOT compatible with BeagleBone Black
First off: the realview-pb-a8 machine in QEMU is for ARM's own RealView Platform Board, which has a completely different hardware layout, peripherals, and memory map than the BeagleBone Black (BBB, which uses TI's AM335x SoC). Running a U-Boot built for BBB on this mismatched hardware will never work—your 30-minute hang is exactly what you'd expect, since U-Boot is trying to initialize hardware that doesn't exist here.
2. Fix your U-Boot compilation commands
You've got the order of your build commands backwards, plus a typo in the defconfig name:
- You need to select the defconfig first, then compile U-Boot
- The correct defconfig for BBB is
am335x_boneblack_defconfig(you had an extra leading underscore and misnamed it)
Here's the corrected build sequence:
# Set up the BBB configuration make CROSS_COMPILE=arm-cortex_a8-linux-gnueabihf- am335x_boneblack_defconfig # Compile U-Boot (use -j$(nproc) to speed up with all your CPU cores) make CROSS_COMPILE=arm-cortex_a8-linux-gnueabihf- -j$(nproc)
If you specifically need the vboot variant, use am335x_boneblack_vboot_defconfig instead—but start with the standard defconfig first to rule out issues.
3. Use the correct QEMU machine for BBB
Good news: QEMU does support the BeagleBone Black directly—you just need a recent enough version (QEMU 2.12 or newer). The correct machine parameter is -M beaglebone.
Your fixed QEMU command should look like this:
qemu-system-arm -M beaglebone -nographic -m 512 -kernel /media/remo/xyz/EmbeddedLinux/u-boot-source-code/u-boot/u-boot.bin
- The
-m 512flag explicitly sets the memory to 512MB (matching BBB's hardware) - If you still don't see the U-Boot prompt, try removing
-nographicto use the GUI window, or add-serial stdioto force serial output to your terminal. Also, keep an eye out—U-Boot might auto-boot after a few seconds, so press any key quickly to stop at the prompt.
If your QEMU doesn't recognize the beaglebone machine, upgrade QEMU. On Ubuntu/Debian, you can run:
sudo apt update && sudo apt install --upgrade qemu-system-arm
4. Quick troubleshooting checks
- Verify your compiled U-Boot is valid: run
file u-boot.bin—it should output something like:u-boot.bin: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), statically linked, BuildID[sha1]=..., not stripped
- Confirm your cross-compiler works: run
arm-cortex_a8-linux-gnueabihf-gcc --version—it should return a valid version number for an ARMv7-A target (Cortex-A8 is ARMv7).
内容的提问来源于stack exchange,提问作者Raj Prudhvi

