Firefly开源社区
标题:
u-boot如何手动命令烧写到sd卡,并从sd卡启动
[打印本页]
作者:
huawei_d
时间:
2017-3-31 15:28
标题:
u-boot如何手动命令烧写到sd卡,并从sd卡启动
咨询下,我想从sd卡启动,然后使用命令,手动烧写到sd卡,不想使用那个自带的脚本。但是烧写后,没法启动呀,是不是和rk3399的启动有关呀
作者:
huawei_d
时间:
2017-3-31 15:50
SYSTEM=${OUT}/system.img
rm -rf ${SYSTEM}
echo "Generate System image : ${SYSTEM} !"
dd if=/dev/zero of=${SYSTEM} bs=1M count=0 seek=$SIZE
parted -s ${SYSTEM} mklabel gpt
parted -s ${SYSTEM} unit s mkpart loader1 ${LOADER1_START} `expr ${RESERVED1_START} - 1`
parted -s ${SYSTEM} unit s mkpart reserved1 ${RESERVED1_START} `expr ${RESERVED2_START} - 1`
parted -s ${SYSTEM} unit s mkpart reserved2 ${RESERVED2_START} `expr ${LOADER2_START} - 1`
parted -s ${SYSTEM} unit s mkpart loader2 ${LOADER2_START} `expr ${ATF_START} - 1`
parted -s ${SYSTEM} unit s mkpart atf ${ATF_START} `expr ${BOOT_START} - 1`
parted -s ${SYSTEM} unit s mkpart boot ${BOOT_START} `expr ${ROOTFS_START} - 1`
parted -s ${SYSTEM} set 6 boot on
parted -s ${SYSTEM} unit s mkpart root ${ROOTFS_START} 100%
# burn u-boot
if [ "$CHIP" == "rk3288" ] || [ "$CHIP" == "rk3036" ]; then
dd if=${OUT}/u-boot/u-boot.out of=${SYSTEM} seek=${LOADER1_START} conv=notrunc
elif [ "$CHIP" == "rk3399" ]; then
dd if=${LOCALPATH}/rkbin/rk33/RK3399MiniLoaderAll_V1.05.bin of=${SYSTEM} seek=${LOADER1_START} conv=notrunc
dd if=${OUT}/u-boot/uboot.img of=${SYSTEM} seek=${LOADER2_START} conv=notrunc
dd if=${OUT}/u-boot/trust.img of=${SYSTEM} seek=${ATF_START} conv=notrunc
elif [ "$CHIP" == "rk3328" ]; then
dd if=${LOCALPATH}/rkbin/rk33/RK3328MiniLoaderAll_V1.05.bin of=${SYSTEM} seek=${LOADER1_START} conv=notrunc
dd if=${OUT}/u-boot/uboot.img of=${SYSTEM} seek=${LOADER2_START} conv=notrunc
dd if=${OUT}/u-boot/trust.img of=${SYSTEM} seek=${ATF_START} conv=notrunc
fi
# burn boot image
if [ ! -e ${OUT}/boot.img ] ; then
echo -e "\e[31m CAN'T FIND BOOT IMAGE \e[0m"
exit
fi
dd if=${OUT}/boot.img of=${SYSTEM} conv=notrunc seek=${BOOT_START}
# burn rootfs image
if [ ! -e ${ROOTFS_PATH} ] ; then
echo -e "\e[31m CAN'T FIND ROOTFS IMAGE \e[0m"
exit
fi
dd if=${ROOTFS_PATH} of=${SYSTEM} seek=${ROOTFS_START}
}
通过这种方式来烧写的sd卡,
loaderimage --pack --uboot ./u-boot-dtb.bin uboot.img
cd ../
$TOOLPATH/trust_merger $TOOLPATH/RK3399TRUST.ini
cd ${LOCALPATH}/u-boot
cp uboot.img ${OUT}/u-boot/
mv ../trust.img ${OUT}/u-boot/
通过这种方式来制作的uboot
这个过程有什么问题吗?有没有人指导一下呀
作者:
bufferman0823
时间:
2021-8-24 17:38
解决了吗?
把emmc给擦了后。 怎么从sd启动?
欢迎光临 Firefly开源社区 (https://dev.t-firefly.com/)
Powered by Discuz! X3.1