Archive for running u-boot with versatilepb

Problem running U-Boot on QEMU for versatilepb (ARM729EJ-S) ?

Posted in Arm stuffs with tags , , , , , , , , on June 18, 2012 by UnixmanLinuxboy

Qemu is a good emulator to try out and understand system programming without a real hardware.
Versatilepb (arm926ej-s) is supported quite well by Qemu and this article describes to overcome a nasty U-Boot error which I encountered when compiling u-boot for versatilepb.

U-boot version used: u-boot-2012.04.tar.bz2

Compiled using:

make versatilepb_config ARCH=arm CROSS_COMPILE=arm-none-eabi-
make all ARM=arm CROSS_COMPILE=arm-none-eabi-

Running u-boot with QEMU:
qemu-system-arm -M versatilepb -m 128M -nographic -kernel ./u-boot.bin

And I am greeted with this:


qemu: fatal: Trying to execute code outside RAM or ROM at 0xffff07bc

R00=fffcbf64 R01=ffff0000 R02=00000000 R03=0101c08c
R04=ffff0000 R05=fffcbf64 R06=ffff0000 R07=00000000
R08=008fff78 R09=feff0000 R10=0101c08c R11=00000000
R12=fffcbfdc R13=fffcbf58 R14=ffff07bc R15=ffff07bc
PSR=600001d3 -ZC- A svc32
Aborted

Or

U-Boot 2012.04 (Jun 18 2012 - 17:54:11)

DRAM: 128 MiB
WARNING: Caches not enabled
Flash: ## Unknown flash on Bank 1 - Size = 0x00000000 = 0 MB
*** failed ***
### ERROR ### Please RESET the board ###
QEMU: Terminated

How to avoid this nasty error you ask?

Answer: Patch include/configs/versatile.h
Add this line

#define CONFIG_ARCH_VERSATILE_QEMU

just below

#ifndef __CONFIG_H
#define __CONFIG_H

Recompile and voila!!

Here is the output


U-Boot 2012.04 (Jun 18 2012 - 18:14:08)

DRAM: 128 MiB
WARNING: Caches not enabled
Using default environment

In: serial
Out: serial
Err: serial
Net: SMC91111-0
VersatilePB # help
? - alias for 'help'
base - print or set address offset
bdinfo - print Board Info structure
bootm - boot application image from memory
bootp - boot image via network using BOOTP/TFTP protocol
cmp - memory compare
cp - memory copy
crc32 - checksum calculation
dhcp - boot image via network using DHCP/TFTP protocol
env - environment handling commands
erase - erase FLASH memory
flinfo - print FLASH memory information
go - start application at address 'addr'
help - print command description/usage
iminfo - print header information for application image
loop - infinite loop on address range
md - memory display
mm - memory modify (auto-incrementing address)
mtest - simple RAM read/write test
mw - memory write (fill)
nm - memory modify (constant address)
ping - send ICMP ECHO_REQUEST to network host
printenv- print environment variables
protect - enable or disable FLASH write protection
reset - Perform RESET of the CPU
setenv - set environment variables
tftpboot- boot image via network using TFTP protocol
version - print monitor, compiler and linker version
VersatilePB #

Advertisements