meta-tegra BSP Layer

repository·master·Indexed 20 days ago

https://github.com/oe4t/meta-tegra

An OpenEmbedded/Yocto Board Support Package (BSP) layer for building custom Linux distributions for NVIDIA Jetson hardware modules. Supported hardware includes Jetson AGX Thor, AGX Orin, Orin NX, and Orin Nano. Compatible with Jetson Linux R39.2.0, JetPack 7.2, and the blacksail LAYERSERIES_COMPAT. Provides guidance on creating custom MACHINE configurations, configuring flashvars, managing pinmux DTSI and BCT DTS files, and implementing disk encryption using LUKS.

Tokens
15.3K
Snippets
45
Records
76
Agent score
64%

What's inside meta-tegra

  1. Overview of meta-tegra BSP layer

    master

    The meta-tegra layer is an OpenEmbedded/Yocto Board Support Package (BSP) layer designed for NVIDIA Jetson Modules. It provides the necessary recipes and configurations to build Yocto-based Linux distributions for specific Jetson hardware.

    Supported Hardware:

    • Jetson AGX Thor development kit
    • Jetson AGX Orin development kit
    • Jetson Orin NX 16GB (p3767-0000) in Xavier NX (p3509) carrier
    • Jetson Orin NX 16GB (p3767-0000) in Orin Nano (p3768) carrier
    • Jetson Orin Nano development kit
    • Jetson AGX Orin Industrial 64GB (P3701-0008) in Orin AGX (P3737) carrier

    Compatibility Requirements:

    • Jetson Linux release: R39.2.0
    • JetPack release: 7.2
    • Dependencies: Requires openembedded-core (master branch).
    • LAYERSERIES_COMPAT: blacksail
  2. Configure USB device mode serial port settings

    master

    The USB gadget provides a serial TTY interface for communication between the Jetson and the host.

    • On the Jetson device: The serial port is located at /dev/ttyGS0. A udev rule automatically starts serial-getty on this port when the device is created.
    • On the Host (Linux): The corresponding serial device will appear as /dev/ttyACM0 (or /dev/ttyACMx if multiple ACM devices are present).
  3. Understand the effects of minimal UEFI configuration

    master

    Enabling TEGRA_MINIMAL_BOOT = "1" changes how the UEFI environment and boot process behave:

    • Reduced UEFI Footprint: Selects a "simple" UEFI configuration based on the TNSPEC_BOOTDEV variable, including only drivers necessary for that specific boot device. Other features, such as video display, are disabled.
    • Embedded Launcher: The L4TLauncher application is built directly into the EFI image instead of being a separate binary in the ESP. This removes the requirement for BOOTAA64.EFI in the ESP.
    • Modified Boot Order: The PlatformBootOrderLib library is patched to boot from the embedded L4TLauncher while keeping the ESP accessible for capsule updates.
    • Performance: Boot speed is improved due to a smaller UEFI image and a single probed boot path.
    • Storage & Partitioning Changes: This configuration disables Android-style kernel and device tree partitions. You must use extlinux.conf support to populate /boot with your kernel and device tree. This allows you to customize your storage layout by removing the redundant kernel/device tree partitions used for Android-style boot support.
  4. Apply overlays in the rootfs partition via extlinux.conf

    master

    You can apply overlays stored in the rootfs partition instead of SPI flash by using the OVERLAYS option in extlinux.conf. This allows you to link overlays to a specific rootfs slot for easier updates.

    Note: Only overlays that modify the kernel DTB are supported, as the application occurs late in the boot sequence.

  5. Choose between nvarguscamerasrc and nvsiplcamerasrc

    master

    When configuring camera capture on Jetson, choose the source plugin based on your hardware and software requirements:

    • nvarguscamerasrc: The standard CSI camera source for most Jetson platforms. It uses the LibArgus camera API.
    • nvsiplcamerasrc: An alternative source for cameras attached via the SIPL framework (available from L4T R39.2.0 / JetPack 7.2 onwards). This requires the jetson-sipl-api package. Use this for complex camera module configurations that require an ISP tuning database.
  6. How documentation deployment works

    master

    The documentation build and deployment process is automated via GitHub Actions using the .github/workflows/mdbook-versioned.yml workflow.

    1. Build: On push to a tracked branch, the workflow runs mdbook build inside a peaceiris/mdbook container.
    2. Deploy: The resulting HTML is pushed to a subdirectory in the main branch of the external OE4T/oe4t.github.io repository using peaceiris/actions-gh-pages.

    Each branch is deployed to its own directory (e.g., master/, scarthgap/).

    Note on Deployment Credentials: The deployment step requires a repository secret named OE4T_GITHUB_DEPLOY_KEY. If this secret is missing (as is common in forks), the workflow will skip the deployment step with a warning but will not fail.

  7. Ensure host libraries are available for NVIDIA containers

    master

    NVIDIA-supplied Docker containers do not bundle most hardware-specific libraries; they expect them to be provided by the host OS. If you intend to run containers that require specific JetPack components, you must include them in your Yocto image.

    Commonly required components include:

    • TensorRT
    • cuDNN
    • Other JetPack-specific libraries

    Additionally, for containers using GStreamer, ensure you include the necessary Tegra-specific GStreamer plugins.

  8. Configure USB device mode network settings

    master

    When l4t-usb-device-mode is active, the system uses systemd-networkd to automatically configure a network bridge.

    • Bridge Device: An l4tbr0 bridge is created, combining the usb0 (ECM) and rndis0 (RNDIS) interfaces.
    • Device IP Address: The Jetson device is assigned 192.168.55.1 on this bridge.
    • Host IP Address: A DHCP server runs on the device to assign the address 192.168.55.100 to the host machine connected via USB.
  9. How extlinux.conf support works in meta-tegra

    master

    L4T extlinux.conf support is provided by NVIDIA's L4TLauncher UEFI application rather than the standard upstream UEFI specification. It is enabled by default on all Tegra machines via UBOOT_EXTLINUX = "1" in tegra-common.inc, which adds l4t-launcher-extlinux as a runtime image dependency.

    L4TLauncher uses the L4TDefaultBootMode EFI variable (GUID 781e084c-a330-417c-b678-38e696380cb9) to determine boot mode. A value of 1 selects extlinux.conf-based boot. If extlinux.conf is missing or unreadable, L4TLauncher automatically falls back to partition-based boot.

    Important Caveats:

    • The extlinux.conf syntax in L4TLauncher differs from U-Boot; parsing is not highly robust.
    • All paths in extlinux.conf must be absolute.
    • FDTDIR is not supported.
    • The kernel image directive uses LINUX instead of KERNEL.
    • UBOOT_EXTLINUX_CONSOLE is not used; use UBOOT_EXTLINUX_KERNEL_ARGS for console settings.
    • Non-ext4 root filesystems are unlikely to work due to L4TLauncher's ext4 implementation limitations.
    # Inspect the preferred boot mode on the target
    efivar -p --name 781e084c-a330-417c-b678-38e696380cb9-L4TDefaultBootMode
  10. Quickstart with tegra-demo-distro

    master

    If you are new to the platform or want to try meta-tegra quickly without configuring a custom set of layers, use tegra-demo-distro as a starting point. It provides instructions to build several demo images that showcase the capabilities of meta-tegra and its companion layers.

    https://github.com/OE4T/tegra-demo-distro
  11. Provide custom out-of-tree overlays (virtual/dtbo)

    master

    To provide custom device tree overlays (.dtbo) built from source, create a recipe that provides virtual/dtbo and inherits tegra-devicetree. The tegra-devicetree class ensures built files are installed to /boot/devicetree/ in the sysroot, where they are picked up by the l4t-launcher-extlinux recipe.

    Recipe requirements:

    • Inherit tegra-devicetree.
    • Set PROVIDES = "virtual/dtbo".
    • Include .dtso files in SRC_URI.
    • Set PREFERRED_PROVIDER_virtual/dtbo in your machine or distro configuration.
    inherit tegra-devicetree
    
    PROVIDES = "virtual/dtbo"
    COMPATIBLE_MACHINE = "(tegra)"
    
    S = "${UNPACKDIR}"
    
    SRC_URI = "file://my-board-overlay.dtso"