Thor flash in usb

hi,我们custom board 发现PCIE 连接的NVME硬盘有一些问题导致在烧录过程中无法识别到nvme0n1,因为usb口可以识别,我们想要在烧录时把系统烧录到external usb硬盘中,识别到的硬盘为/dev/sda,请问把系统烧录到usb硬盘中方案可行吗?我没有找到对应的方法,您可以给出烧录命令吗?
硬件为:t5000
软件:JetPack7.0 r38.2.1

Linux_for_Tegra/tools/kernel_flash/README_initrd_flash.txt

Flash USB-connected storage use APP partition on it as root filesystem

sudo ADDITIONAL_DTB_OVERLAY_OPT="BootOrderUsb.dtbo" BOARDID=3834 FAB= BOARDSKU=0008 BOARDREV= ./l4t_initrd_flash.sh \
--external-device sda1 [ -c ./tools/kernel_flash/flash_l4t_t264_nvme.xml ] --showlogs  jetson-agx-thor-devkit internal

You will need to modify a copy of tools/kernel_flash/flash_l4t_t264_nvme.xml to set it to the usb drive geometry.

hi,我不太理解,我是应该修改flash_l4t_t264_nvme.xml 文件吗?还是要重新命名为flash_l4t_t264_sda.xml ?? 文件内容需要修改吗?

我的usb存储为1T

Now that I look at flash_l4t_t264_nvme.xml I agree you probably can use it as it is / exists.

hi,
能否帮忙看一下报错? 烧录成功但是系统启动失败,flash cmd如下:
因为之前用同样的cmd 不加“–flash-only” 生成过img,所以下面的命令加上了“–flash-only”,这个应该是不影响的。

sudo ADDITIONAL_DTB_OVERLAY_OPT="BootOrderUsb.dtbo"  BOARDID=3834  FAB=400 BOARDSKU=0008 BOARDREV=G.5 CHIP_SKU="00:00:00:A0" ./l4t_initrd_flash.sh  --flash-only --external-device sda1 jetson-agx-thor-devkit  interna

flash cmd 的日志记录如下
flash.log (4.9 MB)

flash cmd 对应的thor的uart打印如下
uart_flash_log.txt (99.6 KB)

flash成功后,开机日志如下,好像rootf挂载失败。

uart_startup_log.txt (120.5 KB)

yes,我现在就使用的默认的nvme_xml

The errors at the bottom from uart_startup_log.txt seem to indicate a kernel version mismatch. That the kernel module you are trying to load (pcie_tegra2 or ufs_tegra) was compiled for a different kernel version (or configuration) than the “uname -r” kernel

Because of that all of these fail:

PCIe (pcie_tegra264, pcie_tegra194, phy_tegra194_p2u)
NVMe (nvme_core)
USB Type-C/UCSI (typec, typec_ucsi, ucsi_ccg)
UAS (uas)
xUDC gadget (tegra-xudc)
thermal / pwm / fan modules (tegra_bpmp_thermal, pwm_tegra, pwm_fan)
UFS (ufs_tegra)

Try this on these modules in your rootfs to see if vermagic is identical
modinfo /lib/modules/6.8.12-tegra/updates/drivers/pci/controller/pcie-tegra264.ko | egrep -i ‘vermagic|filename’
modinfo /lib/modules/6.8.12-tegra/kernel/drivers/usb/storage/uas.ko | egrep -i ‘vermagic|filename’

