About Flashing to a USB Drive

Hello,

I tried booting from a usb external storage device referring to the following article, but it was caught only as an external drive and it was still booted with emmc.

Do you have any advice for me?

URL: https://docs.nvidia.com/jetson/archives/l4t-archived/l4t-3261/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/flashing.html#wwpID0E01O0HA

Thank you.

You should share the uart log but not a screenshot.

1 Like

The uboot in Nano bootloader has a a target device with order sdcard->emmc->usb ->net.
It would search the kernel and rootfs in those device. This order could be changed.

Have you checked the NVIDIA Jetson Linux Driver Package Software Features : Bootloader | NVIDIA Docs?

2 Likes

Hello, @kayccc @WayneWWW

U-Boot 2020.04-g46e4604c78 (Jul 26 2021 - 12:09:42 -0700)

SoC: tegra210
Model: NVIDIA Jetson Nano Developer Kit
Board: NVIDIA P3450-0000
DRAM:  4 GiB
MMC:   sdhci@700b0000: 1, sdhci@700b0600: 0
Loading Environment from MMC... *** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   No ethernet found.
Hit any key to stop autoboot:  0
Card did not respond to voltage select!
switch to partitions #0, OK
mmc0(part 0) is current device
Scanning mmc 0:1...
Found /boot/extlinux/extlinux.conf
Retrieving file: /boot/extlinux/extlinux.conf
879 bytes read in 24 ms (35.2 KiB/s)
1:      primary kernel
Retrieving file: /boot/initrd
7160133 bytes read in 174 ms (39.2 MiB/s)
Retrieving file: /boot/Image
34484232 bytes read in 781 ms (42.1 MiB/s)
append: tegraid=21.1.2.0.0 ddr_die=4096M@2048M section=512M memtype=0 vpr_resize usb_port_owner_info=0 lane_owner_info=0 emc_max_dvfs=0 touch_id=0@63 video=tegrafb no_console_suspend=1 console=ttyS0,115200n8 debug_uartport=lsport,4 earlyprintk=uart8250-32bit,0x70006000 maxcpus=4 usbcore.old_scheme_first=1 lp0_vec=0x1000@0xff780000 core_edp_mv=1075 core_edp_ma=4000 gpt  earlycon=uart8250,mmio32,0x70006000  root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 sdhci_tegra.en_boot_part_access=1 quiet root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 sdhci_tegra.en_boot_part_access=1
## Flattened Device Tree blob at 83100000
   Booting using the fdt blob at 0x83100000
ERROR: reserving fdt memory region failed (addr=0 size=0)
ERROR: reserving fdt memory region failed (addr=0 size=0)
   Using Device Tree in place at 0000000083100000, end 000000008317de23
