在海思板子原有sdk版本和自己的不一样时候需要重新烧录系统
查看开发板烧录sdk版本:cat /pr oc/umap/vi
目录
步骤123全在u-boot界面下进行 ///1.reboot重启 ---》2.enter,,进入u-boot界面
///////////////////开始烧录
#1.设置IP mac
setenv ipaddr 192.168.0.168
setenv serverip 192.168.0.8
setenv gatewayip 192.168.0.1
setenv netmask 255.255.255.0
saveenv
#2(将tftpd32.exe和 根据模组修改后、编译好的u-boot、内核、文件系统放在同一目录并运行exe)
把tftpd32.exe复制到【3、根据模组修改后u-boot、内核、文件系统编译好和烧录说明】里面
打开tftpd32.exe后回到xshell
//本文用的是编译好的,当然也可自己在o'sdrv目录下编译生成,以下为自己编译,编译参考http://www.javashuo.com/article/p-hzcotfbk-og.html
https://blog.csdn.net/qq_40421682/article/details/100133571
(1)编译整个osdrv目录
make all
(2)单独编译kernel
make ARCH=arm CROSS_COMPILE=arm-himix200-linux- menuconfig
make ARCH=arm CROSS_COMPILE=arm-himix200-linux- uImage//制作烧录文件系统
osdrv/pub/bin/pc/mkfs.jffs2 -d osdrv/pub/rootfs_uclibc_3516dv300 -l -e 0x10000 -o osdrv/pub/rootfs_hi3516dv300_64k.jffs2
#3.开始拷贝(注意16M和32M)(已经有uboot可省略uboot烧写)
以 16M SPI nor Flash 为例
1. 地址空间说明
| 1M | 4M | 11M |
|----------------------|---------------------|---------------------|
| boot | kernel | rootfs |
以下的操作均基于图示的地址空间分配,您也可以根据实际情况进行调整。
2. 烧写 u-boot //进行关闭看门狗等硬配置
mw.b 0x82000000 0xff 0x100000
tftp 0x82000000 u-boot-hi3516dv300.bin
sf probe 0;sf erase 0x0 0x100000;sf write 0x82000000 0x0 0x100000
3. 烧写内核 //内核各组件搬进去
mw.b 0x82000000 0xff 0x400000
tftp 0x82000000 uImage_hi3516dv300
sf probe 0;sf erase 0x100000 0x400000;sf write 0x82000000 0x100000 0x400000
4. 烧写文件系统 //init内核等, ,,,, 如果没有这个,无法使用内核,会一直卡在一个地方,如果rootfs出问题,也会出各种问题,如,ifconfig文法使用
mw.b 0x82000000 0xff 0xb00000
tftp 0x82000000 rootfs_hi3516dv300_64k.jffs2
sf probe 0;sf erase 0x500000 0xb00000;sf write 0x82000000 0x500000 0xb00000
5. 设置启动参数(注意 linux-4.9.y kernel 默认文件系统只读,需要在 bootargs 中加入rw 选项,文件系统才可读写)
setenv bootargs 'mem=128M console=ttyAMA0,115200 coherent_pool=2M root=/dev/mtdblock2 rootfstype=jffs2 rw mtdparts=hi_sfc:1M(boot),4M(kernel),11M(rootfs)'
//上面是两行是一句话
setenv bootcmd 'sf probe 0;sf read 0x82000000 0x100000 0x400000;bootm 0x82000000'
saveenv
6. 重启系统
reset ////////////////////////////////////////重新回到~#运行模式
以 32M SPI nor Flash 为例
1. 地址空间说明
| 1M | 4M | 27M |
|----------------------|---------------------|---------------------|
| boot | kernel | rootfs |
以下的操作均基于图示的地址空间分配,您也可以根据实际情况进行调整。
2. 烧写 u-boot
mw.b 0x82000000 0xff 0x100000
tftp 0x82000000 u-boot-hi3516dv300.bin
sf probe 0;sf erase 0x0 0x100000;sf write 0x82000000 0x0 0x100000
3. 烧写内核
mw.b 0x82000000 0xff 0x400000
tftp 0x82000000 uImage_hi3516dv300
sf probe 0;sf erase 0x100000 0x400000;sf write 0x82000000 0x100000 0x400000
4. 烧写文件系统
mw.b 0x82000000 0xff 0x1b00000
tftp 0x82000000 rootfs_hi3516dv300_64k.jffs2
sf probe 0;sf erase 0x500000 0x1b00000;sf write 0x82000000 0x500000 0x1b00000
5. 设置启动参数(注意 linux-4.9.y kernel 默认文件系统只读,需要在 bootargs 中加入
rw 选项,文件系统才可读写)
setenv bootargs 'mem=128M console=ttyAMA0,115200 coherent_pool=2M root=/dev/mtdblock2 rootfstype=jffs2 rw mtdparts=hi_sfc:1M(boot),4M(kernel),27M(rootfs)'
//上面两行是一句话
setenv bootcmd 'sf probe 0;sf read 0x82000000 0x100000 0x400000;bootm 0x82000000'
saveenv
6. 重启系统
reset
第1步
打开hitool
;
第2步
按图中设置
第3步
点击“烧写”后重新上电,等待烧写
1.restart卡机
系统烧没了,用hitool重新烧个uboot
2.执行mw.b的时候卡机
重新上电重来一次,执行命令隔太久也可能卡
3.htfp的IP问题
板子IP 192.168.0.168
主机以太网卡 192.168.0.8
htfpserver选择网卡 192.168.0.8
关闭防火墙
板子~#ping 192.168.0.8
显示alive即为通