Flash script stuck for long time

When I use

sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 -c tools/kernel_flash/flash_l4t_external.xml -p “-c bootloader/t186ref/cfg/flash_t234_qspi.xml” --showlogs --network usb0 p3509-a02+p3767-0000 internal

to flash orin nx, the script prints “/home/v2x/test/jp51/Linux_for_Tegra/tools/kernel_flash/l4t_initrd_flash_internal.sh --no-flash --external-device nvme0n1p1 -c tools/kernel_flash/flash_l4t_external.xml -p -c bootloader/t186ref/cfg/flash_t234_qspi.xml --showlogs --network usb0 p3509-a02+p3767-0000 internal”, then stuck for about 6 minutes without any printing. The flashing process goes on after that.

What can I do to analysis and fix the issue?

It also stucks after printing “/home/v2x/test/jp51/Linux_for_Tegra/tools/kernel_flash/l4t_initrd_flash_internal.sh --network usb0 --usb-instance 1-6 --device-instance 0 --flash-only --external-device nvme0n1p1 -c “tools/kernel_flash/flash_l4t_external.xml” --network usb0 p3509-a02+p3767-0000 internal”.

Is your host a VM, or native install? VMs tend to fail. You should also list which version of JetPack you are using, and if the host PC is Ubuntu 18.04, 20.04, so on.

It’s native ubuntu 20.04. I’m using JP 5.1. I deleted my L4T dir and extracted again, but it stayed the same.

It seems that the issue will only happen when “l4t_initrd_flash_internal.sh” is executed.

Hi user49922,

Are you using the devkit or custom board?

Please also provide the full flash log after you use l4t_initrd_flash_internal.sh script for further check.

Custom board.

The logs are here:
flash_host.txt (251.9 KB)
flash_uart.txt (176.6 KB)

The stuck happens after line 2 and line 2813.

From your flash log, it seems the flash procedure is expected.

Do you mean the flash process would stuck for a long time when calling l4t_initrd_flash_internal.sh?

You might need to add some debug messages in l4t_initrd_flash_internal.sh to check where it stuck.

I’ve noticed there’s error in UART log.

E> Failed to open sdmmc-3, err = 39390706

You could also check the status of the board when the flash process is stuck.

@KevinFFF
Comments?


/mnt/JetPack_5.1_Linux_JETSON_AGX_ORIN_TARGETS/Linux_for_Tegra$ sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 -c tools/kernel_flash/flash_l4t_external.xml -p -c bootloader/t186ref/cfg/flash_t234_gspi.xml --showlogs --network usb0  p3509-a02+p3767-0000  internal
/mnt/JetPack_5.1_Linux_JETSON_AGX_ORIN_TARGETS/Linux_for_Tegra/tools/kernel_flash/l4t_initrd_flash_internal.sh --no-flash --external-device nvme0n1p1 -c tools/kernel_flash/flash_l4t_external.xml -p -c bootloader/t186ref/cfg/flash_t234_gspi.xml --showlogs --network usb0 p3509-a02+p3767-0000 internal
************************************
*                                  *
*  Step 1: Generate flash packages *
*                                  *
************************************
Create folder to store images to flash
Generate image for internal storage devices
Generate images to be flashed
ADDITIONAL_DTB_OVERLAY=""  /mnt/JetPack_5.1_Linux_JETSON_AGX_ORIN_TARGETS/Linux_for_Tegra/flash.sh --no-flash --sign -c  p3509-a02+p3767-0000 internal

###############################################################################
# L4T BSP Information:
# R35 , REVISION: 2.1
# User release: 0.0
###############################################################################
Board ID() version() sku() revision()
Chip SKU() ramcode() fuselevel(fuselevel_production) board_FAB()
emc_opt_disable_fuse:(0)
Error: missing cfgfile (/mnt/JetPack_5.1_Linux_JETSON_AGX_ORIN_TARGETS/Linux_for_Tegra/p3509-a02+p3767-0000).

-------------------
However:
/mnt/JetPack_5.1_Linux_JETSON_AGX_ORIN_TARGETS/Linux_for_Tegra$ ls p3509-a02+p3767-0000
p3509-a02+p3767-0000-as-p3767-0001.conf  p3509-a02+p3767-0000-as-p3767-0004.conf  p3509-a02+p3767-0000-maxn.conf

reference thread

@Andrey1984,

Your comment itself already tells us that file is indeed missing. Did you accidentally delete it without notice?

Let me just give a simple example, If you use “_av123” in your flash command, it means flash script will search “_av123.conf” in the Linux_for_Tegra path. The string needs to be 100% matching so that the flash process can proceed.

So back to the case, you used “p3509-a02+p3767-0000”. Which means “p3509-a02+p3767-0000.conf” need to be there, but your ls result shows it is not…