insmod /lib/modules/6.8.12-tegra/updates/drivers/pci/controller/pcie-tegra264.ko 
[    5.601990] pcie_tegra264: disagrees about version of symbol module_layout
modprobe: ERROR: could not insert 'pcie_tegra2[    5.611269] ufs_tegra: disagrees about version of symbol module_layout
64': Exec format error
insmod /lib/modules/6.8.12-te[    5.623544] pcie_tegra194: disagrees about version of symbol module_layout
gra/updates/drivers/scsi/ufs/ufs-tegra.ko 
m[    5.630575] phy_tegra194_p2u: disagrees about version of symbol module_layout
odprobe: ERROR: could not insert 'ufs_tegra': Exec format error
insmod /lib/modules/6.8.12-tegra/kernel/drivers/pci/controller/dwc/pcie-tegra194.ko 
modprobe: ERROR: could not inse[    5.656271] nvme_core: disagrees about version of symbol module_layout
rt 'pcie_tegra194': Exec format error
insmod /lib/mo[    5.669674] typec: disagrees about version of symbol module_layout
dules/6.8.12-tegra/kernel/drivers/phy/tegra/phy-tegra194-[    5.680638] typec: disagrees about version of symbol module_layout
p2u.ko 
modprobe: ERROR: could not insert 'phy_t[    5.691398] typec: disagrees about version of symbol module_layout
egra194_p2u': Exec format error
insmod /lib/modu[    5.697565] uas: disagrees about version ofles/6.8.12-tegra/kernel/drivers/nvme/host/nv[    5.711799] tegra_xudc: disagrees about version of symbol module_layout
me-core.ko 
modprobe: ERROR: could not inse[    5.716458] tegra_bpmp_thermal: disagrees about version of symbol module_layout
rt 'nvme': Exec format error
insmod /lib/module[    5.728570] pwm_tegra: disagrees about version of symbol module_layout
s/6.8.12-tegra/kernel/drivers/usb/typec/typec[    5.739073] pw.ko n: disagrees about version of symbol module_layout
modprobe: ERROR: could not insert 'typec': Exec format error
insmod /lib/modules/6.8.12-tegra/kernel/drivers/usb/typec/typec.ko 
modprobe: ERROR: could not insert 'typec_ucsi': Exec format error
insmod /lib/modules/6.8.12-tegra/kernel/drivers/usb/typec/typec.ko 
modprobe: ERROR: could not insert 'ucsi_ccg': Exec format error
insmod /lib/modules/6.8.12-tegra/kernel/drivers/usb/storage/uas.ko 
modprobe: ERROR: could not insert 'uas': Exec format error
insmod /lib/modules/6.8.12-tegra/kernel/drivers/usb/gadget/udc/tegra-xudc.ko 
modprobe: ERROR: could not insert 'tegra_xudc': Exec format error
insmod /lib/modules/6.8.12-tegra/kernel/drivers/thermal/tegra/tegra-bpmp-thermal.ko 
modprobe: ERROR: could not insert 'tegra_bpmp_thermal': Exec format error
insmod /lib/module[    5.822786] usb 2-1: new SuperSpeed Plus Gen 2x1 USB device number 2 using tegra-xusb
s/6.8.12-tegra/kernel/drivers/pwm/pwm-tegra.ko 
modprobe: ERROR: could not insert 'pwm_tegra': Exec format error
insmod /lib/modules/6.8.12-tegra/kernel/drivers/hwmon/pwm-fan.ko 
modprobe: ERROR: could not insert 'pwm_fan': Exec format error

Hi 1967760537,

Please also verify with the latest Jetpack 7.1(r38.4.0).

To flash into external USB storage, you can refer to Workflow 3: How to flash to an external storage of <Linux_for_Tegra>/tools/kernel_flash/README_initrd_flash.txt

Do you update the custom kernel? If so, have you performed sudo -E make modules_install to install the kernel modules?

没有更新kernel

请问这是使用sda还是sda1?

使用JP7.1 烧录在sda中。
请问如何在L4T/rootfs中禁止nvme驱动,因为板载nvme接口有问题,所以在启动的时候一直打印。

[   13.281268] audit: type=1400 audit(31.060:2): apparmor="STATUS" operation="profile_load" profile="unconfined" name="cam" pid=713 comm="apparmor_parser"
[   13.282487] audit: type=1400 audit(31.060:3): apparmor="STATUS" operation="profile_load" profile="unconfined" name="buildah" pid=711 comm="apparmor_parser"
[   13.283788] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[   13.304967] Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[   13.308920] Loaded X.509 cert 'wens: 61c038651aabdcf94bd0ac7ff06c7248db18c600'
��VM 8001: I/TC: WARNING (insecure configuration): Failed to commit dirh counter 79
��[   13.812430] 
[   13.997271] nvme nvme0: request 0x13 genctr mismatch (got 0x5 expected 0x6)
[   13.997903] nvme nvme0: invalid id 20499 completed on queue 0
[   13.998370] nvme nvme0: request 0x13 genctr mismatch (got 0x5 expected 0x6)
[   14.003333] nvme nvme0: invalid id 20499 completed on queue 0
[   14.009256] nvme nvme0: request 0x13 genctr mismatch (got 0x5 expected 0x6)
[   14.016238] nvme nvme0: invalid id 20499 completed on queue 0
[   14.021814] nvme nvme0: request 0x13 genctr mismatch (got 0x5 expected 0x6)
[   14.028794] nvme nvme0: invalid id 20499 completed on queue 0
[   14.034726] nvme nvme0: request 0x13 genctr mismatch (got 0x5 expected 0x6)
[   14.041715] nvme nvme0: invalid id 20499 completed on queue 0
[   14.047292] nvme nvme0: request 0x13 genctr mismatch (got 0x5 expected 0x6)
[   14.054270] nvme nvme0: invalid id 20499 completed on queue 0
[   14.060210] nvme nvme0: request 0x13 genctr mismatch (got 0x5 expected 0x6)
[   14.067187] nvme nvme0: invalid id 20499 completed on queue 0
[   14.072767] nvme nvme0: request 0x13 genctr mismatch (got 0x5 expected 0x6)
[   14.079753] nvme nvme0: invalid id 20499 completed on queue 0
[   14.085683] nvme nvme0: request 0x13 genctr mismatch (got 0x5 expected 0x6)
[   14.092664] nvme nvme0: invalid id 20499 completed on queue 0
[   14.098252] nvme nvme0: request 0x13 genctr mismatch (got 0x5 expected 0x6)

