airvolute / dcs-deploy

GNU General Public License v3.0
1 stars 0 forks source link

Flashing failiure #25

Closed B4njoS closed 5 months ago

B4njoS commented 5 months ago

Hello! I have a big problem with the flashing procedure, I have flashed over 80 boards using your scripts, after 6-8 boards I have this error, which I can fix only if I formatting the entire Ubuntu OS on the Host PC.

I tried to fix the problem myself using Nvidia forum old discussions and didn't succeed.

I have tried with different carriers (all Airvolute 1.2 boards) and different Nvidia Jetson's (all Xavier NX) and no success.

The device was in recovery mode for sure, I checked myself multiple times before running the scripts.

Please help me to get the right solution without formatting the whole OS.

Adding below the Error with some previous information

I have tried with branches : main , oem. Both have the same error

User can run above saved command in factory environment without 
providing pkc and sbk keys to flash a device

Example:

    $ cd bootloader 
    $ sudo bash ./flashcmd.txt

Save initrd flashing command parameters to /root/.dcs_deploy/flash/xavier_nx_emmc_1.2_51_full/Linux_for_Tegra/tools/kernel_flash/initrdflashparam.txt
/tmp/tmp.X6jbUndoMv ~/.dcs_deploy/flash/xavier_nx_emmc_1.2_51_full/Linux_for_Tegra
writing boot image config in bootimg.cfg
extracting kernel in zImage
extracting ramdisk in initrd.img
/tmp/tmp.X6jbUndoMv/initrd /tmp/tmp.X6jbUndoMv ~/.dcs_deploy/flash/xavier_nx_emmc_1.2_51_full/Linux_for_Tegra
54414 blocks
84060 blocks
/tmp/tmp.X6jbUndoMv ~/.dcs_deploy/flash/xavier_nx_emmc_1.2_51_full/Linux_for_Tegra
flashimg0=boot0.img
~/.dcs_deploy/flash/xavier_nx_emmc_1.2_51_full/Linux_for_Tegra
Success
Cleaning up...
Finish generating flash package.
/root/.dcs_deploy/flash/xavier_nx_emmc_1.2_51_full/Linux_for_Tegra/tools/kernel_flash/l4t_initrd_flash_internal.sh  --usb-instance 3-4 --device-instance 0 --flash-only  airvolute-dcs1.2+p3668-0001-qspi-emmc mmcblk0p1
**********************************************
*                                            *
*  Step 1: Build the flashing environment    *
*                                            *
**********************************************
Create flash environment 0
~/.dcs_deploy/flash/xavier_nx_emmc_1.2_51_full/Linux_for_Tegra/bootloader ~/.dcs_deploy/flash/xavier_nx_emmc_1.2_51_full/Linux_for_Tegra
~/.dcs_deploy/flash/xavier_nx_emmc_1.2_51_full/Linux_for_Tegra
Finish creating flash environment 0.
****************************************************
*                                                  *
*  Step 2: Boot the device with flash initrd image *
*                                                  *
****************************************************
~/.dcs_deploy/flash/xavier_nx_emmc_1.2_51_full/Linux_for_Tegra/temp_initrdflash/bootloader0 ~/.dcs_deploy/flash/xavier_nx_emmc_1.2_51_full/Linux_for_Tegra
./tegraflash.py --bl nvtboot_recovery_cpu_t194_sigheader.bin.encrypt --bct br_bct_BR.bct --securedev  --bldtb tegra194-p3668-0001-p3509-0000.dtb --applet rcm_2_encrypt.rcm --applet_softfuse rcm_1_encrypt.rcm --cmd "rcmboot"  --cfg secureflash.xml --chip 0x19 --mb1_bct mb1_bct_MB1_sigheader.bct.encrypt --mem_bct mem_rcm_sigheader.bct.encrypt --mb1_cold_boot_bct mb1_cold_boot_bct_MB1_sigheader.bct.encrypt --mem_bct_cold_boot mem_coldboot_sigheader.bct.encrypt  --bins "mb2_bootloader nvtboot_recovery_t194_sigheader.bin.encrypt; mts_preboot preboot_c10_prod_cr_sigheader.bin.encrypt; mts_mce mce_c10_prod_cr_sigheader.bin.encrypt; mts_proper mts_c10_prod_cr_sigheader.bin.encrypt; bpmp_fw bpmp-2_t194_sigheader.bin.encrypt; bpmp_fw_dtb tegra194-a02-bpmp-p3668-a00_lz4_sigheader.dtb.encrypt; spe_fw spe_t194_sigheader.bin.encrypt; tos tos-optee_t194_sigheader.img.encrypt; eks eks_t194_sigheader.img.encrypt; kernel boot0.img; kernel_dtb kernel_tegra194-p3668-0001-p3509-0000.dtb; bootloader_dtb tegra194-p3668-0001-p3509-0000_sigheader.dtb.encrypt"    --secondary_gpt_backup  --bct_backup  --boot_chain A  --instance 3-4
Welcome to Tegra Flash
version 1.0.0
Type ? or help for help and q or quit to exit
Use ! to execute system commands

 Entering RCM boot

