Devkit camera does not work with TX2 R28.x

I have a trouble running a Leopard Imaging camera kit, so I went to try out the onboard one present on the devkit. With a TX1 CVM flashed internally to R28.1 it does work correctly, but I need to get it working on a TX2 CVM.

My process was:

  • Downloaded L4T R28.2 (but the same was observed in R28.1)
  • Downloaded Sample root filesystem R28.1
  • ./ - which added stock kernel Image and DTB files
  • Created /boot/extlinux/extlinux.conf to boot these
  • Copied everything to single partition on an SD card formatted to ext4

Booted it up, and the detection of the onboard sensor passed:
nvidia@tegra-ubuntu:~$ dmesg | grep v4l2

[    2.546658] [OV5693]: probing v4l2 sensor.

Open Terminal, run:
nvidia@tegra-ubuntu:~$ nvgstcapture-1.0

Socket read error. Camera Daemon stopped functioning.....
gst_nvcamera_open() failed ret=0

** (nvgstcapture-1.0:5536): CRITICAL **: <create_capture_pipeline:4564> can't set camera to playing

** (nvgstcapture-1.0:5536): CRITICAL **: <main:5366> Capture Pipeline creation failed
** Message: <main:5373> Capture completed
** Message: <main:5423> Camera application will now exit

In a separate terminal I can observe these messages:
nvidia@tegra-ubuntu:~$ sudo /usr/sbin/nvcamera-daemon

OFParserGetVirtualDevice: virtual device driver node not found in proc device-tree
OFParserGetVirtualDevice: virtual device driver node not found in proc device-tree
LoadOverridesFile: looking for override file [/Calib/camera_override.isp] 1/16LoadOverridesFile: looking for override file [/data/nvcam/settings/camera_overrides.isp] 2/16LoadOverridesFile: looking for override file [/opt/nvidia/nvcam/settings/camera_overrides.isp] 3/16LoadOverridesFile: looking for override file [/var/nvidia/nvcam/settings/camera_overrides.isp] 4/16LoadOverridesFile: looking for override file [/data/nvcam/camera_overrides.isp] 5/16LoadOverridesFile: looking for override file [/data/nvcam/settings/e3326_front_P5V27C.isp] 6/16LoadOverridesFile: looking for override file [/opt/nvidia/nvcam/settings/e3326_front_P5V27C.isp] 7/16LoadOverridesFile: looking for override file [/var/nvidia/nvcam/settings/e3326_front_P5V27C.isp] 8/16---- imager: No override file found. ----
SCF: Error ResourceError:  (propagating from src/services/capture/CaptureServiceDeviceViCsi.cpp, function openViCsi(), line 274)
SCF: Error ResourceError:  (propagating from src/services/capture/CaptureServiceDeviceViCsi.cpp, function open(), line 334)
SCF: Error ResourceError:  (propagating from src/services/capture/CaptureServiceDevice.cpp, function openSource(), line 360)
SCF: Error ResourceError:  (propagating from src/services/capture/CaptureService.cpp, function openSource(), line 822)
SCF: Error ResourceError:  (propagating from src/api/Session.cpp, function initialize(), line 254)
SCF: Error ResourceError:  (propagating from src/api/CameraDriver.cpp, function createSession(), line 547)

This was not helpful, so I have installed qv4l2
nvidia@tegra-ubuntu:~$ qv4l2

libv4l2: error turning on stream: Bad address

And a failure message finally appeared in:
nvidia@tegra-ubuntu:~$ dmesg | grep vi4

[    3.896134] tegra-vi4 initialized
[    3.897144] tegra-vi4 subdev 150c0000.nvcsi-2 bound
[    3.897146] tegra-vi4 subdev ov5693 2-0036 bound
[  800.518525] tegra-vi4 No VI channel available!
[  800.524159] tegra-vi4 Failed to setup VI Notifier, err = -14

Any clues?

Would you please use to flash

Why do I need to flash anything?
Are the KERNEL and DTB file on the SD card not the one that actually runs on the hardware??

It seems that the Tegra comes with a restrictive bootloader which disables features on purpose (isp?), so that no one could use them even if they had the documentation. After flashing with new JetPack 3.2 as advised, the situation is even worse:

  • The SD card boot does print a lot of error messages, and ethernet does not work!
  • Internal boot has ethernet, but we can not replace the kernel and dtb file in /boot - has no effect
  • The extlinux on internal storage does not reference DTB file anymore?

But the onboard camera now works, yay.
1 problem solved, and multiple other were created. This is a total hell for developers.

How can I now change only the kernel Image and DTB file if they are not loaded from the /boot directory on eMMC?

If you are trying to use a device tree via the FDT entry in extlinux.conf it will fail…it uses a partition on the eMMC (I do not believe you can transfer this to the SD card even as a partition). The kernel would be loaded from the SD card.

Is then there a simple way to update DTB from a running system? Without using USB connection and recovery mode.

Also, some sort of warning and stop should be made in uboot if the extlinux references a DTB file.

On R28.1 the TX2 dtb is in mmcblk0p15, which is GPT partition label “kernel-dtb”. The flash tool will essentially do the same as dd to that partition with NULL bytes padded to the end of the DTB. So long as your DTB has a NULL byte at the end and so long as the partition will hold the DTB you can use dd:

sudo dd if=/somewhere/custom.dtb of=/dev/mmcblk0p15 bs=512

This partition is probably far larger than needed, I’d be surprised if it was not large enough.

You can verify after writing by the reverse of the process:

sudo dd if=/dev/mmcblk0p15 of=extracted.bin bs=512
dtc -I dtb -O dts -o verify_this.dts extracted.bin

It wouldn’t be a bad idea to save a backup of the original partition before experimenting with dd.

Note: Some parts of a DTB named in extlinux.conf do load…but the result is probably not what you are going to be expecting.

Due to some HW auto detect nvidia implement a plugin management to override some device setting to enable the detected devices. If you use the extlinux.conf to apply the device tree that will cause some device malfunction. That’s why we suggest to update the dtb by “flash -k kernel-dtb”