Jetson AGX extlinux boot issues

I am able to boot the Jetson AGX using the default extlinux.conf , but often (due to electrical noise on the serial port), the boot hangs waiting for input.
I have tried multiple ways to change extlinux.conf to boot on the default configuration, to no avail.
This is the default file from the BSP:

TIMEOUT 30
DEFAULT primary

MENU TITLE L4T boot options

LABEL primary
  MENU LABEL primary kernel
  LINUX /boot/Image
  INITRD /boot/initrd
  APPEND ${cbootargs} quiet

I have tried adding NOPROMPT, TOTALTIMEOUT, CONSOLE 0, PROMPT 0… no effect, with a press on the serial console it goes to the boot menu.
I have tried to remove the MENU TITLE line (and MENU LABEL), in which case the boot fails and hangs reporting DATA ABORT on the serial console.
I am open to re-building the extlinux package, but I could not build the sources on Jetson.
I have successfully done a custom build of cboot where the SHELL is disabled (it won’t stop there).

This is our current extlinux.conf :

TIMEOUT 10
TOTALTIMEOUT 20
DEFAULT vsystem
NOESCAPE 1
PROMPT 0
CONSOLE 0

MENU TITLE System

LABEL vsystem
  MENU LABEL vsystem
  LINUX /boot/Image
  INITRD /boot/initrd
  APPEND ${cbootargs} kpti=0 nospectre_v2 usbcore.usbfs_memory_mb=1000 usbcore.autosuspend=-1 root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyTCU0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 rootfstype=ext4

IF there are no key presses or noise, it does boot automatically, but if someone presses a key on the serial console, it stops on the boot menu forever.

Any ideas or suggestions on how to proceed here?

Thank you,

Serial console is intended to stop boot if a key is pressed. Could you use a different serial UART? If not, then you’d need to disable serial console in the bootloader stages (not recommended, much debugging would no longer be possible) to prevent this. Are you normally using this as a serial console, or for some other purpose? If for some other purpose then either picking a different UART or completely disabling serial console would do the job. Keep in mind that disabling serial console in the bootloader is a different step from disabling serial console in the Linux kernel.

We do not use the UART console for anything, but somehow there is electrical noise that often is detected as a key and blocks the boot of the system.
How would one go to change the UART or completely disabling it?
This would have to be in the bootloader, right (since loading the kernel is the next step that extlinux performs).

hello lawrence8pqxb,

could you please confirm you’re stopping autoboot as following?
I assume you’re stuck at CBoot for waiting user key-events.
for example,
here’s an option to stop autoboot.

 I> Hit any key to stop autoboot: 

Hi Jerry,

I am rather sure I am not stuck at CBoot. This is the serial I see when it gets stuck:

And it waits for a key on the choice, it will only continue once it receives the key 1.

hello lawrence8pqxb,

had you have a try to add kernel into your configuration file?
for example, here’s default configuration,

LABEL primary
  MENU LABEL primary kernel

please add it to the last of your MENU options.

LABEL vsystem
  MENU LABEL vsystem

Here is the modified extlinux.conf:

TIMEOUT 10
TOTALTIMEOUT 20
DEFAULT vsystem
NOESCAPE 1
PROMPT 0
CONSOLE 0

MENU TITLE Test Boot

LABEL vsystem
  MENU LABEL vsystem kernel
  LINUX /boot/Image
  INITRD /boot/initrd
  APPEND ${cbootargs} kpti=0 nospectre_v2 usbcore.usbfs_memory_mb=1000 usbcoree
.autosuspend=-1 root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyTCU0,,
115200n8 console=tty0 fbcon=map:0 net.ifnames=0 rootfstype=ext4 root=/dev/mmcblkk
0p1 rw rootwait rootfstype=ext4 console=ttyTCU0,115200n8 console=tty0 fbcon=map::
0 net.ifnames=0 rootfstype=ext4

And the serial console shows:

