关于SS928评估板学习(五):编译操作方法
一、安装SDK补丁包
在SS928V100R001***\02.only for reference\software目录下,找到SS928V100_REF_Vx.x.x.x.tgz补丁包,和安装脚本ref_patch.sh,将其拷贝到虚拟机SDK同级目录下;解压并安装补丁包:
tar -zxvf SS928V100_REF_Vx.x.x.x.tgz
./ref_patch.sh
- 1
- 2
二、编译SDK包
进入SS928V100_SDK_Vx.x.x.x/osdrv目录下,查看readme.txt文件中详细的交叉编译步骤,对SDK包进行初次编译,更为详细的编译步骤于《SS928V100 U-boot 移植应用开发指南.pdf》、《SS928V100 开发环境用户指南.pdf》两文档中有所描述,具体目录位于:
SS928V100*\ReleaseDoc\zh\01.software\board\OSDRV\
注:整体编译会同时编译LiteOS,编译LiteOS需要安装的工具包括 python、pip 和 kconfiglib,可参考《LiteOS 开发指南.pdf》中第 8.2 章节文档进行 LiteOS 编译环境的配置;
如果不需要编译LiteOS,建议单独编译Uboot、kernel、rootfs;
1.编译整个osdrv目录:
make all
默认编译:
make BOOT_MEDIA=spi all
参数说明:
BOOT_MEDIA:spi nor或spi nand启动选择spi;并口nand启动选择nand;emmc启动选择emmc
2.清除整个osdrv目录的编译文件:
make clean
3.彻底清除整个osdrv目录的编译中间文件:
make distclean
4.单独编译kernel image:
a.进入open_source/linux目录,执行以下操作
tar xf linux-4.19.90.tar.gz
mv linux-4.19.90 linux-4.19.y
cd linux-4.19.y
patch -p1 < ../linux-4.19.90.patch
cp arch/arm64/configs/ss928v100_defconfig .config
- 1
- 2
- 3
- 4
- 5
(emmc启动时执行如下操作: cp arch/arm64/configs/ss928v100_emmc_defconfig .config
)
(并口 nand 启动时执行如下操作: cp arch/arm64/configs/ss928v100_nand_defconfig .config
)
make ARCH=arm64 CROSS_COMPILE=aarch64-mix210-linux- menuconfig
make ARCH=arm64 CROSS_COMPILE=aarch64-mix210-linux- uImage -j 20
- 1
- 2
b.进入open_source/trusted-firmware-a/trusted-firmware-a-2.2目录,
执行mk.sh脚本(参考主Makefile中atf命令进行适配):
chmod 777 mk_ss928v100.sh
./mk_ss928v100.sh
- 1
- 2
在open_source/trusted-firmware-a/trusted-firmware-a-2.2/build/ss928v100/release目录下,生成的fip.bin文件就是ATF+kernle的镜像.
5.单独编译快速启动的uboot或非安全启动的Boot Image:
注意:发布包默认按照 DEMO 板的配置发布,如果客户单板和 DEMO 板不一致,需要根据客户自己的单板环境修改uboot表格才能使用,否则可能导致uboot无法启动或者其他问题。flash启动采用SS928V100_demo_8L_LPDDR4x_3733M-8GB_32bitx2-A55_1400M.xlsm表格,emmc启动采用SS928V100_demo_8L_LPDDR4x_3733M-8GB_32bitx2-A55_1400M-emmc.xlsm表格。
a.进入uboot源代码目录后,执行以下操作:
tar xf u-boot-2020.01.tar.bz2
cd u-boot-2020.01
patch -p1 < ../u-boot-2020.01.patch
cp configs/ss928v100_defconfig .config(仅用于 spi nor/nand flash)
- 1
- 2
- 3
- 4
(emmc启动时执行如下操作: cp configs/ss928v100_emmc_defconfig .config
)
(并口 nand 启动时执行如下操作: cp configs/ss928v100_nand_defconfig .config
)
make ARCH=arm CROSS_COMPILE=aarch64-mix210-linux- menuconfig
make ARCH=arm CROSS_COMPILE=aarch64-mix210-linux- -j 20
- 1
- 2
Windows下进入到osdrv/tools/pc/uboot_tools/目录下打开对应单板的Excel文件,在main标签中点击"Generate reg bin file"按钮,生成reg_info.bin即为对应平台的表格文件。
从tools/pc/uboot_tools目录拷贝reg_info.bin到boot源代码目录,重命名为.reg
cp ../../../osdrv/tools/pc/uboot_tools/reg_info.bin .reg
make ARCH=arm CROSS_COMPILE=aarch64-mix210-linux- u-boot-z.bin
- 1
- 2
open_source/uboot/u-boot-2020.01下生成的u-boot-ss928v100.bin即为“快速启动”使用的u-boot镜像
b.对于“非安全启动”方案,还需要进入osdrv/components/目录,执行以下操作来制作 Boot Image:
tar xf boot.tar.gz
cd boot/gsl/
make CHIP=ss928v100
cd ../image_map/
cp ../gsl/pub/gsl.bin ./
cp ../../../../open_source/u-boot/u-boot-2020.01/u-boot-ss928v100.bin ./u-boot-original.bin
cp ../../../../open_source/u-boot/u-boot-2020.01/.reg ./
python3 oem/oem_quick_build.py
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
osdrv/components/boot/image_map/image/oem/下生成的boot_image.bin即为“非安全启动”使用的Boot Image。
6.制作文件系统镜像:
在osdrv/pub/中有已经编译好的文件系统,因此无需再重复编译文件系统,只需要根据单板上启动介质的规格型号制作文件系统镜像即可。
spi flash使用jffs2格式的镜像,制作jffs2镜像时,需要用到spi flash的块大小。这些信息会在uboot启动时会打印出来。建议使用时先直接运行mkfs.jffs2工具,根据打印信息填写相关参数。下面以块大小为64KB为例:
osdrv/pub/bin/pc/mkfs.jffs2 -d osdrv/pub/rootfs_glibc_xxx -l -e 0x10000 -o osdrv/pub/rootfs_ss928v100_64k.jffs2
nand flash使用ubifs格式的镜像,制作ubifs镜像时,需要用到nand flash的pagesize和blocksize。这些信息会在uboot启动时会打印出来。
下面以2KB pagesize、128KB block size为例:
./tools/pc/ubi_sh/mkubiimg.sh ss928v100 2k 128k osdrv/pub/rootfs_glibc_xxx 32M osdrv/pub/bin/pc
emmc 使用ext4格式的镜像:以96MB镜像为例:
dd if=/dev/zero of=osdrv/pub/ss928v100_image_glibc/rootfs_ss928v100_96M.ext4 bs=512 count=196608
备注:(196608 = 96 1024 1024 / 512)
./osdrv/pub/bin/pc/mkfs.ext4 osdrv/pub/ss928v100_image_glibc/rootfs_ss928v100_96M.ext4
cd open_source/e2fsprogs/out/pc/contrib
./populate-extfs.sh ../../../../../osdrv/pub/rootfs_glibc_arm64 ../../../../../osdrv/pub/ss928v100_image_glibc/rootfs_ss928v100_96M.ext4
- 1
- 2
- 3
- 分享
- 举报

-
浏览量:5262次2022-09-20 15:23:26
-
浏览量:4085次2022-09-22 11:37:57
-
浏览量:6703次2022-09-16 15:39:40
-
浏览量:14614次2022-09-15 15:54:04
-
浏览量:6145次2022-09-19 14:17:36
-
浏览量:6011次2022-09-23 09:10:47
-
浏览量:4530次2022-09-26 09:49:49
-
浏览量:2339次2022-12-13 16:59:00
-
浏览量:752次2024-09-13 17:34:13
-
浏览量:11254次2022-11-10 18:07:40
-
浏览量:909次2023-09-09 13:40:42
-
浏览量:4325次2023-04-12 16:05:14
-
浏览量:3820次2024-03-14 14:15:25
-
浏览量:1579次2024-06-06 10:17:20
-
浏览量:1757次2022-12-13 16:47:02
-
浏览量:4700次2022-10-10 15:32:19
-
浏览量:2823次2023-03-02 14:55:43
-
浏览量:1615次2023-10-28 16:08:09
-
浏览量:6617次2022-11-10 14:33:49
-
广告/SPAM
-
恶意灌水
-
违规内容
-
文不对题
-
重复发帖

Debug






举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明