Hi3520DV400 U-Boot 编译

目录

 

注意

U-Boot 打印信息:

uboot编译

1.配置编译环境

2.编译uboot,生成u-boot.bin文件

3.生成最终使用的 U-boot 镜像

烧写 U-boot

1.烧写

2.uboot环境变量配置

通过修改uboot代码来配置环境变量


注意

1.Hi3521D_V100&Hi3520D_V400共用SDK

2.海思SDK版本中代号C01是uclibc库,C02是glibc库

U-Boot 打印信息:

System startup

U-Boot 2010.06 (Nov 30 2020 - 13:48:56)

Check Flash Memory Controller v100 ... Found
SPI Nand(cs 0) ID: 0xef 0xaa 0x21 Name:"W25N01GV"
Block:128KB Page:2KB Chip:128MB*1 OOB:64B ECC:4bit/512
ECC provided by Flash Memory Controller
SPI Nand total size: 128MB
In:    serial
Out:   serial
Err:   serial
Hit any key to stop autoboot:  0

NAND read: device 0 offset 0x100000, size 0x400000
 4194304 bytes read: OK
## Booting kernel from Legacy Image at 82000000 ...
   Image Name:   Linux-3.18.20
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    3198744 Bytes = 3.1 MiB
   Load Address: 80008000
   Entry Point:  80008000
   Loading Kernel Image ... OK
OK

Starting kernel ...

Booting Linux on physical CPU 0x0
Initializing cgroup subsys cpu
Linux version 3.18.20 (lwx@lwx-VirtualBox) (gcc version 4.9.4 20150629 (prerelease) (Hisilicon_v500_20180120) ) #1 SMP Sat May 9 11:26:35 CST 2020
CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine model: Hisilicon HI3520DV400 DEMO Board
Memory policy: Data cache writealloc
PERCPU: Embedded 9 pages/cpu @c7edc000 s5696 r8192 d22976 u36864
Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 32512
Kernel command line: mem=128M console=ttyAMA0,115200 root=/dev/mtdblock2 rw rootfstype=yaffs2 mtdparts=hinand:1M(boot),4M(kernel),-(rootfs)
PID hash table entries: 512 (order: -1, 2048 bytes)
Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)

 

uboot编译

1.配置编译环境

进入uboot目录 Hi3521DV100_SDK_V1.0.4.0/osdrv/opensource/uboot/u-boot-2010.06

make ARCH=arm CROSS_COMPILE=arm-hisiv500-linux- hi3520dv400_config 

2.编译uboot,生成u-boot.bin文件

make ARCH=arm CROSS_COMPILE=arm-hisiv500-linux-


3.生成最终使用的 U-boot 镜像

将生成的 u-boot.bin 复制到 osdrv/tools/pc/uboot_tools/ 目录

进入osdrv/tools/pc/uboot_tools/ 目录

./mkboot-hi3520dv400.sh reg_info_hi3520dv400.bin u-boot-hi3520dv400.bin

其中 u-boot-hi3520dv400.bin 就是能够在单板上运行的 U-boot 镜像

 

烧写 U-boot

1.烧写

直接用HiTool烧写,也可以使用tftp方式烧写,前提是板端烧写过uboot

2.uboot环境变量配置

上电进入超级终端,依次执行以下代码即可

setenv bootargs 'mem=128M console=ttyAMA0,115200 root=/dev/mtdblock2 rw rootfstype=yaffs2 mtdparts=hinand:1M(boot),4M(kernel),-(rootfs)'; 
setenv bootcmd 'nand read 0x82000000 0x100000 0x400000;bootm 0x82000000' 
sa

通过修改uboot代码来配置环境变量

修改 Hi3521DV100_SDK_V1.0.4.0/osdrv/opensource/uboot/u-boot-2010.06/include/configs/hi3520dv400.h

可以搜索"Environment"关键字定位代码位置

/*-----------------------------------------------------------------------
 *  Environment   Configuration
 *-----------------------------------------------------------------------*/
#define CONFIG_BOOTCOMMAND "nand read 0x82000000 0x100000 0x400000;bootm 0x82000000"
#define CONFIG_BOOTDELAY	1
#define CONFIG_BOOTARGS "mem=128M console=ttyAMA0,115200 root=/dev/mtdblock2 rw rootfstype=yaffs2 mtdparts=hinand:1M(boot),4M(kernel),-(rootfs)"
#define CONFIG_NETMASK  255.255.255.0       /* talk on MY local net */
#define CONFIG_IPADDR   192.168.0.10        /* static IP I currently own */
#define CONFIG_SERVERIP 192.168.0.250     /* current IP of tftp server ip */
#define CONFIG_ETHADDR  00:00:23:34:45:66
#define CONFIG_BOOTFILE "uImage"        /* file to load */
#define CONFIG_BAUDRATE         115200
#define CONFIG_USE_MDIO	"0"

重新uboot编译即可。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值