nvidia xavier nx平台使用system.img编写分区APP出错调试

free-jdx 2021-04-23 15:54:21 7869
1. 前言

由于xavir nx平台刷完机后,还需要按照很多依赖软件;
例如: opencv等等图像相关的软件;
如果一台一台刷机再安装的话,效率就会很低;
这里通过使用RCM模式,进行多台机器直接刷软件,可以减少重复安装软件的时间,提升效率;
但是调试过程中出现一些问题,记录如下

2. 刷机流程

这里是整体刷机,步骤如下:
(1)在第一个xavier nx生产模块上安装所有必要的软件

(2)进入Jetson Xavier NX flash目录
cd ~/nvidia/nvidia_sdk/JetPack_4.4.1_Linux_JETSON_XAVIER_NX/Linux_for_Tegra

(3)连接第一个xavier nx设备& 安装所有必要的软件,并把它放入RCM模式。
sudo ./nvmassflashgen.sh jetson-xavier-nx-devkit-emmc mmcblk0p1

(4)解压缩生成的文件
tar xvjf mfi_jetson-xavier-nx-devkit-emmc.tbz2

(5)进入解压文件目录
cd mfi_jetson-xavier-nx-devkit-emmc

(6)断开连接的第一个xavier nx生产模块

(7)连接第二个xavier nx生产模块,并将其置于RCM模式
sudo ./nvmflash.sh --showlogs

下面是出错日志输出:

** Boot Rom communication
/home/nitin/nvidia/nvidia_sdk/JetPack_4.4.1_Linux_JETSON_XAVIER_NX/Linux_for_Tegra/mfi_jetson-xavier-nx-devkit-emmc/tegrarcm_v2 --instance 1-9.1 --chip 0x19 0 --rcm rcm_list_signed.xml 
BR_CID: 0x88021911646cf5c924000000130501c0
RCM version 0X190001
Boot Rom communication completed
*** Boot Rom communication succeeded.

*** Checking applet
/home/nitin/nvidia/nvidia_sdk/JetPack_4.4.1_Linux_JETSON_XAVIER_NX/Linux_for_Tegra/mfi_jetson-xavier-nx-devkit-emmc/tegrarcm_v2 --instance 1-9.1 --isapplet
Applet version 01.00.0000
*** Checking applet succeeded.

*** Sending BCTs
/home/nitin/nvidia/nvidia_sdk/JetPack_4.4.1_Linux_JETSON_XAVIER_NX/Linux_for_Tegra/mfi_jetson-xavier-nx-devkit-emmc/tegrarcm_v2 --instance 1-9.1 --download bct_bootrom br_bct_BR.bct --download bct_mb1 mb1_bct_MB1_sigheader.bct.encrypt --download bct_mem mem_rcm_sigheader.bct.encrypt
Applet version 01.00.0000
Sending bct_bootrom
[................................................] 100%
Sending bct_mb1
[................................................] 100%
Sending bct_mem
[................................................] 100%
*** Sending BCTs succeeded.

*** Sending bootloader and pre-requisite binaries
/home/nitin/nvidia/nvidia_sdk/JetPack_4.4.1_Linux_JETSON_XAVIER_NX/Linux_for_Tegra/mfi_jetson-xavier-nx-devkit-emmc/tegrarcm_v2 --instance 1-9.1 --download blob blob.bin
Applet version 01.00.0000
Sending blob
[................................................] 100%
*** Sending bootloader and pre-requisite binaries succeeded.

*** Booting Recovery
/home/nitin/nvidia/nvidia_sdk/JetPack_4.4.1_Linux_JETSON_XAVIER_NX/Linux_for_Tegra/mfi_jetson-xavier-nx-devkit-emmc/tegrarcm_v2 --instance 1-9.1 --boot recovery
Applet version 01.00.0000
*** Booting Recovery succeeded.

*** Checking applet
/home/nitin/nvidia/nvidia_sdk/JetPack_4.4.1_Linux_JETSON_XAVIER_NX/Linux_for_Tegra/mfi_jetson-xavier-nx-devkit-emmc/tegrarcm_v2 --instance 1-9.1 --isapplet

*** Checking CPU bootloader
/home/nitin/nvidia/nvidia_sdk/JetPack_4.4.1_Linux_JETSON_XAVIER_NX/Linux_for_Tegra/mfi_jetson-xavier-nx-devkit-emmc/tegradevflash_v2 --instance 1-9.1 --iscpubl
Bootloader version 01.00.0000
Bootloader version 01.00.0000
*** Checking CPU bootloader succeeded.
ls: cannot access 'mbr_*': No such file or directory
ls: cannot access 'gpt_*': No such file or directory

