在海思板子原有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即爲通