copying carveout for /host1x@50000000/dc@54200000...
copying carveout for /host1x@50000000/dc@54240000...

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.9.253-tegra (buildbrain@mobile-u64-5496-d5000) (gcc version 7.3.1 20180425 [linaro-7.3-2018.05 revision d29120a424ecfbc167ef90065c0eeb7f91977701] (Linaro GCC 7.3-2018.05) ) #1 SMP PREEMPT Mon Jul 26 12:13:06 PDT 2021
[    0.000000] Boot CPU: AArch64 Processor [411fd071]
[    0.000000] OF: fdt:memory scan node memory@80000000, reg size 32,
[    0.000000] OF: fdt: - 80000000 ,  7ee00000
[    0.000000] OF: fdt: - 100000000 ,  7f200000
[    0.000000] earlycon: uart8250 at MMIO32 0x0000000070006000 (options '')
[    0.000000] bootconsole [uart8250] enabled
[    1.076176] tegradc tegradc.1: dpd enable lookup fail:-19
[    1.581911] Host read timeout at address 545c00c4
[    1.672423] kobject_add_internal failed for rt8168_power with -EEXIST, don't try to register things with the same name in the same directory.
[    1.685158] unable to create rt8168_power_saver kernel object!
[    1.853767] imx219 7-0010: imx219_board_setup: error during i2c read probe (-121)
[    1.861504] imx219 7-0010: board setup failed
[    1.889840] imx219 8-0010: imx219_board_setup: error during i2c read probe (-121)
[    1.897405] imx219 8-0010: board setup failed
[    2.353289] cgroup: cgroup2: unknown option "nsdelegate"
[    3.404372] scsi 0:0:0:0: Direct-Access     Samsung  SSD 860 EVO 500G 0301 PQ: 0 ANSI: 6
[    3.443549] sd 0:0:0:0: [sda] 976773168 512-byte logical blocks: (500 GB/466 GiB)
[    3.451231] sd 0:0:0:0: [sda] 4096-byte physical blocks
[    3.459563] sd 0:0:0:0: [sda] Write Protect is off
[    3.465220] sd 0:0:0:0: [sda] Disabling FUA
[    3.469449] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[    3.487240] sd 0:0:0:0: [sda] Optimal transfer size 33553920 bytes not a multiple of physical block size (4096 bytes)
[    3.509562] sd 0:0:0:0: [sda] Attached SCSI disk
[    3.746357] using random self ethernet address
[    3.758055] using random host ethernet address
[    3.943898] random: crng init done
[    3.947304] random: 7 urandom warning(s) missed due to ratelimiting
[    4.379296] ------------[ cut here ]------------
[    4.383921] WARNING: CPU: 1 PID: 2774 at /dvs/git/dirty/git-master_linux/kernel/kernel-4.9/drivers/spi/spidev.c:767 0xffffff8000f892a8
[    4.396122] ---[ end trace df6de492fb3b0cea ]---
[    4.400209] using random self ethernet address
[    4.400212] using random host ethernet address
[    4.410223] ------------[ cut here ]------------
[    4.414846] WARNING: CPU: 1 PID: 2774 at /dvs/git/dirty/git-master_linux/kernel/kernel-4.9/drivers/spi/spidev.c:767 0xffffff8000f892a8
[    4.427039] ---[ end trace df6de492fb3b0ceb ]---
[    4.448977] ------------[ cut here ]------------
[    4.453603] WARNING: CPU: 2 PID: 2774 at /dvs/git/dirty/git-master_linux/kernel/kernel-4.9/drivers/spi/spidev.c:767 0xffffff8000f892a8
[    4.465800] ---[ end trace df6de492fb3b0cec ]---
[    4.475164] ------------[ cut here ]------------
[    4.479791] WARNING: CPU: 1 PID: 2774 at /dvs/git/dirty/git-master_linux/kernel/kernel-4.9/drivers/spi/spidev.c:767 0xffffff8000f892a8
[    4.491988] ---[ end trace df6de492fb3b0ced ]---
[    5.769344] Bridge firewalling registered

Ubuntu 18.04.5 LTS manager-desktop ttyS0

manager-desktop login: [    8.439325] edid invalid

Ubuntu 18.04.5 LTS manager-desktop ttyS0

manager-desktop login:

Thank you.

Your log says you are still booting from emmc. That is same as what kayccc told. Your boot target is still the default one.

Please check the document first.

Interrupt the uboot and set boot_targets to the usb drive.

1 Like

Hello,

Read the docs and APPEND ${cbootargs} quiet root=/dev/sda1 rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 sdhci_tegra.en_boot_part_access=1
I changed it to , but I can’t boot from the USB device.

Can you guide me?

manager@manager-desktop:~$ cat /boot/extlinux/extlinux.conf
TIMEOUT 30
DEFAULT primary

MENU TITLE L4T boot options

LABEL primary
      MENU LABEL primary kernel
      LINUX /boot/Image
      INITRD /boot/initrd
      APPEND ${cbootargs} quiet root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 sdhci_tegra.en_boot_part_access=1

# When testing a custom kernel, it is recommended that you create a backup of
# the original kernel and add a new entry to this file so that the device can
# fallback to the original kernel. To do this:
#
# 1, Make a backup of the original kernel
#      sudo cp /boot/Image /boot/Image.backup
#
# 2, Copy your custom kernel into /boot/Image
#
# 3, Uncomment below menu setting lines for the original kernel
#
# 4, Reboot

# LABEL backup
#    MENU LABEL backup kernel
#    LINUX /boot/Image.backup
#    INITRD /boot/initrd
#    APPEND ${cbootargs}