*** Retrieving storage infomation
/home/nitin/nvidia/nvidia_sdk/JetPack_4.4.1_Linux_JETSON_XAVIER_NX/Linux_for_Tegra/mfi_jetson-xavier-nx-devkit-emmc/tegradevflash_v2 --instance 1-9.1 --oem platformdetails storage storage_info.bin
Bootloader version 01.00.0000
Saved platform info in storage_info.bin
*** Retrieving storage infomation succeeded.

*** Generating GPT
/home/nitin/nvidia/nvidia_sdk/JetPack_4.4.1_Linux_JETSON_XAVIER_NX/Linux_for_Tegra/mfi_jetson-xavier-nx-devkit-emmc/tegraparser_v2 --storageinfo storage_info.bin --generategpt --pt flash.xml.bin
*** Generating GPT succeeded.

*** Flashing the device
/home/nitin/nvidia/nvidia_sdk/JetPack_4.4.1_Linux_JETSON_XAVIER_NX/Linux_for_Tegra/mfi_jetson-xavier-nx-devkit-emmc/tegradevflash_v2 --instance 1-9.1 --pt flash.xml.bin --create
Bootloader version 01.00.0000
Erasing spi: 0 ......... [Done]
Writing partition secondary_gpt with gpt_secondary_3_0.bin
[................................................] 100%

Erasing sdmmc_user: 3 ......... [Done]
Writing partition master_boot_record with mbr_1_3.bin
[................................................] 100%
Writing partition primary_gpt with gpt_primary_1_3.bin
[................................................] 100%
Writing partition secondary_gpt with gpt_secondary_1_3.bin
[................................................] 100%

Writing partition mb1 with mb1_t194_prod_sigheader.bin.encrypt
[................................................] 100%
Writing partition mb1_b with mb1_t194_prod_sigheader.bin.encrypt
[................................................] 100%
Writing partition spe-fw with spe_t194_sigheader.bin.encrypt
[................................................] 100%
Writing partition spe-fw_b with spe_t194_sigheader.bin.encrypt
[................................................] 100%
Writing partition mb2 with nvtboot_t194_sigheader.bin.encrypt
[................................................] 100%
Writing partition mb2_b with nvtboot_t194_sigheader.bin.encrypt
[................................................] 100%
Writing partition mts-preboot with preboot_c10_prod_cr_sigheader.bin.encrypt
[................................................] 100%
Writing partition mts-preboot_b with preboot_c10_prod_cr_sigheader.bin.encrypt
[................................................] 100%
Writing partition mts-mce with mce_c10_prod_cr_sigheader.bin.encrypt
[................................................] 100%
Writing partition mts-mce_b with mce_c10_prod_cr_sigheader.bin.encrypt
[................................................] 100%
Writing partition mts-proper with mts_c10_prod_cr_sigheader.bin.encrypt
[................................................] 100%
Writing partition mts-proper_b with mts_c10_prod_cr_sigheader.bin.encrypt
[................................................] 100%
Writing partition sc7 with warmboot_t194_prod_sigheader.bin.encrypt
[................................................] 100%
Writing partition sc7_b with warmboot_t194_prod_sigheader.bin.encrypt
[................................................] 100%
Writing partition SMD with slot_metadata.bin
[................................................] 100%
Writing partition SMD_b with slot_metadata.bin
[................................................] 100%
Writing partition xusb-fw with xusb_sil_rel_fw
[................................................] 100%
Writing partition xusb-fw_b with xusb_sil_rel_fw
[................................................] 100%
Writing partition cpu-bootloader with cboot_t194_sigheader.bin.encrypt
[................................................] 100%
Writing partition cpu-bootloader_b with cboot_t194_sigheader.bin.encrypt
[................................................] 100%
Writing partition bootloader-dtb with tegra194-p3668-all-p3509-0000_sigheader.dtb.encrypt
[................................................] 100%
Writing partition bootloader-dtb_b with tegra194-p3668-all-p3509-0000_sigheader.dtb.encrypt
[................................................] 100%
Writing partition BMP with bmp.blob
[................................................] 100%
Writing partition BMP_b with bmp.blob
[................................................] 100%
Writing partition secure-os with tos-trusty_t194_sigheader.img.encrypt
[................................................] 100%
Writing partition secure-os_b with tos-trusty_t194_sigheader.img.encrypt
[................................................] 100%
Writing partition eks with eks_sigheader.img.encrypt
[................................................] 100%
Writing partition eks_b with eks_sigheader.img.encrypt
[................................................] 100%
Writing partition adsp-fw with adsp-fw_sigheader.bin.encrypt
[................................................] 100%
Writing partition adsp-fw_b with adsp-fw_sigheader.bin.encrypt
[................................................] 100%
Writing partition rce-fw with camera-rtcpu-rce_sigheader.img.encrypt
[................................................] 100%
Writing partition rce-fw_b with camera-rtcpu-rce_sigheader.img.encrypt
[................................................] 100%
Writing partition bpmp-fw with bpmp_t194_sigheader.bin.encrypt
[................................................] 100%
Writing partition bpmp-fw_b with bpmp_t194_sigheader.bin.encrypt
[................................................] 100%
Writing partition bpmp-fw-dtb with tegra194-a02-bpmp-p3668-a00_sigheader.dtb.encrypt
[................................................] 100%
Writing partition bpmp-fw-dtb_b with tegra194-a02-bpmp-p3668-a00_sigheader.dtb.encrypt
[................................................] 100%
Writing partition VER with qspi_bootblob_ver.txt
[................................................] 100%
Writing partition VER_b with qspi_bootblob_ver.txt
[................................................] 100%
Writing partition master_boot_record with mbr_1_3.bin
[................................................] 100%
Writing partition APP with system.img
*** Error: Flashing the device failed.           ] 031%
3. 排查建议

