About sensor device registration in Jetpack-6

Dear forum,

I am migrating a camera driver from Jetpack-5 to Jetpack-6 and facing the issue that no /dev/videoX device created even-though the kernel driver is loaded (checked with lsmod). Also, no probing message in the beginning and ending of the probe function (either with dev_info() or pr_info()) is showed.

Checking the Developer Guide, Section Device Registration, it is said that there are two way, with thedevice-tree overlay :

  1. Using the Jetson-IO Tool, or
  2. Using the Main Platform Device Tree File, aka Plugin Manager,

However, it was also said by @JerryChang that the Jetson-IO Tool only works with developer kits, while we would like to migrate the custom system to the new SoM (from the working Xavier NX to Orin Nano) while keeping the rest.

Another thing, it is said in the R36.4.3 Release Note that the plugin manager is no longer supported :

This seems to be in conflict with above point #2.

Also, the example of creating a device-tree overlay for point #1 in the R36.4.3 Release Note seems obsolete as there’s no more t19x platform since Jetpack-6 :

Therefore, I am a little bit stuck for a correct way to create or apply the device-tree overlay in order to register the camera device for a custom board in Jetpack-6.2.

Could someone help to clarify, please ?

Thanks in advance and best regards,
Khang

hello khang.l4es,

may I know which JP-6 public release version you’re moving to?
you may see-also Topic 310858 for some known changes when porting DTS from JP-5 to JP-6.
or, developer guide, Camera Driver Porting to examine your sensor driver.

besides, here’s IMX185 camera overlay file used by Orin (t23x) series.
$public_sources/kernel_oot_modules_src/hardware/nvidia/t23x/nv-public/overlay/tegra234-camera-imx185-a00.dtsi

Hi @JerryChang,

I am using the latest Jetpack-6.2. I already read the link you suggesteda nd applied them but the problem is that the /dev/videoX is not created on my custom board. I would like you confirmation that using the device-tree overlay with the Jetson-IO tool is the only way to register a custom camera driver so that /dev/videoX is present and this could also be applied to a custom board instead of only developer kits as you said?

Thanks and best regards,
Khang

hello khang.l4es,

Jetson-IO changes the pin configurations through a graphic user interface, it may not able to launch if you used a custom board.
you may still using *.dtbo to load the device tree overlay. please note that, you can specify FDT alone. you can specify FDT + OVERLAYS. however, you cannot do only OVERLAYS though.
FYI, it’s due to overlays from Rootfs are processed only if DTB is coming from Rootfs. when FDT entry is not present in extlinux.conf UEFI DTB is used.

Hi @JerryChang,

So for the custom carrier board of the Jetson Orin Nano, I should define FDT as the specific device-tree of my board or define FDT = /boot/dtb/kernel_tegra234-p3768-0000+p3767-0005-nv.dtb then add OVERLAYS as the device-tree overlay of the specific hardware of my carrier board like this example : Added new drivers to kernel - #9 by KevinFFF ?