BTW, this rule applies since TX1, which means it has been there since long time ago.

results are what is generated by sdkmanager installation
However the issue has been addressed by using other set of commands for mfi creation

Hi,

Below files are what I just downloaded by sdkmanager.

JetPack_5.1_Linux_JETSON_AGX_ORIN_TARGETS/Linux_for_Tegra$ ls p3509-a02+p3767*
p3509-a02+p3767-0000-as-p3767-0001.conf p3509-a02+p3767-0000-as-p3767-0003.conf p3509-a02+p3767-0000-as-p3767-0004.conf p3509-a02+p3767-0000.conf p3509-a02+p3767-0000-maxn.conf

it only worked after copying the file p3509-a02+p3767-0000.conf to p3509-a02+p3767-0000 then the script proceeds

/mnt/JetPack_5.1_Linux_JETSON_AGX_ORIN_TARGETS/Linux_for_Tegra$ sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 -c tools/kernel_flash/flash_l4t_external.xml -p -c bootloader/t186ref/cfg/flash_t234_gspi.xml --showlogs --network usb0  p3509-a02+p3767-0000  internal

@Andrey1984

Your command has some weird parts. For example, we don’t have “flash_t234_gspi.xml” but only has flash_t234_qspi.xml.

Previously you said the board config is missing, now it is coming back again and I don’t know what happened on your side.

Also, you are the only guy reporting you need to change board config name to make it work on this forum. For example, guys in below thread hit some flash issue too, but they never needed to change the board config name…

If you really need us to help check this issue, please let us know how to reproduce your case step by step.

Please be aware that we really need “step-by-step” info here because we have flashed lots of device with initrd flash tools lots of times… and what you hit didn’t happen to us.

Also, why do you put the board config as the input for “-c” ?

I have also noticed at one of iterations [ under iteration I mean wiping sdkmanager folder/ installation then installing Linux_for_tegra with sdkmanager] that copy paste of nvme0n1p1 would result with ‘l’ instead on ‘1’ . It must be a copy paste error q->g, in my opinion. Unless data corruption is caused by other processes.
I have run 4-7 iterations. None of them would find the config file with the latest sdkmanager by default.
I will run once again with sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 -c tools/kernel_flash/flash_l4t_external.xml -p "-c bootloader/t186ref/cfg/flash_t234_qspi.xml" --showlogs --network usb0 p3509-a02+p3767-0000 internal
Experiment 1.

rm p3509-a02+p3767-0000
sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 -c tools/kernel_flash/flash_l4t_external.xml -p "-c bootloader/t186ref/cfg/flash_t234_qspi.xml" --showlogs --network usb0 p3509-a02+p3767-0000 internal

This time it worked after prior successful iteration though. I have also noticed that while I was executing you have published another question about the -c - I am not putting it currently. At some of iterations sdkmanager has put it at some of iterations I’ve put it eventually highly likely
Did it just complete each iteration at your side?

Hi,

It is not possible sdkmanager put it because sdkmanager does not support to flash ONX +xavier NX devkit… You can only manually flash it.

Please just follow below guidance and share us the full flash log.

  1. Please remove your Linux_for_Tegra BSP folder by using sdkmanager GUI.

  2. After you remove it, check your directory and make sure it is really removed.

  3. Let sdkmanager download the BSP again.

  4. Go to the new Linux_for_Tegra dirctory, put your board into recovery mode.

  5. Run

sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 \
  -c tools/kernel_flash/flash_l4t_external.xml -p "-c bootloader/t186ref/cfg/flash_t234_qspi.xml" \
  --showlogs --network usb0 p3509-a02+p3767-0000 internal
  1. Share the full log to us.

Above step is just a full clean-up and then re-install. Do not try to remove/rename or do anything that you want anymore. Just follow the steps and share the result.

1 Like

1,2,3 - done;
4 [ the board isn’t connected right now maybe later with the board will try rather on Monday]
5 executes with no errors so far as it seems using

sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 \
  -c tools/kernel_flash/flash_l4t_external.xml -p "-c bootloader/t186ref/cfg/flash_t234_qspi.xml" \
  --showlogs --network usb0 p3509-a02+p3767-0000 internal

the error can not be reproduced anymore as it seems

@KevinFFF @WayneWWW

I added some debug message, and figured out tools/kernel_flash/l4t_initrd_flash_internal.sh stuck at line 117: network_prerequisite "${network}" "${LINUX_BASE_DIR}" "${NFS_ROOTFS_DIR}". I commented this line out and the script never stuck again.

Could you tell me what this line is doing? It seems that it’s checking network access, but I don’t know why I need it for flashing.

@user49922 did you have --network usb0 added on your command?