(1)是否有定制的system.img来替换默认的system.img?
分区大小可能不同,可能需要使用“-S size”选项来指定分区大小。

(2)在哪个步骤需要使用这个-S大小选项,大小的值应该是什么?
检查Flash Script Usage 2,并使用Flash .sh进行验证。

(3)是否可以使用离线方式来执行nvmassflashgen?

4. 查看system.img

从一个Xavier NX生产模块有定制软件安装,创建一个massflash blob,以下有替换:

~/nvidia/nvidia_sdk/JetPack_4.4.1_Linux_JETSON_XAVIER_NX/Linux_for_Tegra/bootloader/system.img
~/nvidia/nvidia_sdk/JetPack_4.4.1_Linux_JETSON_XAVIER_NX/Linux_for_Tegra/mfi_jetson-xavier-nx-devkit-emmc/system.img

根据README_Massflash.txt系统。在mfi_jetson-xavier-nx-devkit-emmc dir中创建的Img应该可以工作,而不需要手动替换任何文件。

5. 文件说明

/bootloader/system.img:
这是flash命令生成的默认系统映像

/mfi_jetson-xavier-nx-devkit-emmc/system.img :
这是由nvmassflashgen.sh脚本生成的。

6. 解决办法

可以使用-r开关来跳过构建和重用现有的system.img。
例如,
$ sudo ./nvmassflashgen.sh -r jetson-xavier-nx mmcblk0p1

使用一个克隆映像来替换默认映像,然后将其部署到其他平台。

(1)按照前面提到的所有步骤生成mfi_jetson-xavier-nx-devkit-emmc目录,然后使用命令创建设备的克隆

sudo ./flash.sh -r -k APP -G backup.img jetson-xavier-nx-devkit-emmc mmcblk0p1

之后我替换了这个system.img

(2)在mfi_jetson-xavier-nx-devkit-emmc目录下使用命令

cp backup.img mfi_jetson-xavier-nx-devkit-emmc/system.img

(3) 最后连接两个Xavier NX把它们放到RCM中,
运行

sudo ./nvmflash.sh——showlogs

它没有任何错误,正常flash两个设备。

7. 非生产nx devkit版本是否支持nvmassflash脚本?

不支持,massflash只支持eMMC模块。

如果使用带有外部存储的Jetson Xavier NX(即NVMe),那么有一个工具可以支持这一功能。查看下面的详细信息。

$OUT/JetPack-4.5.1/Linux_for_Tegra/tools/kernel_flash/README.txt

声明:本文内容由易百纳平台入驻作者撰写,文章观点仅代表作者本人,不代表易百纳立场。如有内容侵权或者其他问题,请联系本站进行删除。
free-jdx
红包 93 8 评论 打赏
评论
0个
内容存在敏感词
手气红包
    易百纳技术社区暂无数据
相关专栏
置顶时间设置
结束时间
删除原因
  • 广告/SPAM
  • 恶意灌水
  • 违规内容
  • 文不对题
  • 重复发帖
打赏作者
易百纳技术社区
free-jdx
您的支持将鼓励我继续创作!
打赏金额:
¥1易百纳技术社区
¥5易百纳技术社区
¥10易百纳技术社区
¥50易百纳技术社区
¥100易百纳技术社区
支付方式:
微信支付
支付宝支付
易百纳技术社区微信支付
易百纳技术社区
打赏成功!

感谢您的打赏,如若您也想被打赏,可前往 发表专栏 哦~

举报反馈

举报类型

  • 内容涉黄/赌/毒
  • 内容侵权/抄袭
  • 政治相关
  • 涉嫌广告
  • 侮辱谩骂
  • 其他

详细说明

审核成功

发布时间设置
发布时间:
是否关联周任务-专栏模块

审核失败

失败原因
备注
拼手气红包 红包规则
祝福语
恭喜发财,大吉大利!
红包金额
红包最小金额不能低于5元
红包数量
红包数量范围10~50个
余额支付
当前余额:
可前往问答、专栏板块获取收益 去获取
取 消 确 定

小包子的红包

恭喜发财,大吉大利

已领取20/40,共1.6元 红包规则

    易百纳技术社区