[0003.428] I> ########## USB boot ##########
[0003.437] W> No valid slot number is found in scratch register
[0003.438] W> Return default slot: _a
[0003.453] I> USB Firmware Version: 60.06 release
[0003.512] I> enabling 'vdd-5v-sata' regulator
[0003.521] I> regulator of usb2-1 already enabled
[0003.530] I> regulator of usb2-2 already enabled
[0003.538] I> regulator of usb2-3 already enabled
[0004.606] I> USB 2.0 port 4 new high-speed USB device detected
[0004.606] W> Change usb2 root port id to 2
[0004.607] W> Change usb2 root port id to 4
[0004.608] W> WARNING: event and command not matching, cmd_trb_ptr = 0xa92bf100, cmd_ring.dma = 0xa92bf140
[0004.609] E> slot id is 1
[0004.610] W> WARNING: event and command not matching, cmd_trb_ptr = 0xa92bf100, cmd_ring.dma = 0xa92bf140
[0004.620] W> WARNING: event and command not matching, cmd_trb_ptr = 0xa92bf100, cmd_ring.dma = 0xa92bf140
[0004.626] I>
[0004.627] I> Enumerated USB Device 2676:ba02
[0004.631] I>
[0004.632] E> Enumerated device doesn't belong to MSD class or protocol is not bulk-only!!
[0004.640] E> USBMSD: Failed to initialize Enumerated USB device either not an MSD device or supported protoco[0004.650] E> USBMSD: Failed to open usbmsd open, 0.
[0004.655] E> Error opening USBMSD driver 0, err: 7c7c0312
[0004.660] E> Failed to initialize device 5-0
[0004.664] E> USB boot failed, err: 2088502034
[0004.668] I> ########## Fixed storage boot ##########
[0004.673] I> Already published: 00010003
[0004.677] I> Look for boot partition
[0004.680] I> Fallback: assuming 0th partition is boot partition
[0004.686] I> Detect filesystem
[0004.713] I> Loading extlinux.conf ...
[0004.713] I> rootfs path: /sdmmc_user/boot/extlinux/extlinux.conf
[0004.756] I> Test Boot
[0004.757] I> [1]: "vsystem kernel"
[0004.757] I> Enter choice:
[0004.757] I> Invalid option: 11
[0004.757] I> Enter choice:

Is there a way to have a custom build of extlinux? I have read its source code, but the current behavior does not appear to match the source code I found on github. http://repo.or.cz/syslinux.git

hello lawrence8pqxb,

may I know how randomly is this electrical noise being detected as a key-event?

cboot sources is available via https://developer.nvidia.com/cboot-src-t18xtbz2,
according to cboot sources as following, could you please exclude the TIMEOUT variable, to make bootloader don’t waits for user-inputs.
for example,
$L4T_Sources/r32.5/Linux_for_Tegra/source/public/cboot/bootloader/partner/common/lib/linuxboot/extlinux_boot.c

static tegrabl_error_t parse_conf_file(void *conf_load_addr, struct conf *extlinux_conf)
{
...
        if (timeout != NULL) {
                /* extlinux.conf timeout is 1/10 of a second */
                user_input_wait_timeout_ms = tegrabl_utils_strtoul(timeout, NULL, BASE_10);
                user_input_wait_timeout_ms = (user_input_wait_timeout_ms / 10UL) * TIME_1MS;
        } else {
                user_input_wait_timeout_ms = 0UL;
        }

When I remove the TIMEOUT entry on extlinux.conf then it always waits for user input, ensuring the boot does not complete automatically.

hello lawrence8pqxb,

assume it’s bootloader always recognize that electrical noise as a key-event.
in order to make it skip waits for user input, and continue with default boot options.
please have bootloader modifications.
for example,

diff --git a/lib/linuxboot/extlinux_boot.c b/lib/linuxboot/extlinux_boot.c
index 908a7e6..2ddcdf9 100644
--- a/lib/linuxboot/extlinux_boot.c
+++ b/lib/linuxboot/extlinux_boot.c
@@ -273,7 +273,7 @@ static int display_boot_menu(struct conf * const extlinux_conf)
        }

        /* Get user input */
-       while (true) {
+       while (0) {
                pr_info("Enter choice: ");
                tegrabl_enable_timestamp(false);
                if (first_attempt && (user_input_wait_timeout_ms != 0UL)) {
@@ -306,6 +306,8 @@ static int display_boot_menu(struct conf * const extlinux_conf)
                }
        }

+       ch = extlinux_conf->default_boot_entry;
+       pr_info("Continuing with default option: %d\n", ch + 1);
        return ch;

That last change did it! Now the machine will boot regardless of input!
Thank you.