Thank you.

This is not what we are talking about… We are talking about set the boot target environemnt in uboot…

1 Like

Hello, @WayneWWW

U-Boot 2020.04-g46e4604c78 (Jul 26 2021 - 12:09:42 -0700)

SoC: tegra210
Model: NVIDIA Jetson Nano Developer Kit
Board: NVIDIA P3450-0000
DRAM:  4 GiB
MMC:   sdhci@700b0000: 1, sdhci@700b0600: 0
Loading Environment from MMC... *** Warning - bad CRC, using default environment

In:    serial
Out:   serial
Err:   serial
Net:   No ethernet found.
Hit any key to stop autoboot:  0
Tegra210 (P3450-0000) # ls
ls - list files in a directory (default /)

Usage:
ls <interface> [<dev[:part]> [directory]]
    - List files in directory 'directory' of partition 'part' on
      device type 'interface' instance 'dev'.
Tegra210 (P3450-0000) #

Thank you.

Use printenv and setenv to set your boot_targets.

boot_targets=usb0 mmc1 mmc0 nvme0 pxe dhcp

Hello, @WayneWWW

Environment size: 5307/8188 bytes
Tegra210 (P3450-0000) # boot
starting USB...
Bus usb@7d000000: tegrausb: Invalid dr_mode 2 for host mode
probe failed, error -1
Bus xusb@70090000:
Firmware size 126464
Firmware timestamp: 0x5f23e558, Version: 50.26 release

Register HCSParams1: 9000124 NbrPorts: 9
Starting the controller
USB XHCI 1.00
scanning bus xusb@70090000 for devices... Device not responding to set address.

      USB device not accepting new address (error=80000000)
9 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found

Device 0: Vendor: Samsung  Rev: 0301 Prod: SSD 860 EVO 500G
            Type: Hard Disk
            Capacity: 476940.0 MB = 465.7 GB (976773168 x 512)
... is now current device
Scanning usb 0:1...
Found /boot/extlinux/extlinux.conf
Retrieving file: /boot/extlinux/extlinux.conf
874 bytes read in 3 ms (284.2 KiB/s)
1:      primary kernel
Retrieving file: /boot/initrd
7160133 bytes read in 31 ms (220.3 MiB/s)
Retrieving file: /boot/Image
34484232 bytes read in 132 ms (249.1 MiB/s)
append: tegraid=21.1.2.0.0 ddr_die=4096M@2048M section=512M memtype=0 vpr_resize usb_port_owner_info=0 lane_owner_info=0 emc_max_dvfs=0 touch_id=0@63 video=tegrafb no_console_suspend=1 console=ttyS0,115200n8 debug_uartport=lsport,4 earlyprintk=uart8250-32bit,0x70006000 maxcpus=4 usbcore.old_scheme_first=1 lp0_vec=0x1000@0xff780000 core_edp_mv=1075 core_edp_ma=4000 gpt tegra_fbmem=0x800000@0x92cb4000 is_hdmi_initialised=1  earlycon=uart8250,mmio32,0x70006000  root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 sdhci_tegra.en_boot_part_access=1 quiet root=/dev/sda1 rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 sdhci_tegra.en_boot_part_access=1
## Flattened Device Tree blob at 83100000
   Booting using the fdt blob at 0x83100000
ERROR: reserving fdt memory region failed (addr=0 size=0)
ERROR: reserving fdt memory region failed (addr=0 size=0)
   Using Device Tree in place at 0000000083100000, end 000000008317de23
