其中遇到问题参考了:http://blog.chinaunix.net/uid-20083252-id-5147516.html?tdsourcetag=s_pcqq_aiomsg
设置环境变量
$ source /opt/fsl-networking/QorIQ-SDK-V1.8/environment-setup-ppce500v2-fsl-linux-gnuspe
$ unset LDFLAGS
编译uImage
make uImage
err1:
powerpc-fsl-linux-ld: unrecognized option ‘-Wl,-O1’
powerpc-fsl-linux-ld: use the --help option for usage information
make[1]: *** [init/main.o] 错误 1
make: *** [init] 错误 2解:unset LDFLAGS
freescale给出的解决办法是注销环境变量LDFLAGS,命令是
unset LDFLAGS
。
err2:
powerpc-fsl-linux-gnuspe-ld: cannot find libgcc.a: No such file or directory
powerpc-fsl-linux-gnuspe-ld: cannot find libgcc.a: No such file or directory
make: *** [vmlinux] 错误 1解:
查看工具链的使用的libgcc库路径
$CC --print-libgcc-file-name libgcc.a
这里显示的是当前目录下的libgcc.a文件,这是是不对的。正确的结果应该指向编译器所在目录下面的一个libgcc.a文件,你可以运行gcc --print-libgcc-file-name
,比较一下。解决办法是在当前目录下建一个链接,指向编译器目录下的libgcc.a。命令如下:
ln -s /opt/fsl-networking/QorIQ-SDK-V1.7/sysroots/i686-fslsdk-linux/lib/libgcc.a libgcc.a
ln -s /usr/lib/gcc/i686-linux-gnu/4.8/libgcc.a libgcc.a
编译设备树
make p1020rdb-pd_32b.dtb
烧写、启动
err1:
Creating 5 MTD partitions on “ec000000.nor”:
0x000000000000-0x000000020000 : “NOR DTB Image 128K”
ftl_cs: FTL header not found.
0x000000020000-0x000000620000 : “NOR Linux Kernel Image 6M”
ftl_cs: FTL header not found.
0x000000620000-0x000003f20000 : “NOR Root File System 57M”
ftl_cs: FTL header not found.
0x000003f20000-0x000003f40000 : “NOR U-Boot env 128K”
ftl_cs: FTL header not found.
0x000003f40000-0x000004000000 : “NOR U-Boot Image 768K”
ftl_cs: FTL header not found.解:
以下三个都不要选
Device Drivers ---> <*> Memory Technology Device (MTD) support ---> < > FTL (Flash Translation Layer) support < > NFTL (NAND Flash Translation Layer) support < > INFTL (Inverse NAND Flash Translation Layer) support
即可启动成功
裁剪和移植
根据单板,裁剪掉不需要的
[ ] SPI support ----
[ ] USB support ----
声卡禁用
Device Drivers --->
< > Sound card support ----
gpio
默认是支持gpio控制的,但是没有/sys/class/gpio/...
系统接口,选中下面选项。
Device Drivers --->
[*] GPIO Support --->
[*] /sys/class/gpio/... (sysfs interface)
支持jffs2文件系统,需取消ram文件系统选项
General setup --->
[ ] Initial RAM filesystem and RAM disk (initramfs/initrd) support
保存单板配置
$ make savedefconfig
$ mv defconfig arch/powerpc/configs/p1020ndae_defconfig