raspberrypi 3B编译arm 32bit Uboot

0 安装配置交叉编译器,建议到www.linaro.org下载最新的交叉编译器,本人下载命令为:

wget http://newos.org/toolchains/arm-eabi-7.3.0-Linux-x86_64.tar.xz

mkdir ~/bin

cp arm-eabi-7.3.0-Linux-x86_64.tar.xz ~/bin

cd ~/bin

tar xvJf arm-eabi-7.3.0-Linux-x86_64.tar.xz

echo ARM_LINUX_EABI=~/bin/arm-eabi-7.3.0-Linux-x86_64 >> ~/.bashrc

echo PATH=$ARM_LINUX_EABI/bin:$PATH >> ~/.bashrc

source ~/.bashrc

 

1 下载uboot

git clone git://git.denx.de/u-boot.git

2 配置交叉编译器,选择linaro的交叉编译器

which armv8l-linux-gnueabihf-gcc

/home/xxxx/bin/gcc-linaro-7.3.1-2018.05-x86_64_armv8l-linux-gnueabihf/bin/armv8l-linux-gnueabihf-gcc

3 编译

cd u-boot

make rpi_2_defconfig

export CROSS_COMPILE=arm-eabi- 

make -j8

最后结果:

  CC      examples/standalone/stubs.o
  LD      examples/standalone/libstubs.o
  CC      examples/standalone/hello_world.o
  LD      examples/standalone/hello_world
  OBJCOPY examples/standalone/hello_world.srec
  OBJCOPY examples/standalone/hello_world.bin
  LDS     u-boot.lds
  LD      u-boot
  OBJCOPY u-boot.srec
  OBJCOPY u-boot-nodtb.bin
start=$(aarch64-linux-android-nm u-boot | grep __rel_dyn_start | cut -f 1 -d ' '); end=$(aarch64-linux-android-nm u-boot | grep __rel_dyn_end | cut -f 1 -d ' '); tools/relocate-rela u-boot-nodtb.bin 0x00000000 $start $end
  COPY    u-boot.bin
  SYM     u-boot.sym
  CFG     u-boot.cfg

4 编译后得到u-boot.bin,放到树莓派/boot分区,修改config.txt:

kernel=u-boot.bin

raspberrypi 3B串口打印信息如下:

U-Boot 2018.09-rc1-00018-ga839c36 (Aug 05 2018 - 13:19:03 +0800)

DRAM:  948 MiB
RPI 3 Model B (0xa02082)
MMC:   mmc@7e202000: 0, sdhci@7e300000: 1
Loading Environment from FAT... *** Warning - bad CRC, using default environment

Failed (-5)
In:    serial
Out:   vidconsole
Err:   vidconsole
Net:   No ethernet found.
starting USB...
USB0:   scanning bus 0 for devices... 4 USB Device(s) found
       scanning usb for storage devices... 0 Storage Device(s) found
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
18030 bytes read in 6 ms (2.9 MiB/s)

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值