copying carveout for /host1x@50000000/dc@54200000...
copying carveout for /host1x@50000000/dc@54240000...

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 4.9.253-tegra (buildbrain@mobile-u64-5496-d5000) (gcc version 7.3.1 20180425 [linaro-7.3-2018.05 revision d29120a424ecfbc167ef90065c0eeb7f91977701] (Linaro GCC 7.3-2018.05) ) #1 SMP PREEMPT Mon Jul 26 12:13:06 PDT 2021
[    0.000000] Boot CPU: AArch64 Processor [411fd071]
[    0.000000] OF: fdt:memory scan node memory@80000000, reg size 32,
[    0.000000] OF: fdt: - 80000000 ,  7ee00000
[    0.000000] OF: fdt: - 100000000 ,  7f200000
[    0.000000] Found tegra_fbmem: 00800000@92cb4000
[    0.000000] earlycon: uart8250 at MMIO32 0x0000000070006000 (options '')
[    0.000000] bootconsole [uart8250] enabled
[    1.176980] tegradc tegradc.1: dpd enable lookup fail:-19
[    1.214445] kobject_add_internal failed for rt8168_power with -EEXIST, don't try to register things with the same name in the same directory.
[    1.227151] unable to create rt8168_power_saver kernel object!
[    1.391814] imx219 7-0010: imx219_board_setup: error during i2c read probe (-121)
[    1.391971] imx219 7-0010: board setup failed
[    1.416250] imx219 8-0010: imx219_board_setup: error during i2c read probe (-121)
[    1.416330] imx219 8-0010: board setup failed
[    2.884363] cgroup: cgroup2: unknown option "nsdelegate"
[    4.069494] random: crng init done
[    4.072928] random: 7 urandom warning(s) missed due to ratelimiting
[    4.088987] using random self ethernet address
[    4.093529] using random host ethernet address
[    4.404093] ------------[ cut here ]------------
[    4.408752] WARNING: CPU: 2 PID: 3695 at /dvs/git/dirty/git-master_linux/kernel/kernel-4.9/drivers/spi/spidev.c:767 0xffffff80011752a8
[    4.421020] ---[ end trace d7ccb46d496cf391 ]---
[    4.430924] ------------[ cut here ]------------
[    4.435582] WARNING: CPU: 2 PID: 3695 at /dvs/git/dirty/git-master_linux/kernel/kernel-4.9/drivers/spi/spidev.c:767 0xffffff80011752a8
[    4.447847] ---[ end trace d7ccb46d496cf392 ]---
[    4.474461] ------------[ cut here ]------------
[    4.479121] WARNING: CPU: 2 PID: 3695 at /dvs/git/dirty/git-master_linux/kernel/kernel-4.9/drivers/spi/spidev.c:767 0xffffff80011752a8
[    4.491390] ---[ end trace d7ccb46d496cf393 ]---
[    4.536404] ------------[ cut here ]------------
[    4.541062] WARNING: CPU: 2 PID: 3695 at /dvs/git/dirty/git-master_linux/kernel/kernel-4.9/drivers/spi/spidev.c:767 0xffffff80011752a8
[    4.553328] ---[ end trace d7ccb46d496cf394 ]---
[    4.629878] using random self ethernet address
[    4.634477] using random host ethernet address
[    7.254976] blk_update_request: I/O error, dev sda, sector 3784703
[    7.261266] blk_update_request: I/O error, dev sda, sector 3792895
[    7.267518] blk_update_request: I/O error, dev sda, sector 3780607
[    7.273759] blk_update_request: I/O error, dev sda, sector 3783679
[    7.279997] blk_update_request: I/O error, dev sda, sector 3785727
[    7.286224] EXT4-fs warning (device sda1): ext4_end_bio:313: I/O error -5 writing to inode 6422727 (offset 8388608 size 6959104 starting block 473343)
[    7.299792] Buffer I/O error on device sda1, logical block 464896
[    7.305948] Buffer I/O error on device sda1, logical block 464897
[    7.312095] Buffer I/O error on device sda1, logical block 464898
[    7.318244] Buffer I/O error on device sda1, logical block 464899
[    7.324389] Buffer I/O error on device sda1, logical block 464900
[    7.330546] Buffer I/O error on device sda1, logical block 464901
[    7.336692] Buffer I/O error on device sda1, logical block 464902
[    7.342827] Buffer I/O error on device sda1, logical block 464903
[    7.348956] Buffer I/O error on device sda1, logical block 464904
[    7.355085] Buffer I/O error on device sda1, logical block 464905
[    7.361518] blk_update_request: I/O error, dev sda, sector 3786751
[    7.367765] blk_update_request: I/O error, dev sda, sector 3789823
[    7.374009] blk_update_request: I/O error, dev sda, sector 3796991
[    7.380252] blk_update_request: I/O error, dev sda, sector 3779583
[    7.386488] blk_update_request: I/O error, dev sda, sector 3781631
[    7.392713] EXT4-fs warning (device sda1): ext4_end_bio:313: I/O error -5 writing to inode 6422727 (offset 0 size 8388608 starting block 472831)
[    7.406017] EXT4-fs warning (device sda1): ext4_end_bio:313: I/O error -5 writing to inode 6422727 (offset 0 size 8388608 starting block 473087)
[    7.419308] EXT4-fs warning (device sda1): ext4_end_bio:313: I/O error -5 writing to inode 6422727 (offset 8388608 size 6959104 starting block 473599)
[    7.433129] EXT4-fs warning (device sda1): ext4_end_bio:313: I/O error -5 writing to inode 6422727 (offset 8388608 size 6959104 starting block 473855)
[    7.446955] EXT4-fs warning (device sda1): ext4_end_bio:313: I/O error -5 writing to inode 6422727 (offset 8388608 size 6959104 starting block 474111)
[    7.460778] EXT4-fs warning (device sda1): ext4_end_bio:313: I/O error -5 writing to inode 6422727 (offset 8388608 size 6959104 starting block 474367)
[    7.474608] EXT4-fs warning (device sda1): ext4_end_bio:313: I/O error -5 writing to inode 6422727 (offset 8388608 size 6959104 starting block 474623)
[    7.488422] EXT4-fs warning (device sda1): ext4_end_bio:313: I/O error -5 writing to inode 6422727 (offset 8388608 size 6959104 starting block 474786)

