Raspberry pi raspberry u-boot从sd卡加载映像和运行映像

Raspberry pi raspberry u-boot从sd卡加载映像和运行映像,raspberry-pi,u-boot,Raspberry Pi,U Boot,我已经从Raspberry PI上编译并安装了u-boot。效果很好。它的靴子很好,效果也很好(参见)。我可以使用可执行文件的s-rec版本加载示例应用程序 现在我想创建一个映像,将它放在sd卡上(u-boot映像所在的sd卡),然后加载并执行该映像。这与s-rec过程相同:通过s-rec加载映像,然后使用“go”执行,但不是通过串行端口加载,而是从sd卡上获取映像 我试过使用: load mmc 0 0x0100000 hello_world.bin 然后 go 0x0100000 它加载

我已经从Raspberry PI上编译并安装了u-boot。效果很好。它的靴子很好,效果也很好(参见)。我可以使用可执行文件的s-rec版本加载示例应用程序

现在我想创建一个映像,将它放在sd卡上(u-boot映像所在的sd卡),然后加载并执行该映像。这与s-rec过程相同:通过s-rec加载映像,然后使用“go”执行,但不是通过串行端口加载,而是从sd卡上获取映像

我试过使用:

load mmc 0 0x0100000 hello_world.bin
然后

go 0x0100000
它加载ok:

U-Boot> fatload mmc 0 0x01000000 hello_world.bin
reading hello_world.bin
594 bytes read in 27222 ms (0 Bytes/s)
U-Boot> go 0x01000000
## Starting application at 0x01000000 ...
但是rPI会自动重新启动

  • 我还尝试了fatload,得到了同样的结果

  • 我尝试使用./imagetool-uncompressed.py创建图像,然后使用load或fatload-and-go,但没有乐趣

  • 我试着用bootm加载/fatload,但仍然没有成功

还有什么我可以试试的吗

约翰

更新:@microMolvi指出我用错了地址。我重新运行了它:

U-Boot> load mmc 0 0x01001000 hello_world.bin 
reading hello_world.bin
594 bytes read in 27200 ms (0 Bytes/s)
U-Boot> go 0x01001000
## Starting application at 0x01001000 ...
<snip>about 100 garbage characters<snip>
<I pressed Enter here>
## Application terminated, rc = 0x0
U-Boot> 

好吧,看起来你不能随便在任何地方加载bin文件

以下是我所做的: 1) 我重新加载了s-rec版本

U-Boot> loads
## Ready for S-Record download ...

## First Load Addr = 0x0C100000
## Last  Load Addr = 0x0C100251
## Total Size      = 0x00000252 = 594 Bytes
## Start Addr      = 0x0C100000
U-Boot> 
注意“开始地址”,它是0x0C10-00000

2) 我重置rPI,然后在0x0C10-0000处加载垃圾箱

U-Boot> load mmc 0 0x0C100000 hello_world.bin
reading hello_world.bin
594 bytes read in 15644 ms (0 Bytes/s)
3) 并从同一地址运行它:

U-Boot> go 0x0C100000
## Starting application at 0x0C100000 ...
Example expects ABI version 6
Actual U-Boot ABI version 6
Hello World
argc = 1
argv[0] = "0x0C100000"
argv[1] = "<NULL>"
Hit any key to exit ... 

## Application terminated, rc = 0x0
U-Boot> 
这表示基于ARM的板(如rPI)在0x0C10-0000处加载和启动: 应用程序的默认加载和启动地址如下:

                    Load address    Start address
    x86             0x00040000      0x00040000
    PowerPC         0x00040000      0x00040004
    ARM             0x0c100000      0x0c100000
    MIPS            0x80200000      0x80200000
    Blackfin        0x00001000      0x00001000
    NDS32           0x00300000      0x00300000
    Nios II         0x02000000      0x02000000

在arch/arm/config.mk中有:

CONFIG_STANDALONE_LOAD_ADDR = 0xc100000
在文件examples/standalone/.hello\u world.cmd中

cmd_examples/standalone/hello_world := arm-linux-gnueabi-ld.bfd   -g -Ttext 0xc100000 -o examples/standalone/hello_world -e hello_world examples/standalone/hello_world.o examples/standalone/libstubs.o -L /usr/lib/gcc-cross/arm-linux-gnueabi/4.7 -lgcc

这里的-Ttext是0xc100000。这意味着hello_世界条目地址是0xc100000。因此hello.bin必须加载到内存地址0xc100000。

Hi John,0x0100000不等于0x01000000:)能否请您向我们提供
U-Boot>printenv的输出,请参见上文的更新。从你的回答来看,我认为它应该能正常工作!?顺便说一句,我也试过:
load mmc 0$loadaddr hello\u world.bin
,然后
go$loadaddr
,最后我也试过加载hello\u world.srec。这只是重置了rPI。不,我不确定这个过程,只是发现了输入错误:D我过去在arm11mpcore板上遇到过同样的问题,但无法解决。我将尝试您在下面发布的解决方案,希望它也适用于我:)
CONFIG_STANDALONE_LOAD_ADDR = 0xc100000
cmd_examples/standalone/hello_world := arm-linux-gnueabi-ld.bfd   -g -Ttext 0xc100000 -o examples/standalone/hello_world -e hello_world examples/standalone/hello_world.o examples/standalone/libstubs.o -L /usr/lib/gcc-cross/arm-linux-gnueabi/4.7 -lgcc