2

I'm building a yocto image to run on the Jetson Nano. Right now I'm working on a Jetson Nano devkit which boots from the SD-card, and the flashing is described on the meta-tegra GitHub repo wiki. It doesn't say how to flash onto the eMMC on the Jetson Nano, only on the SDcard.

Can I copy the yocto build rootfs to the nvidia_sdk L4T tools (replacing the 'rootfs' folder)? But what about the rest of the folders (bootloader, kernel, lib, nv_tegra)? It should be the same binaries, I'm just not so sure the kernel and bootloader is the same, and don't really know about the rest.

Anyone dealing with the same issue or, even better, found a way to do this, please let me know.

Varyag
  • 676
  • 12
  • 29
  • Don't the instructions cover this? It seems they're saying you need to boot from the sdcard image, and run an installer/flash script there -- or did I misunderstand? – Jussi Kukkonen Sep 24 '19 at 13:33
  • Well so far I've only had a Jetson Nano Devkit, which only boots from SDCard and not eMMC (because it doesn't have it). The Jetson Nano production module however, has eMMC. It is there I want to flash my yocto/poky image to, but the instructions only cover the dev kit version and not the module. When building an image for the jetson nano, it creates an .sdcard file and a tegraflash.zip with flashing scripts that will allow booting (from the sdcard) when run. When building for a Jetson tx2, only the tegraflash.zip is produced which has a .img file in it and scripts to flash to the eMMC. – Varyag Sep 24 '19 at 13:40
  • Hi, have you considered the create-jetson-nano-sd.card.sh shipped with Linux4Tegra ? I am trying to flash a similar image (genivi based on baserock) but I am also interested in yocto – giacomolm Nov 16 '19 at 10:28
  • I've created an answer that solves the asked question, i hope it might be helpful for you too. I've used parts of the `create-jetson-nano-sd.card.sh` to create my own script that adds additional partitions to the *devkit jetson nano*. But for the eMMC version, I've just created a script that creates new partitions as partition images that when changing the `flash.xml.in` can be flashed together with the other necessary partition files. – Varyag Nov 18 '19 at 06:56
  • Thank you very much for sharing! I will try to re-use your script for my specific use case, that's very helpful. Cheers – giacomolm Nov 18 '19 at 10:36

1 Answers1

2

I had a conversation with the maintainer of the meta-tegra layer and ended up with creating a new machine configuration:

#@TYPE: Machine
#@NAME: Nvidia Jetson Nano
#@DESCRIPTION: Nvidia Jetson Nano prod board

KERNEL_ARGS ?= "console=ttyS0,115200 console=tty0 fbcon=map:0 net.ifnames=0"
KERNEL_ROOTSPEC ?= "root=/dev/mmcblk0p${@uboot_var('distro_bootpart')} rw rootwait"
IMAGE_ROOTFS_ALIGNMENT ?= "1024"

require conf/machine/include/tegra210.inc

KERNEL_DEVICETREE ?= "_ddot_/_ddot_/_ddot_/_ddot_/nvidia/platform/t210/porg/kernel-dts/tegra210-p3448-0002-p3449-0000-b00.dtb"

MACHINE_FEATURES += "ext2 ext3 vfat"

UBOOT_MACHINE = "p3450-porg_defconfig"

EMMC_SIZE ?= "17179869184"
EMMC_DEVSECT_SIZE ?= "512"
BOOTPART_SIZE ?= ""
BOOTPART_LIMIT ?= "10485760"
ROOTFSPART_SIZE ?= "3221225472"
ODMDATA ?= "0x94000"
EMMC_BCT ?= "P3448_A00_4GB_Micron_4GB_lpddr4_204Mhz_P987.cfg"
NVIDIA_BOARD ?= "t210ref"
NVIDIA_PRODUCT ?= "p3450-porg"
NVIDIA_BOARD_CFG ?= ""
TEGRA210_REDUNDANT_BOOT ?= "0"
PARTITION_LAYOUT_TEMPLATE ?= "flash_l4t_t210_emmc_p3448.xml"
TEGRA_SPIFLASH_BOOT ?= "0"
TEGRA_FAB ?= "300"
TEGRA_BOARDID ?= "3448"

The machine configuration is almost identical to the devkit's, but some parts had to be changed to match to Jetson Nano Production Module configurations, i.e. change the KERNEL_DEVICETREE the the one matching the newer eMMC Jetson Nano and change TEGRA_FAB accordingly. Then change the PARTITION_LAYOUT_TEMPLATE to match the emmc layout instead of the spi_sd layout (the flash_l4t_t210_emmc_p3448 is the default p3448 emmc layout provided with meta-tegra).

After this, Yocto will produce a tegraflash zip that contains the necessary partition files and a rootfs image (along side some flashing tools). Put the Jetson Nano production module into recovery mode (FORCE RECOVERY + RESET), plug in the micro-usb cable and run the doflash.sh script to flash the nano, and voila.

Varyag
  • 676
  • 12
  • 29