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工具,点击合并镜像,添加文件,注意选择正常的固件类型,文件系统,输入正确的开始地址和长度。如下图:
点击 制作合并镜像。