It might be sufficient to do these 2 before flash. Hopefully @KevinFFF will correct or add to this if needed.

  1. To keep nvme libraries from loading.

sudo tee /etc/modprobe.d/blacklist-nvme.conf >/dev/null <<‘EOF’
blacklist nvme
blacklist nvme_core
EOF


  1. To turn off dev kit pcie

dtc -I dtb -O dts -o board.dts bootloader/tegra264-p4071-0000+p3834-0008-nv.dtb

nano board.dts

                pcie@a808480000 {
-                        status = "okay";
+                        status = "disabled";
                        compatible = "nvidia,tegra264-pcie";

dtc -I dts -O dtb -o kernel_tegra264-p4071-0000+p3834-0008-nv.dtb board.dts

cp tegra264-p4071-0000+p3834-0008-nv.dtb kernel/dtb/tegra264-p4071-0000+p3834-0008-nv.dtb
cp tegra264-p4071-0000+p3834-0008-nv.dtb rootfs/boot/tegra264-p4071-0000+p3834-0008-nv.dtb
cp tegra264-p4071-0000+p3834-0008-nv.dtb bootloader/tegra264-p4071-0000+p3834-0008-nv.dtb
1 Like

hi,我使用上述的方法,烧录后依旧无法启动,还是nvme的问题

其中dtb文件如下:
dtb.zip (44.7 KB)
这里我修改了disable,文件已经替换

jyh@jyh-ThinkPad-T14p-Gen-3:/data/workspace/Thor_JP7.1/Linux_for_Tegra$ md5sum tegra264-p4071-0000+p3834-0008-nv.dtb  bootloader/tegra264-p4071-0000+p3834-0008-nv.dtb kernel/dtb/tegra264-p4071-0000+p3834-0008-nv.dtb rootfs/boot/tegra264-p4071-0000+p3834-0008-nv.dtb
b8f5fcead9f5b68f437e19e2de686783  tegra264-p4071-0000+p3834-0008-nv.dtb
b8f5fcead9f5b68f437e19e2de686783  bootloader/tegra264-p4071-0000+p3834-0008-nv.dtb
b8f5fcead9f5b68f437e19e2de686783  kernel/dtb/tegra264-p4071-0000+p3834-0008-nv.dtb
b8f5fcead9f5b68f437e19e2de686783  rootfs/boot/tegra264-p4071-0000+p3834-0008-nv.dtb

jyh@jyh-ThinkPad-T14p-Gen-3:/data/workspace/Thor_JP7.1/Linux_for_Tegra/rootfs/lib/modprobe.d$ cat blacklist-nvme.conf
blacklist nvme
blacklist nvme_core

启动log如下

disable_pcie.log (159.2 KB)

Do you have NVMe SSD connected on your board?
If so, please remove it to prevent it to be initialized.

I would suggest updating the kernel/dtb/tegra264-p4071-0000+p3834-0008-nv.dtb instead as the bootloader/tegra264-p4071-0000+p3834-0008-nv.dtb might be overwritten during flash.

yes,我remove NVME SSD后可以烧录了,很奇怪能帮忙看log是我们的NVME SSD 什么地方出问题了吗?

hi,已解决
thanks