[   0.0000 ] rcm boot with presigned binaries
[   0.0000 ] Boot Rom communication
[   0.0021 ] tegrarcm_v2 --instance 3-4 --chip 0x19 0 --rcm rcm_1_encrypt.rcm --rcm rcm_2_encrypt.rcm
[   0.0028 ] BR_CID: 0x880219116442120410000000090401c0
[   0.0101 ] Boot Rom communication completed
[   2.0396 ] tegrarcm_v2 --instance 3-4 --isapplet
[   2.0415 ] Applet version 01.00.0000
[   2.0601 ] Sending BCTs
[   2.0618 ] tegrarcm_v2 --instance 3-4 --download bct_bootrom br_bct_BR.bct --download bct_mb1 mb1_bct_MB1_sigheader.bct.encrypt --download bct_mem mem_rcm_sigheader.bct.encrypt
[   2.0623 ] Applet version 01.00.0000
[   2.0761 ] Sending bct_bootrom
[   2.0761 ] [................................................] 100%
[   2.0776 ] Sending bct_mb1
[   2.0828 ] [................................................] 100%
[   2.0876 ] Sending bct_mem
[   2.1427 ] [................................................] 100%
Error: Return value 8
Command tegrarcm_v2 --instance 3-4 --download bct_bootrom br_bct_BR.bct --download bct_mb1 mb1_bct_MB1_sigheader.bct.encrypt --download bct_mem mem_rcm_sigheader.bct.encrypt
Cleaning up... 
Kopern1k commented 5 months ago

Hi, dcs_deploy script calls only nvidia tools (l4t_initrd_flash_internal.sh script) with proper optional arguments and do not do any other steps. Going to /root/.dcs_deploy/flash/xavier_nx_emmc_1.2_51_full/Linux_for_Tegra/ and then you can execute same script on your own: sudo ./tools/kernel_flash/l4t_initrd_flash.sh --flash-only airvolute-dcs1.2+p3668-0001-qspi-emmc mmcblk0p1 This problem looks to be caused by nvidia, looks like tegrarcm_v2 script have problems with host computer USB. We have encountered problems with flashing mostly on AMD cpu computer, Intel platforms was much more stable. In some cases, we have found that, immediate running flash script after power on dcs board in recovery mode was more successful in flashing problematic devices. If you'll have some more info according this issue, please share it here.

B4njoS commented 5 months ago

Thanks for the response. I have found out that if I switch a Nvidia jetson CPU to another one the script might work. I'm using Intel CPU's and not AMD's. I'm asking you for help because I saw in Nvidia forum that if you have custom carrier board the company that make the board might be able to solve this problem because it's related to the BSP files. Is it possible that we have purchased a broken Xavier NX CPU? The first time to burn it and it's failing to burn as I posted above.

So, Let's conclude, Do I need to ask Nvidia how to solve it? If they send me back to you, would you help me get the problem solved? Need a fast answer, sorry for pushing, we are second from Production stage. Thanks!

Kopern1k commented 5 months ago

As mentioned earlier, we don't supply nvidia tools, so we don't have any possibility to solve nvidia issues caused by their tools.

We have only hints for you to find problem:

I have found out that if I switch a Nvidia jetson CPU to another one the script might work.

  • Please try to figure out, if it is problem of dcs board, or jetson CPU by switching jetson cpu to another carrier board and flashing it again on other boards. Can be that problem is jetson CPU problem

I'm asking you for help because I saw in Nvidia forum that if you have custom carrier board the company that make the board might be able to solve this problem because it's related to the BSP files.

  • Nvidia don't want to support other carrier boards, but sometimes they response. Better to not mention you are using other carrier boards, but they figure it out when looking on flash params :). The right option is to replicate problem on nvidia carrier board and send them logs. But it could take time to solve this issue
  • If it's related to the BSP files, then it will not work on other boards, but you mentioned, there was plenty of successful device flashes

I'm using Intel CPU's and not AMD's

  • the problem can be caused by driver version, kernel version, ... etc... currently we don't know what causes the problem. The best is not to update Ubuntu after installing fresh one.