By the way of using device-tree overlay instead of direct device-tree : should I use tegra234-p3768-0000+p3767-0005-nv.dts for FDT (as in the following comment Which dts file to be used for orin nano customization - #8 by WayneWWW) and why (or why not) ?

Best Regards,
Khang

hello khang.l4es,

it depends-on your board SKUs. you may refer to Overview of T23x Device Tree Structure.
please check you’ve include this dtsi file to build the device tree, tegra234-p3767-sku-handling.dtsi
furthermore, it’s p3768-0000-p3767-0000-a0.conf to process and determine which device tree flashing onto the target.
for instance,

update_flash_args_common()
{
...
        elif [ "${board_sku}" = "0003" ]; then
                BPFDTB_FILE="tegra234-bpmp-3767-0003-3509-a02.dtb";
                DTB_FILE=tegra234-p3768-0000+p3767-0003-nv.dtb;
        elif [ "${board_sku}" = "0004" ]; then
                BPFDTB_FILE="tegra234-bpmp-3767-0004-3509-a02.dtb";
                DTB_FILE=tegra234-p3768-0000+p3767-0004-nv.dtb;
        elif [ "${board_sku}" = "0005" ]; then
                BPFDTB_FILE="tegra234-bpmp-3767-0003-3509-a02.dtb";
                DTB_FILE=tegra234-p3768-0000+p3767-0005-nv.dtb;

BTW,
please see-also EEPROM Modifications section.
since you’re having a customize board, you may need to modify the MB2 BCT file if the carrier board is designed without an EEPROM, i.e. cvb_eeprom_read_size = <0x0>.

Thanks @JerryChang,

Another question :

I add the device-tree overlay in hardware/nvidia/t23x/nv-public/overlay/tegra234-p3767-camera-p3768-NV_TOTO-cam0-4lane-overlay.dts, and the
tegra234-p3767-camera-p3768-NV_TOTO-cam0-4lane-overlay.dtbo is generated under kernel-devicetree/generic-dts/dtbs/

I then copied the newly generated dtb/dtbo to the SDK isntall folder :
cp -rv kernel-devicetree/generic-dts/dtbs/* $SDK_JP_DIR/kernel/dtb/

I checked and saw that the tegra234-p3767-camera-p3768-NV_TOTO-cam0-4lane-overlay.dtbo file is avalable under $SDK_JP_DIR/kernel/dtb/

In $SDK_JP_DIR/, modified the flash configuration (toto-orin-nano-base.conf) by adding the above device-tree overlay :
OVERLAY_DTB_FILE+=“,tegra234-p3767-camera-p3768-NV_TOTO-cam0-4lane-overlay.dtbo”;

Then update the binaries and flash the board :

sudo ./tools/l4t_update_initrd.sh

and :

sudo ./tools/kernel_flash/l4t_initrd_flash.sh --external-device nvme0n1p1 -c tools/kernel_flash/flash_l4t_external.xml -p "-c bootloader/generic/cfg/flash_t234_qspi.xml" --showlogs --network usb0 toto-orin-nano-base internal

However, the tegra234-p3767-camera-p3768-NV_TOTO-cam0-4lane-overlay.dtbo does not appear at /boot of the running board so that I could add it into the /boot/extlinux/extlinux.conf. But the main device-tree kernel_tegra234-orin-nano-TOTO-CAMERA.dtb of the board does exist under /boot/ and /boot/dtb/

I copied the tegra234-p3767-camera-p3768-NV_TOTO-cam0-4lane-overlay.dtbo to the board manually, and added it to /boot/extlinux/extlinux.conf :

TIMEOUT 30
DEFAULT primary

MENU TITLE L4T boot options

LABEL primary
      MENU LABEL primary kernel
      LINUX /boot/Image
      FDT kernel_tegra234-orin-nano-TOTO-CAMERA.dtb
      OVERLAYS tegra234-p3767-camera-p3768-NV_TOTO-cam0-4lane-overlay.dtbo
      INITRD /boot/initrd
      APPEND ${cbootargs} root=PARTUUID=75096468-f687-4df7-b6fe-f1ada581bf0b rw rootwait rootfstype=ext4 mminit_loglevel=4 console=ttyTCU0,115200 firmware_class.path=/etc/firmware fbcon=map:0 nospectre_bhb video=efifb:off console=tty0

But still no /dev/videoX or probling message shown.

Could you help?

Best Regards,
K.

hello khang.l4es,

this is only flashing QSPI, whereas those files should be flash to file system, (i.e. external)

ya, let’s have files copy to target manually for development stage.
could you please add some debug prints to check below has being called correctly?
$public_sources/kernel_oot_modules_src/kernel/nvidia-oot/drivers/media/platform/tegra/camera/sensor_common.c

int sensor_common_init_sensor_properties(...)
{
...
                dev_dbg(dev, "parsing for %s props\n", temp_str);

                err = sensor_common_parse_signal_props(dev, node,
                        &sensor->sensor_modes[i].signal_properties);

                err = sensor_common_parse_image_props(dev, node,
                        &sensor->sensor_modes[i].image_properties);

Hi @JerryChang,

After applying the patch and re-building the kernel and modules, should I re-flash with external option ?

hello khang.l4es,

you may updating kernel image individually to debug into sensor probing issue.

I would like your confirmation about correct place to flash first.

The updating / re-flashing of the kernel does not take too much time for me.

hello khang.l4es,

I’m not sure what’s the partition layout of your customize board. please check EMMC_CFG of your board config file for confirmation.
besides, please refer to.. $OUT/Linux_for_Tegra/tools/kernel_flash/README_initrd_flash.txt
you may check [Workflow 3: How to flash to an external storage] and [Workflow 4: How to flash to device with internal QSPI and an external storage device] for reference.

Hi @JerryChang,

EMMC_CFG=“flash_t234_qspi.xml”;

However, Jetson Orin Nano does not have internal storage, then I do not see the difference

hello khang.l4es,

that’s correct, Jetson Orin Nano does not have an internal storage, (i.e. eMMC)
I assume you have NVMe as your external storage per your flashing logs. it should point the partition layout to flash_l4t_t234_nvme.xml
see-also To Flash the Jetson Developer Kit Operating Software.

Hi @JerryChang,

Effectively :

~/Workspace/Ref/Platforms/Nvidia/Jetson/SDK/install/JetPack_6.2_Linux_JETSON_ORIN_NANO_TARGETS/Linux_for_Tegra  ls -l tools/kernel_flash/flash_l4t_external.xml
lrwxrwxrwx 1 khang8x khang8x 23 Thg 1   8 08:42 tools/kernel_flash/flash_l4t_external.xml -> flash_l4t_t234_nvme.xml

And I am not sure to understand what do you want me to check or share?

hello khang.l4es,

it’s suggest we keep this bug for device registration, please debug into sensor probing issue.
we may use separate forum ticket regrading to pack the dtb and dtbo file into system.img for flashing. it needs your complete flashing logs for checking.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.