# Cli equivalent to sdkmanager usage for flashing a jetson Orin NX

**URL:** <https://forums.developer.nvidia.com/t/cli-equivalent-to-sdkmanager-usage-for-flashing-a-jetson-orin-nx/289638>\
**Category:** Jetson Orin NX\
**Tags:** reflash, board-design\
**Created:** [April 15, 2024, 9:53am UTC](https://forums.developer.nvidia.com/t/cli-equivalent-to-sdkmanager-usage-for-flashing-a-jetson-orin-nx/289638 "2024-04-15T09:53:23Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![phdm](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@phdm](https://forums.developer.nvidia.com/u/phdm)\
**Post date:** [April 15, 2024, 9:53am UTC](https://forums.developer.nvidia.com/t/cli-equivalent-to-sdkmanager-usage-for-flashing-a-jetson-orin-nx/289638/1 "2024-04-15T09:53:23Z")

</div>

Hello experts,

I can flash my custom Orin NX board if I use the sdkmanager in GUI mode. My board is recognized as ‘Jetson Orin NX modules’ either with a Jetson Orin NX 8GB or Jetson Orin NX 16GB, depending on the SOC I plug on it. I can flash it perfectly with ‘Jetpack 5.1.2’ and ‘NVMe’ as ‘Storage Device’.

Now we plan to produce many of those boards, and using a GUI to flash them will become tiresome and error-prone.

What is the command-line equivalent (using flash.sh e.g.) to flash that board ?

TIA

---

<div class="post-metadata">

**Author:** ![DaveYYY](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/daveyyy/32/233244_2.png) [@DaveYYY](https://forums.developer.nvidia.com/u/DaveYYY)\
**Post date:** [April 16, 2024, 1:30am UTC](https://forums.developer.nvidia.com/t/cli-equivalent-to-sdkmanager-usage-for-flashing-a-jetson-orin-nx/289638/3 "2024-04-16T01:30:40Z")

</div>

[https://docs.nvidia.com/jetson/archives/r35.5.0/DeveloperGuide/IN/QuickStart.html](https://docs.nvidia.com/jetson/archives/r35.5.0/DeveloperGuide/IN/QuickStart.html)

```auto
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 jetson-orin-nano-devkit internal

```

---

<div class="post-metadata">

**Author:** ![phdm](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@phdm](https://forums.developer.nvidia.com/u/phdm)\
**Post date:** [April 16, 2024, 6:53am UTC](https://forums.developer.nvidia.com/t/cli-equivalent-to-sdkmanager-usage-for-flashing-a-jetson-orin-nx/289638/4 "2024-04-16T06:53:52Z")

</div>

OK Thank you, but …  
previously it was possible to create a file named ‘myboard.conf’ and then run something like

```auto
sudo ./flash.sh myboard nvme0n1p1

```

Is that deprecated, or not supported anymore ?

---

<div class="post-metadata">

**Author:** ![DaveYYY](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/daveyyy/32/233244_2.png) [@DaveYYY](https://forums.developer.nvidia.com/u/DaveYYY)\
**Post date:** [April 16, 2024, 6:56am UTC](https://forums.developer.nvidia.com/t/cli-equivalent-to-sdkmanager-usage-for-flashing-a-jetson-orin-nx/289638/5 "2024-04-16T06:56:26Z")

</div>

`flash.sh` only supports eMMC/SD card, but not NVMe drive.

---

<div class="post-metadata">

**Author:** ![phdm](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@phdm](https://forums.developer.nvidia.com/u/phdm)\
**Post date:** [April 16, 2024, 7:39am UTC](https://forums.developer.nvidia.com/t/cli-equivalent-to-sdkmanager-usage-for-flashing-a-jetson-orin-nx/289638/6 "2024-04-16T07:39:38Z")

</div>

OK Thank you

How can I add the pre-config (user and password) options to the `l4t_initrd_flash.sh` command line ?

---

<div class="post-metadata">

**Author:** ![DaveYYY](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/daveyyy/32/233244_2.png) [@DaveYYY](https://forums.developer.nvidia.com/u/DaveYYY)\
**Post date:** [April 16, 2024, 7:41am UTC](https://forums.developer.nvidia.com/t/cli-equivalent-to-sdkmanager-usage-for-flashing-a-jetson-orin-nx/289638/7 "2024-04-16T07:41:48Z")

</div>

You have to run this script before flashing:  
[https://docs.nvidia.com/jetson/archives/r35.5.0/DeveloperGuide/SD/FlashingSupport.html#skipping-oem-config](https://docs.nvidia.com/jetson/archives/r35.5.0/DeveloperGuide/SD/FlashingSupport.html#skipping-oem-config)

---

<div class="post-metadata">

**Author:** ![phdm](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@phdm](https://forums.developer.nvidia.com/u/phdm)\
**Post date:** [April 16, 2024, 8:57am UTC](https://forums.developer.nvidia.com/t/cli-equivalent-to-sdkmanager-usage-for-flashing-a-jetson-orin-nx/289638/8 "2024-04-16T08:57:11Z")

</div>

OK that works !

I have found how to specify the board specific PINMUX\_CONFIG, PMC\_CONFIG and DTB\_FILE, but how can I specify the kernel that must be run after the installation ?

---

<div class="post-metadata">

**Author:** ![DaveYYY](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/daveyyy/32/233244_2.png) [@DaveYYY](https://forums.developer.nvidia.com/u/DaveYYY)\
**Post date:** [April 16, 2024, 9:06am UTC](https://forums.developer.nvidia.com/t/cli-equivalent-to-sdkmanager-usage-for-flashing-a-jetson-orin-nx/289638/9 "2024-04-16T09:06:44Z")

</div>

> [@phdm](#):
>
> but how can I specify the kernel that must be run after the installation ?

You mean you want to replace the kernel image at runtime?

---

<div class="post-metadata">

**Author:** ![phdm](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@phdm](https://forums.developer.nvidia.com/u/phdm)\
**Post date:** [April 16, 2024, 9:11am UTC](https://forums.developer.nvidia.com/t/cli-equivalent-to-sdkmanager-usage-for-flashing-a-jetson-orin-nx/289638/10 "2024-04-16T09:11:25Z")

</div>

Yes, I want to run a self-compiled kernel tailored for the board, with additional drivers. This kernel is tested and runs perfectly if installed instead of the default kernel afterwards, but I would like to install it at the flashing time.

---

<div class="post-metadata">

**Author:** ![DaveYYY](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/daveyyy/32/233244_2.png) [@DaveYYY](https://forums.developer.nvidia.com/u/DaveYYY)\
**Post date:** [April 16, 2024, 9:15am UTC](https://forums.developer.nvidia.com/t/cli-equivalent-to-sdkmanager-usage-for-flashing-a-jetson-orin-nx/289638/11 "2024-04-16T09:15:37Z")

</div>

Replace `Linux_for_Tegra/boot/Image` with your own kernel.

---

<div class="post-metadata">

**Author:** ![phdm](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@phdm](https://forums.developer.nvidia.com/u/phdm)\
**Post date:** [April 16, 2024, 9:22am UTC](https://forums.developer.nvidia.com/t/cli-equivalent-to-sdkmanager-usage-for-flashing-a-jetson-orin-nx/289638/12 "2024-04-16T09:22:58Z")

</div>

Will `Linux_for_Tegra/boot/Image` be run during the flashing process ? If yes, are there any driver or config options that must be provided by that kernel ?

---

<div class="post-metadata">

**Author:** ![DaveYYY](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/daveyyy/32/233244_2.png) [@DaveYYY](https://forums.developer.nvidia.com/u/DaveYYY)\
**Post date:** [April 16, 2024, 9:33am UTC](https://forums.developer.nvidia.com/t/cli-equivalent-to-sdkmanager-usage-for-flashing-a-jetson-orin-nx/289638/13 "2024-04-16T09:33:49Z")

</div>

I don’t really know what your question is.  
What is your config/driver here?

---

<div class="post-metadata">

**Author:** ![phdm](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@phdm](https://forums.developer.nvidia.com/u/phdm)\
**Post date:** [April 16, 2024, 9:49am UTC](https://forums.developer.nvidia.com/t/cli-equivalent-to-sdkmanager-usage-for-flashing-a-jetson-orin-nx/289638/14 "2024-04-16T09:49:40Z")

</div>

Is `Linux_for_Tegra/boot/Image` used in the flashing process or merely copied into the NVMe and run only after the final reboot ?

If it is merely copied into the NVMe and run only after the final reboot, ignore my next question :)

If it is run during the flashing process, e.g. to provide initrd or usb gadget support, then which `menuconfig` option should I take care to preserve while configuring my linux kernel before compilation, to avoid breaking the flashing process ?

PS: actually there is no `Linux_for_Tegra/boot/Image`. In `Linux_for_Tegra` there are only `rootfs/boot/Image` and `kernel/Image`. If you meant `rootfs/boot/Image`, please ignore my question.

---

<div class="post-metadata">

**Author:** ![DaveYYY](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/daveyyy/32/233244_2.png) [@DaveYYY](https://forums.developer.nvidia.com/u/DaveYYY)\
**Post date:** [April 16, 2024, 9:57am UTC](https://forums.developer.nvidia.com/t/cli-equivalent-to-sdkmanager-usage-for-flashing-a-jetson-orin-nx/289638/15 "2024-04-16T09:57:37Z")

</div>

> [@phdm](#):
>
> Is `Linux_for_Tegra/boot/Image` used in the flashing process or merely copied into the NVMe and run only after the final reboot ?

YES. It’s used in the flashing process.

> [@phdm](#):
>
> If it is run during the flashing process, e.g. to provide initrd or usb gadget support, then which `menuconfig` option should I take care to preserve while configuring my linux kernel before compilation, to avoid breaking the flashing process ?

You just don’t disable configs that you are not fully familiar with, especially regarding USB and RNDIS.

---

<div class="post-metadata">

**Author:** ![DaveYYY](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/daveyyy/32/233244_2.png) [@DaveYYY](https://forums.developer.nvidia.com/u/DaveYYY)\
**Post date:** [April 16, 2024, 9:58am UTC](https://forums.developer.nvidia.com/t/cli-equivalent-to-sdkmanager-usage-for-flashing-a-jetson-orin-nx/289638/16 "2024-04-16T09:58:43Z")

</div>

Oh YES, I mean `Linux_for_Tegra/kernel/Image`.

---

<div class="post-metadata">

**Author:** ![phdm](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@phdm](https://forums.developer.nvidia.com/u/phdm)\
**Post date:** [April 16, 2024, 12:23pm UTC](https://forums.developer.nvidia.com/t/cli-equivalent-to-sdkmanager-usage-for-flashing-a-jetson-orin-nx/289638/17 "2024-04-16T12:23:46Z")

</div>

I copied my kernel Image to kernel/Image but the flashing process did not terminate successfully. Here are its last words :

```auto
cp: cannot stat '/home/phdm/nvidia/nvidia_sdk/JetPack_5.1.2_Linux_JETSON_ORIN_NX_TARGETS/Linux_for_Tegra/rootfs/lib/modules/5.10.120-00303-g49d2b8514377-dirty/kernel/drivers/mtd': No such file or directory
Cleaning up...

```

I investigate.

---

<div class="post-metadata">

**Author:** ![DaveYYY](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/daveyyy/32/233244_2.png) [@DaveYYY](https://forums.developer.nvidia.com/u/DaveYYY)\
**Post date:** [April 16, 2024, 1:10pm UTC](https://forums.developer.nvidia.com/t/cli-equivalent-to-sdkmanager-usage-for-flashing-a-jetson-orin-nx/289638/18 "2024-04-16T13:10:14Z")

</div>

How did you build kernel modules?  
How are you getting these kernel string `00303-g49d2b8514377-dirty`?  
Are you doing it intentionally?

---

<div class="post-metadata">

**Author:** ![phdm](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@phdm](https://forums.developer.nvidia.com/u/phdm)\
**Post date:** [April 16, 2024, 1:23pm UTC](https://forums.developer.nvidia.com/t/cli-equivalent-to-sdkmanager-usage-for-flashing-a-jetson-orin-nx/289638/19 "2024-04-16T13:23:10Z")

</div>

the hash in the name is intentional, the dirty is not. I always compile the linux kernel for embedded computers like here with all the needed drivers builtin, so that I have only one file to copy, backup etc .

I found the failing command in `tools/kernel_flash/l4t_initrd_flash_internal.sh`.

I’ll try to bypass it and its friends.

---

<div class="post-metadata">

**Author:** ![DaveYYY](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/daveyyy/32/233244_2.png) [@DaveYYY](https://forums.developer.nvidia.com/u/DaveYYY)\
**Post date:** [April 16, 2024, 1:33pm UTC](https://forums.developer.nvidia.com/t/cli-equivalent-to-sdkmanager-usage-for-flashing-a-jetson-orin-nx/289638/20 "2024-04-16T13:33:10Z")

</div>

OK, so if you make sure every drivers are built-in, then you can safely remove that code from the script.  
But you’d like to be careful that the same thing will no longer work if you move to JetPack 6, as we pull a lot of NVIDIA’s custom device drivers out of the kernel source tree, and make them external modules.

---

<div class="post-metadata">

**Author:** ![phdm](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@phdm](https://forums.developer.nvidia.com/u/phdm)\
**Post date:** [April 16, 2024, 1:52pm UTC](https://forums.developer.nvidia.com/t/cli-equivalent-to-sdkmanager-usage-for-flashing-a-jetson-orin-nx/289638/21 "2024-04-16T13:52:58Z")

</div>

> [@DaveYYY](#):
>
> But you’d like to be careful that the same thing will no longer work if you move to JetPack 6, as we pull a lot of NVIDIA’s custom device drivers out of the kernel source tree, and make them external modules.

I know. I already asked for that feature to come back. See [JetPack 6.0 Developer Preview - Release Announcement - #37 by phdm](https://forums.developer.nvidia.com/t/jetpack-6-0-developer-preview-release-announcement/275151/37)

Looking only at the flashing process, it would be useful to be able to install a different kernel for runtime than the one used for the flashing process itself.

[Next page](https://forums.developer.nvidia.com/t/cli-equivalent-to-sdkmanager-usage-for-flashing-a-jetson-orin-nx/289638.md?page=2)