Thank you.

It is booting from usb now. So uboot issue has been resolved.
But looks like your usb drive has a mess. Better checking your steps again with the document.

1 Like

Hello, @WayneWWW

I follow this.

https://docs.nvidia.com/jetson/archives/l4t-archived/l4t-3261/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/flashing.html#wwpID0E01O0HA
There’s nothing wrong with what you’re doing here.
What more can we do?

Thank you.

Hello, @WayneWWW

I allocated 450 GB, but is there a capacity limit?

Tegra210 (P3450-0000) # setenv boot_targets usb0
Tegra210 (P3450-0000) # printenv boot
  boot_a_script boot_dcache_off boot_efi_binary boot_extlinux
  boot_net_usb_start boot_pci_enum boot_prefixes boot_script_dhcp
  boot_scripts boot_syslinux_conf boot_targets bootcmd bootcmd_mmc0
  bootcmd_mmc1 bootcmd_nvme0 bootcmd_pxe bootcmd_usb0 bootdelay ...
Tegra210 (P3450-0000) # printenv boot_targets
boot_targets=usb0
Tegra210 (P3450-0000) # boot
starting USB...
Bus usb@7d000000: tegrausb: Invalid dr_mode 2 for host mode
probe failed, error -1
Bus xusb@70090000:
Firmware size 126464
Firmware timestamp: 0x5f23e558, Version: 50.26 release

Register HCSParams1: 9000124 NbrPorts: 9
Starting the controller
USB XHCI 1.00
scanning bus xusb@70090000 for devices... Device not responding to set address.

      USB device not accepting new address (error=80000000)
4 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found

Device 0: Vendor: Samsung  Rev: 0301 Prod: SSD 860 EVO 500G
            Type: Hard Disk
            Capacity: 476940.0 MB = 465.7 GB (976773168 x 512)
... is now current device
** Unrecognized filesystem type **

Thank you.

Can you try some usb pendrive to test your setup first?

1 Like

Hello, @WayneWWW

If I use jetson nano emmc module, this is right?
sudo BOOTDEV=sda1 ./flash.sh --no-flash jetson-nano-devkit-emmc sda1

Thank you.

yes

Hello, @WayneWWW

Success,

But on the 500GB samsung V-NAND SSD 860EVO device.
After allocating 450GB it failed.
Can you test it internally?

Thank you.

Hello, @WayneWWW

Is it possible to permanently set boot_targets in uboot?
It seems that setenv boot_targets is a one-time setting.

Thank you.

You need to rebuild the uboot. The link kayccc provided has the file to modify.

1 Like