1. 前言
SMD分区已损坏。
我不确定损坏的根本原因是什么, 但我认为全刷机应该能够解决这个问题
root@ws-nxcore:/etc/waggle# nvbootctrl dump-slots-info primary SMD is corrupted! secondary SMD is corrupted! # nvbootctrl get-number-slots primary SMD is corrupted! secondary SMD is corrupted! -5 root@ws-nxcore:~# nvbootctrl get-suffix 0 root@ws-nxcore:~# nvbootctrl get-suffix 1 _b
我不能100%确定这是什么时候开始发生的 (因为我不经常检查SMD分区)
但我相信它是在我开始使用它./nvmassflashgen.sh脚本开始生成MFI构建时。
提供给./nvmassflashgen.sh的BOARDID等待参数可能与此有关吗?
我一直在想,对于一个非非devkit的Xavier NX,什么是正确的值?
README_Massflash.txt文件指定为jetson-xavier-nx-devkit-emmc他们应该是:
BOARDID=3668 BOARDSKU=0001 FAB=100 BOARDREV=N/A
因为我用的是ConnectTech Photon载波板,我选择了不同的值:
BOARDID="NGX003" BOARDSKU="0000" FAB="000" \ BOARDREV="E.0" FUSELEVEL="fuselevel_production" \ ./nvmassflashgen.sh waggle_photon mmcblk0p1
然而,试图恢复系统执行一个完整的flash (sudo ./flash.sh cti/xavier-nx/photon mmcblk0p1) 没有解决我的问题。
我犯了类似的错误:
jswantek@jswantek-desktop:~$ nvbootctrl dump-slots-info Fail to open metadata file Init SMD partition failed! Fail to open metadata file jswantek@jswantek-desktop:~$ nvbootctrl get-number-slots Fail to open metadata file Init SMD partition failed! Fail to open metadata file -5 jswantek@jswantek-desktop:~$ nvbootctrl get-suffix 0 Fail to open metadata file Init SMD partition failed! jswantek@jswantek-desktop:~$ nvbootctrl get-suffix 1 Fail to open metadata file Init SMD partition failed! _b
2. 检查方向
(1)是否启用Bootloader更新和冗余功能? 可参考开发人员指南,Bootloader更新和冗余。
(2)检查EEPROM 此外,还有Jetson模块EEPROM用于保存板信息的布局,可检查如下, 例如:$ i2cump -f -y 0 0x50
3. 调试记录
修改后的成功使用smd_info.cfg和slot_metadata.bin启用A/B支持和冗余:
(1)创建以下命令slot_metadata.bin
./nv_smd_generator smd_info.cfg slot_metadata.bin
(2)将slot_metadata.bin放入该目录
Linux_for_Tegra/bootloader/on my x86 flashing machine
(3)./flash.sh (4)然后我看到冗余被启用了
root@nx-sample-token:~# nvbootctrl dump-slots-info magic:0x43424e00, version: 3 features: 3 num_slots: 2 slot: 0, priority: 15, suffix: _a, retry_count: 7, boot_successful: 1 slot: 1, priority: 14, suffix: _b, retry_count: 7, boot_successful: 1
(5)然后我就可以执行这样的命令了
nvbootctrl set-active-boot-slot 1, nvbootctrl dump-slots-info, nv_update_engine -d(to disable redundancy), nvbootctrl set-active-boot-slot 0, nv_update_engine -v, nv_update_engine -e
在上述步骤和下列步骤之间的某个时刻, 我的SMD出了问题,我解决不了。
我现在执行的步骤是启用A/B支持和引导加载程序冗余如下:
(1)创建smd_info.cfg,使用引导加载程序启用A/B支持
(2)将smd_info.cfg复制到我的Linux_for_Tegra/引导加载程序
(3)刷机
对于i2cdump,感谢您提供的信息。
我不知道还有一个小的eeprom设备。
我执行了转储,它输出了以下内容,稍后我将对这些内容进行更深入的研究。
@jswantek-desktop:~$ i2cdump -f -y 0 0x50 No size specified (using byte-data access) 0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef 00: 01 00 fc 00 54 0e 01 00 02 47 00 00 00 00 00 00 ?.?.?.T??.?G... 10: 00 00 00 00 36 39 39 2d 31 33 36 36 38 2d 30 30 ...699-13668-00 20: 30 31 2d 32 30 30 20 47 2e 30 00 00 00 00 00 00 01-200 G.0... 30: 00 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ... 40: ff ff ff ff a4 a0 05 2d b0 48 31 34 32 31 33 32 ..????-?H142132 50: 30 30 30 34 36 34 39 00 00 00 00 00 00 00 00 00 0004649... 60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... 70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... 80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... 90: 00 00 00 00 00 00 4e 56 43 42 1c 00 4d 31 00 00 ...NVCB?.M1.. a0: ff ff ff ff ff ff ff ff ff ff ff ff a4 a0 05 2d ..?.M1.. a0: ff ff ff ff ff ff ff ff ff ff ff ff a4 a0 05 2d .???- b0: b0 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ?H... c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ee ...
要缩小问题范围,可以从目标设备/etc/nv_boot_control.conf查看设备规格信息
sudo FAB=400 BOARDID=2888 FUSELEVEL=fuselevel_production ./build_l4t_bup.sh jetson-xavier mmcblk0p1例如:$ sudo FAB=400 BOARDID=2888 FUSELEVEL=fuselevel_production ./build_l4t_bup.sh jetson-xavier mmcblk0p1 ./
测试结果
root@ws-nxcore:~# cat /etc/nv_boot_control.conf TNSPEC 3668-200-0001-G.0-1-0-waggle_photon-mmcblk0p1 TEGRA_CHIPID 0x19 TEGRA_OTA_BOOT_DEVICE /dev/mmcblk0boot0 TEGRA_OTA_GPT_DEVICE /dev/mmcblk0boot1
执行build_l4t_bup.sh
find bootloader/ | grep bl_update $ $ sudo FAB=200 BORDID=3668 FUSELEVEL=fuselevel_production ./build_l4t_bup.sh waggle_photon mmcblk0p1
...
Payloads saved to "/home/jswantek/workspace/custom_builds/eeprom07/full/bootloader/payloads_t19x/"
当尝试flash这些时:
root@ws-nxcore:/opt/ota_package# ls -la bl_update_payload
-rw-r--r-- 1 root root 47658847 Mar 8 22:08 bl_update_payload
root@ws-nxcore:~# nv_update_engine --install
Nvidia A/B-Redundancy Update tool Version 1.2
primary SMD is corrupted!
secondary SMD is corrupted!
A/B has been disabled. Need to enable A/B.
waggle_photon.conf文件的内容:
source "${LDK_DIR}/p3668.cti-base.common";
DTB_FILE=tegra194-xavier-nx-cti-NGX003-WAGGLE-WS.dtb;
EMMC_CFG=flash_waggle_l4t_t194_spi_emmc_p3668.xml;
EMMCSIZE=17179869184;
ROOTFSSIZE=10GiB;
唯一的变化是tegra194-xavier-nx-cti-NGX003-WAGGLE-WS。DTB文件与flash_waggle_l4t_t194_spi_emmc_p3668.xml比较如下
@ubuntu-laptop:~/workspace/custom_builds/eeprom07/full/bootloader/t186ref/cfg$ diff flash_waggle_l4t_t194_spi_emmc_p3668.xml flash_l4t_t194_spi_emmc_p3668.xml
628,638d627
< <partition name="WAGGLE-RPI" type="data">
< <allocation_policy> sequential </allocation_policy>
< <filesystem_type> basic </filesystem_type>
< <size> 4294967296 </size>
< <file_system_attribute> 0 </file_system_attribute>
< <allocation_attribute> 0x8 </allocation_attribute>
< <align_boundary> 4096 </align_boundary>
< <percent_reserved> 0 </percent_reserved>
< <filename> waggle-rpi.img </filename>
< <description> **Required.** Contains the Waggle Raspberry PI PXE boot filesystem </description>
< </partition>
现在看一下p3668.cti-base.common文件与p3668.conf.common文件中的增量比较有趣
@ubuntu-laptop:~/workspace/custom_builds/eeprom07/full$ diff p3668.conf.common p3668.cti-base.common
1c1
< # Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
---
> # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
42,55d41
< # Process_board_version:
< # Trigger to read the board id and board version from EEPROM on main board.
< # undef for non eeprom boards.
< process_board_version()
< {
< local board_id="${1}";
< local board_version="${2}";
< local board_sku="${3}";
< local board_revision="${4}";
< local chiprev="${5}";
<
< print_board_version "${board_id}" "${board_version}" "${board_sku}" "${board_revision}" "${chiprev}"
< }
<
101c87
< DTB_FILE=tegra194-p3668-all-p3509-0000.dtb;
---
> #DTB_FILE=tegra194-p3668-all-p3509-0000.dtb;
141c127
< PINMUX_CONFIG="tegra19x-mb1-pinmux-p3668-a01.cfg";
---
> PINMUX_CONFIG="tegra19x-xavier-nx-cti-mb1-pinmux-p3668-a01.cfg";
143c129
< PMC_CONFIG="tegra19x-mb1-padvoltage-p3668-a01.cfg";
---
> PMC_CONFIG="tegra19x-mb1-padvoltage-p3668-0001-a00.cfg";
158,159d143
< OTA_BOOT_DEVICE="/dev/mtdblock0";
< OTA_GPT_DEVICE="/dev/mtdblock0";
还注意到tegra19x-mb1-padvoltage-p3668-0001-a00.cfg不存在。
假设这是ConnectTech p3668.cti-base.common文件中的一个错误, 值应该是PMC_CONFIG="tegra19x-mb1- padvolage -p3668-a01.cfg";
似乎我能够正确地生成bl_update_payload,但仍然无法刷机
4. 修改waggle_photon.conf
在waggle_photon.conf文件中做了一个更改, 以确保PMC_CONFIG变量被正确设置, 并确保OTA_BOOT_DEVICE和OTA_GPT_DEVICE被设置。
source "${LDK_DIR}/p3668.conf.common";
DTB_FILE=tegra194-xavier-nx-cti-NGX003-WAGGLE-WS.dtb;
EMMC_CFG=flash_waggle_l4t_t194_spi_emmc_p3668.xml;
EMMCSIZE=17179869184;
ROOTFSSIZE=10GiB;
# WORK-AROUND: bring-in CTI specific changes from p3668.cti-base.common (compared to p3668.conf.common)
PINMUX_CONFIG="tegra19x-xavier-nx-cti-mb1-pinmux-p3668-a01.cfg";
SMD分区看起来固定了
root@ws-nxcore:~# nvbootctrl dump-slots-info
magic:0x43424e00, version: 3 features: 1 num_slots: 2
slot: 0, priority: 15, suffix: _a, retry_count: 7, boot_successful: 1
slot: 1, priority: 14, suffix: _b, retry_count: 7, boot_successful: 1
看到/etc/nv_boot_control.conf的内容看起来像 TEGRA_OTA_BOOT_DEVICE和TEGRA_OTA_GPT_DEVICE有不同的值
Before:
root@ws-nxcore:~# cat /etc/nv_boot_control.conf
TNSPEC 3668-200-0001-G.0-1-0-waggle_photon-mmcblk0p1
TEGRA_CHIPID 0x19
TEGRA_OTA_BOOT_DEVICE /dev/mmcblk0boot0
TEGRA_OTA_GPT_DEVICE /dev/mmcblk0boot1
After
root@ws-nxcore:~# cat /etc/nv_boot_control.conf
TNSPEC 3668-200-0001-G.0-1-0-waggle_photon-mmcblk0p1
TEGRA_CHIPID 0x19
TEGRA_OTA_BOOT_DEVICE /dev/mtdblock0
TEGRA_OTA_GPT_DEVICE /dev/mtdblock0