本文主要是介绍hi3518e笔记,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
开发环境
Ubuntu版本:14.04LTS
SDK版本:V1.0.A.0
sdk安装
拷贝Hi3518_SDK_V1.0.A.0.tgz至Linux下
#tar -zxvf Hi3518_SDK_V1.0.A.0.tgz
# cd Hi3518_SDK_V1.0.A.0/
# ./sdk.unpack
安装SDK报错查看链接:http://blog.csdn.net/u013286409/article/details/45305911
编译整个osdrv目录
kernel编译
顶层路径:Hi3518_SDK_V1.0.A.0/osdrv/kernel/linux-3.0.
# cp arch/arm/configs/hi3518e_full_defconfig .config
# make ARCH=arm CROSS_COMPILE=arm-hisiv100nptl-linux- menuconfig
# make ARCH=arm CROSS_COMPILE=arm-hisiv100nptl-linux- uImage
arch/arm/boot/目录下生成了uImage镜像
# ls arch/arm/boot/uImage -lh
-rw-r--r-- 1 root root 2.8M Jan 15 10:27 arch/arm/boot/uImage
clean cmd
# make ARCH=arm CROSS_COMPILE=arm- hisiv100nptl -linux- clean
按照默认配置编译出来的内核比较大,2.8M.
内核裁剪
Kernel compression mode (Gzip) --->
( ) Gzip
(X) LZMA
( ) LZO
-*- Miscellaneous filesystems --->
< > YAFFS2 file system support
< > Second extended fs support
[ ] Debug Filesystem
生成内核镜像文件信息如下
Image Name: Linux-3.0.8
Created: Mon Jan 18 15:23:51 2016
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2054496 Bytes = 2006.34 kB = 1.96 MB
Load Address: 80008000
Entry Point: 80008000
添加exfat支持后大小:1.99M
尝试继续裁剪。。。
General setup --->
[ ] Enable AIO support
[ ] Support Thumb user binarie
[ ] Quota support
Created: Mon Jan 18 17:41:21 2016
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2071412 Bytes = 2022.86 kB = 1.98 MB
Load Address: 80008000
Entry Point: 80008000
-*- Miscellaneous filesystems --->
< > Compressed ROM file system support (cramfs)
Created: Mon Jan 18 17:55:52 2016
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2068876 Bytes = 2020.39 kB = 1.97 MB
Load Address: 80008000
Entry Point: 80008000
Created: Mon Jan 18 18:30:33 2016
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 2062364 Bytes = 2014.03 kB = 1.97 MB
Load Address: 80008000
Entry Point: 80008000
Created: Tue Jan 19 09:43:25 2016
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1969684 Bytes = 1923.52 kB = 1.88 MB
uboot编译
顶层路径:Hi3518_SDK_V1.0.A.0/osdrv/uboot/u-boot-2010.06
# make ARCH=arm CROSS_COMPILE=arm-hisiv100nptl-linux- hi3518e_config
# make ARCH=arm CROSS_COMPILE=arm-hisiv100nptl-linux-
# cp u-boot.bin ../../tools/pc_tools/uboot_tools/
# cd ../../tools/pc_tools/uboot_tools/
# ./mkboot.sh reg_info_hi3518e.bin u-boot-ok.bin
生成的u-boot-ok.bin为可用的uboot镜像
配置busybox
顶层路径:Hi3518_SDK_V1.0.A.0/osdrv/busybox/busybox-1.16.1
# make ARCH=arm CROSS_COMPILE=arm-hisiv100nptl-linux- menuconfig
# make ARCH=arm CROSS_COMPILE=arm-hisiv100nptl-linux-
# make ARCH=arm CROSS_COMPILE=arm-hisiv100nptl-linux- install
编译安装后输出目录为_install
制作JFFS2根文件系统
顶层路径:Hi3518_SDK_V1.0.A.0/osdrv/pub
# tar -zxvf rootfs_uclibc.tgz
# mkfs.jffs2 -d ./rootfs_uclibc -l -e 0x20000 -o rootfs.jffs2
备注:貌似有点问题,待解决!
备注:
d指定根文件系统
l little-endian 小端模式
e Flash 的块大小
o 输出映像文件
SPI FLASH 烧写uboot
mw.b 0x82000000 ff 100000;tftp 0x82000000 u-boot-ok.bin;sf probe 0;sf erase 0x0 0x100000;sf write 0x82000000 0x0 0x100000;
备注:
【mw.b】内存初始化,填充内存。把内存 0x82000000 开始的 0x10000 字节设为 0xFF。
【sf probe 0】 探测并初始化SPI FLASH;
【0x82000000】内存地址
uboot相关参数
【bootargs】启动 OS 时的启动参数
【bootdelay】设置自启动延时时间。单位为秒 <-1>关闭自启动功能
知识点备注
这篇关于hi3518e笔记的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!