Qemu flash启动不起作用

时间:2014-10-05 14:26:35

标签: flash arm qemu

我有一个相当古老的(2009年发布)嵌入式ARM linux书籍,它使用u-bootqemu。 本书中解释的qemuu-boot二进制文件的用法如下:

qemu-system-arm -M connex -pflash u-boot.bin -nographic

它使用qemu 0.9.1,而我的是2.1.0:

qemu-system-arm --version
QEMU emulator version 2.1.0, Copyright (c) 2003-2008 Fabrice Bellard

但是,当我执行相同的命令时,我收到了这些错误消息。

qemu-system-arm: failed to read the initial flash content
qemu-system-arm: Initialization of device cfi.pflash01 failed

可能有什么问题?这是来自新的命令参数吗?我有this site使用不同的命令,但是当我尝试时,我看到一个空白的屏幕。

qemu-system-arm -M versatilepb -m 128M -nographic -kernel u-boot.bin

我使用Mac OS X maverick for qemu。

2 个答案:

答案 0 :(得分:2)

我试过这个:

dd if=/dev/zero of=flash.bin bs=4096 count=4096
arm-linux-gnueabihf-as -o add.o add.S
arm-linux-gnueabihf-ld -Ttext=0x0 -o add.elf add.o
arm-linux-gnueabihf-objcopy -O binary add.elf add.bin
dd if=add.bin of=flash.bin bs=4096 conv=notrunc
qemu-system-arm -M connex -pflash flash.bin -nographic -serial /dev/null -gdb tcp::1234 -S

其中add.S是:

.text
entry: b start
arr:    .byte 1, 2, 3, 4, 5, 6
eoa:
.align
start:  
    ldr r0, =eoa
    ldr r1, =arr
    mov r3, #0
loop:
    ldrb r2, [r1], #1
    add r3, r2, r3
    cmp r1, r0
    bne loop
stop:   b stop

似乎程序运行良好......

qemu-system-arm --version
QEMU emulator version 2.0.0 (Debian 2.0.0+dfsg-2ubuntu1.5), Copyright (c) 2003-2008 Fabrice Bellard

答案 1 :(得分:1)

在Alex的帮助下,我可以在qemu上运行gumstix。

  1. 应使用dd命令将二进制文件转换为flash格式。

    • dd if=/dev/zero of=flash.bin bs=4096 count=4096
    • dd if=u-boot.bin of=flash.bin bs=4096 conv=notrunc
  2. 应为qemu提供一个参数,以便将stdio用于串行通信

    qemu-system-arm -M connex -pflash flash.bin -serial stdio

  3. 然后,我看到屏幕输出:

    pxa2xx_clkcfg_write: CPU frequency change attempt
    
    
    U-Boot 1.1.4 (Oct  6 2014 - 14:51:37) - 200 MHz - 
    
    *** Welcome to Gumstix ***
    
    U-Boot code: A3F00000 -> A3F23138  BSS: -> A3F58258
    RAM Configuration:
    Bank #0: a0000000 64 MB
    Flash: 16 MB
    Using default environment
    
    SMC91C1111-0
    Net:   SMC91C1111-0
    Hit any key to stop autoboot:  0 
    Instruction Cache is ON
    ### JFFS2 loading 'boot/uImage' to 0xa2000000
    Scanning JFFS2 FS:  done.
    find_inode failed for name=boot
    load: Failed to find inode
    ### JFFS2 LOAD ERROR<0> for boot/uImage!
    GUM> 
    

    请参阅源代码(gumstix.c)。

相关问题