HI3521D 系統(uboot,kernel,rootfs)打包成一個燒錄檔案
阿新 • • 發佈:2018-11-20
1.準備檔案系統
a.在osdrv/pub/中有已經編譯好的檔案系統(rootfs_uclibc),因此無需再重複編譯檔案系統,只需要根據單板上flash的規格型號製作檔案系統映象即可。
b.往rootfs_uclibc中,新增自己專案的應用程式,相關庫,相關配置
c.製作檔案系統
nand flash 資訊:
2KB pagesize、4bit ecc
即:
mkyaffs2image100 ./osdrv/pub/rootfs_uclibc/ ./osdrv/pub/rootfs_uclibc_2k_4bit.yaffs2 1 2
以上檔案系統製作完成。
2.uboot部分
HI3521D提供的Uboot,bootargs和bootcmd不能正確引導核心和檔案系統,所以需要通過修改uboot原始碼,來設定正確的bootargs和bootcmd。
uboot原始碼,/osdrv/opensource/uboot/u-boot-2010.06/include/configs目錄下
找到Environment Configuration修改為:
/*-----------------------------------------------------------------------
* Environment Configuration
*-----------------------------------------------------------------------*/
#define CONFIG_BOOTCOMMAND "nand read 0x82000000 0x100000 0x400000;bootm 0x82000000"
#define CONFIG_BOOTDELAY 1
#define CONFIG_BOOTARGS "mem=110M console=ttyAMA0,115200 root=/dev/mtdblock2 rootfstype=yaffs2 rw mtdparts=hinand:1M(boot),4M(kernel),96M(rootfs),27M(test)"
#define CONFIG_NETMASK 255.255.255.0 /* talk on MY local net */
#define CONFIG_IPADDR 192.168.1.10 /* static IP I currently own */
#define CONFIG_SERVERIP 192.168.1.2 /* 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:
* make ARCH=arm CROSS_COMPILE=arm-hisiv500-linux- hi3521d_config
* make ARCH=arm CROSS_COMPILE=arm-hisiv500-linux-
* cp ./u-boot.bin osdrv/tools/pc/uboot_tools/
* cd osdrv/tools/pc/uboot_tools/
* ./mkboot.sh reg_info.bin u-boot-hi35xx.bin
最後一步很重要
uboot編譯完成。
3.準備核心,將使用HI3521D編譯好的核心。
4.把uboot,kernel,rootfs合併成一個檔案。
開啟HiTool工具,點選合併映象,新增檔案,注意選擇正常的韌體型別,檔案系統,輸入正確的開始地址和長度。如下圖:
點選 製作合併映象。