Unfortunately, my Jetson board won’t boot from it. I would rather use the SD card than the internal emmc. If anybody has any input, I would greatly appreciate it! Thanks!
I did some testing of a few different boot options for a supplement I’m trying to work on, and discovered what others had already mentioned…not all SD cards work even when the software install is correct. Typically you will see a series of checksum errors after the boot has started successfully. For regular data use the failed SD cards still work…they just can’t boot. Did your boot start and then offer checksum errors?
FYI, the gist of the whole thing is to install a normal installation to eMMC using u-boot; once u-boot is installed and eMMC has a /boot with everything you need it is very simple to add a duplicate entry to the primary boot entry and point it at /dev/mmcblk1p1 instead of /dev/mmcblk0p1. The eMMC could be booted still and SD card can be chosen (serial console is needed to access any choice other than default). Regardless of which choice you use for u-boot…to install to eMMC or to install to SD card…the actual u-boot will be on eMMC; the option changes where u-boot looks to find /boot configuration.
The method I used to create an SD card to boot is that it was formatted ext4 and covers the entire SD card space (I used a 16 GB SD card). After this I unpacked the sample rootfs onto the card (with sudo to preserve permissions), and then ran the “apply_binaries.sh” script using the “–root /mnt/sdcard” option (where my ext4 SD card was already mounted on /mnt/sdcard).
The command line you used would probably fail. The reason being is that on R19.x the default boot loader is fastboot, and fastboot requires naming the kernel in partition 6…the “-k 6” option is missing:
(in the above the “-L …” would have been there by default, I think the “-k 6” would still be required)
Under u-boot you’ll likely have more success anyway, but the command line you have for that is also incorrect. I’d suggest first installing to the regular eMMC and then creating an entry to boot SD card instead…once u-boot is flashed you don’t have to flash to set up anything else. So initially install without the SD card via u-boot:
Once Jetson runs on u-boot you can just add an extra entry in /boot/extlinux.conf that copies the mmcblk0p1 entry, but instead says mmcblk1p1. A root file system can be added to the SD card, and you can also use the “install_binaries.sh” script with “–root” naming the SD card mount point.
In retrospect, I suspect fastboot failed because either it failed to look at partition 6 or else partition 6 didn’t have the kernel installed. U-boot resides in the eMMC regardless of whether you tell it to find configuration in /boot of eMMC (mmcblk0p1) or /boot of SD (mmcblk1p1). By having mmcblk0p1 as the boot partition you will always have a bootable system that can aim at SD card or SATA drive, so on, and be edited without the presence of the SD card or SATA. With fastboot pointed at the SD card you’ll always need that card installed for a bootable system…any changes using fastboot this way require a complete flash. U-boot is just a simple file edit, so it wins.
@linuxdev , when you say “add an extra entry in /boot/extlinux.conf”, do you mean keep the entry that is already there by default (eMMC) and below it also add a entry for SD card? So two entries, not one. Or do you mean replace it with the SD card entry? I have a similar scenario (using uboot on 21.2.0) where i installed on internal, and then have a SD card with system.img i DD’ed on it (l4t 19.3). If i replace the eMMC entry in the extlinux.conf with a SD card entry, it wont allow me to boot into either the emmc or sd (tried using uboot terminal as well but couldnt get it to work)
Yes, keep the old entry, add a blank line, and put a copy of that block in to edit. The copy to edit will need a different “LABEL”, e.g., “R19.3-gf455cd4_SD”, a new “MENU LABEL”, e.g., “R19.3 on SD Card”, and change the “root=/dev/mmcblk0p1” to be “root=/dev/mmcblk1p1”. When this second non-default entry is selected, it will look for a root file system on the SD card’s first partition. The original default entry will still load the same kernel and eMMC.
To pick the alternate entry use a serial console and use a keystroke to interrupt u-boot when it lists the kernel choices. If you hit a button too soon just use command “boot” to tell it to keep booting, and then hit a key again (the prompts are very short in duration you have to watch closely). If you are satisfied that you want the SD card to be the default you can make the “LABEL” of the new entry “primary” and set the original “LABEL” to something like “original_R19-3”.
Regardless of where the root file system is to be found, this scheme adds any new kernels or dtb files to the eMMC’s /boot…any /boot anywhere except the eMMC would be ignored.
Oh, one thing I forgot. On all flash commands you might want to add a manually set size of eMMC to use:
-S 14580MiB
…or whatever size you want on the eMMC root. It’ll still boot to SD card if you pick SD as boot choice, so maybe you won’t want your eMMC to occupy max space.
The trouble with flashing u-boot with mmcblk1p1 (SD card contains config this way, but still lives on eMMC) is that the system will never boot without an SD card containing all of u-boot configuration, including kernel and dtb files. U-boot itself would still be on eMMC even if it looks to the SD card to configure…might as well just leave it all on eMMC and have it look for config on eMMC…this config easily can point to SD card and leave everything bootable even when the SD card is removed. I’ve set it up to use the eMMC by default, but to allow boot of anything on SD card or /dev/sda1. This works to rescue things if something goes wrong…so long as /boot lives. On the other hand, my SD cards all still have a copy of /boot as backup. I could flash and destroy eMMC and point at the SD cards and have my whole system back.
Just to clarify, installing u-boot with eMMC parameter mmcblk0p1 installs both u-boot and configuration to eMMC; installing u-boot to mmcblk1p1 still installs u-boot to eMMC…it’s only where u-boot looks for config and boot files that changes by switching parameters from mmcblk0p1 to mmcblk1p1.