IntelRealSense / realsense_mipi_platform_driver

Intel® RealSense™ camera driver for GMSL* interface
GNU General Public License v2.0
18 stars 15 forks source link

Orin Nano support #221

Open masip85 opened 3 months ago

masip85 commented 3 months ago

Hello

I've read Orin Nano is not supported. I've tried to use this project with 5.3 and 6.0 versions without success. Why is that? Can I modify something to achieve it?

Nir-Az commented 3 months ago

Jetson Nano is not "Officially" supported because it is not tested on our side. As I see, many users from the community use it. I recommend going over https://github.com/IntelRealSense/librealsense/issues

masip85 commented 3 months ago

But what I am seeing at the issues of librealsense is people who is using GSML with embedded (normally Connect Tech solutions). But I am using 9296 deserializer board.

I've found that at step:

With Jetson-IO tool: sudo /opt/nvidia/jetson-io/jetson-io.py

    Configure Jetson AGX CSI Connector
    Configure for compatible hardware
    Jetson RealSense Camera D457

With command line

sudo /opt/nvidia/jetson-io/config-by-hardware.py -n 2="Jetson RealSense Camera D457"

the output is: NameError: No configuration found for Jetson RealSense Camera D457 on Jetson 24pin CSI Connector!

What should I modify to test it?

masip85 commented 1 month ago

Ok. I've tried modifying this:

build_all.sh

-    cp $SRCS/nvidia-oot/device-tree/platform/generic-dts/dtbs/tegra234-p3737-0000+p3701-0000-nv.dtb $TEGRA_KERNEL_OUT/rootfs/boot/dtb/
+    cp $SRCS/nvidia-oot/device-tree/platform/generic-dts/dtbs/tegra234-p3768-0000+p3767-0005-nv.dtb $TEGRA_KERNEL_OUT/rootfs/boot/dtb/

Also I've avoided the headers with the pin configuration of the Orin, and I've changed them for the headers I believe are usable for :

diff --git a/hardware/realsense/tegra234-camera-d4xx-overlay.dts b/hardware/realsense/tegra234-camera-d4xx-overlay.dts
index 42b2cef..aee4eff 100644
--- a/hardware/realsense/tegra234-camera-d4xx-overlay.dts
+++ b/hardware/realsense/tegra234-camera-d4xx-overlay.dts
@@ -6,7 +6,7 @@

 #include <dt-bindings/clock/tegra234-clock.h>
 #include <dt-bindings/gpio/tegra234-gpio.h>
-#include <dt-bindings/tegra234-p3737-0000+p3701-0000.h>
+#include <dt-bindings/tegra234-p3767-0000-common.h>
diff --git a/hardware/realsense/tegra234-camera-d4xx-overlay-dual.dts b/hardware/realsense/tegra234-camera-d4xx-overlay-dual.dts
index 88f82ee..10f06df 100644
--- a/hardware/realsense/tegra234-camera-d4xx-overlay-dual.dts
+++ b/hardware/realsense/tegra234-camera-d4xx-overlay-dual.dts
@@ -6,7 +6,8 @@

 #include <dt-bindings/clock/tegra234-clock.h>
 #include <dt-bindings/gpio/tegra234-gpio.h>
-#include <dt-bindings/tegra234-p3737-0000+p3701-0000.h>
+#include <dt-bindings/tegra234-p3767-0000-common.h>

I've been able to compile everything, install (copy). Even shows up in jetson-io.py and let me change it to the new configuration. BUT, after reboot, which boot properly by the way, nothing else happens. dmseg output shows nothing when I grep by d4xx. grep by tegra-capture-vi only showing three lines.

I've double checked dtb and Image has been properly copied.

I am using a Leopard Max9296 deserializer (https://github.com/IntelRealSense/librealsense/issues/11010#issuecomment-1429319228)

What could I try? It looks like is not very far from the goal.

Arun-Prasad-V commented 1 month ago

@masip85, could you please check if I2C mux is detected or not? https://github.com/IntelRealSense/realsense_mipi_platform_driver/blob/dev/README_JP6.md#known-issues

masip85 commented 1 month ago

The Orin Nano I mentioned in previous post (I've been able to compile everything, install (copy). Even shows up in jetson-io.py and let me change it to the new configuration.) it's like nothing happened:

vmasip@nano:~$ sudo dmesg | grep i2c

[    0.253464] i2c_dev: i2c /dev entries driver
[    4.102931] tegra-i2c 3160000.i2c: Adding to iommu group 1
[    4.106675] tegra-i2c 3180000.i2c: Adding to iommu group 1
[    4.109401] tegra-i2c 31b0000.i2c: Adding to iommu group 1
[    4.114809] tegra-i2c c240000.i2c: Adding to iommu group 1
[    4.119839] i2c 1-0025: Fixing up cyclic dependency with 3520000.padctl
[    4.120643] tegra-i2c c250000.i2c: Adding to iommu group 1
[    4.126627] i2c i2c-2: Added multiplexed i2c bus 9
[    4.128382] i2c i2c-2: Added multiplexed i2c bus 10
[    4.128402] i2c-mux-gpio bus@0:cam_i2cmux: 2 port mux on 3180000.i2c adapter
[   14.229907] imx219 9-0010: imx219_board_setup: error during i2c read probe (-121)
[   14.258674] imx219 10-0010: imx219_board_setup: error during i2c read probe (-121)
vmasip@nano:~$ sudo dmesg | grep pca954x
vmasip@nano:~$ 

And yes, it's connected to csi slot 0 of orin nano dev kit.

Just in case, I paste you other Orin Nano (I've got it with JP5) normal message when you grep i2c is:

[    4.592960] i2c /dev entries driver
[    4.596699] tegra-i2c 3160000.i2c: Adding to iommu group 2
[    4.602505] tegra-i2c c240000.i2c: Adding to iommu group 2
[    4.608205] tegra-i2c 3180000.i2c: Adding to iommu group 2
[    4.613908] tegra-i2c 3190000.i2c: Adding to iommu group 2
[    4.619594] tegra-i2c 31b0000.i2c: Adding to iommu group 2
[    4.625277] tegra-i2c 31c0000.i2c: Adding to iommu group 2
[    4.630960] tegra-i2c c250000.i2c: Adding to iommu group 2
[    4.636650] tegra-i2c 31e0000.i2c: Adding to iommu group 2
[    8.781618] i2c i2c-2: Added multiplexed i2c bus 9
[    8.787310] i2c i2c-2: Added multiplexed i2c bus 10
[    8.792334] i2c-mux-gpio cam_i2cmux: 2 port mux on 3180000.i2c adapter
[   15.404324] imx219 9-0010: imx219_board_setup: error during i2c read probe (-121)
[   15.471386] imx219 10-0010: imx219_board_setup: error during i2c read probe (-121)
Arun-Prasad-V commented 1 month ago

@masip85, looks like some i2c misconfiguration in device tree only. Could you please go over the forums and see if any of the conversations helps debugging the issue? https://forums.developer.nvidia.com/t/mipi-csi2-cam-i2cmux-i2c-2-duplicates-my-i2c-0-entry/182583 https://forums.developer.nvidia.com/t/imx219-board-setup-error-during-i2c-read-probe-121/160230

masip85 commented 1 month ago

First of all: I guess error during i2c read probe is not an issue. Imx219 sensor is not related to realsense driver. Moreover, this error appears too with default JP&kernel. Am I right? So what's the point of second link:

Just in case, I've made a check and: many relate "error during i2c read probe" to hardware connection problems too (not only, obviously). So, I've moved from one physical csi port to another. Changing ribbon csi cable too. The only thing I see changing is that now I see something connected from bus 10 to bus 9:

vmasip@nano:~$ sudo i2cdetect -r -y 9
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:                         -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- 48 -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --  

By the way, no "UU" here in both buses. All logs are shown equal as before.

Regards the first link, I don't know what's the point you are looking for. Do you talk about this: https://forums.developer.nvidia.com/t/mipi-csi2-cam-i2cmux-i2c-2-duplicates-my-i2c-0-entry/182583/4?u=masip85 and changing this line?

Arun-Prasad-V commented 1 month ago

@masip85, I understand these forums are not directly related to this issue. They talk about few debugging steps. I meant to look at those and check if they can help narrowing down the issue.

I guess error during i2c read probe is not an issue. Imx219 sensor is not related to realsense driver. 
Moreover, this error appears too with default JP&kernel. Am I right?

-- Not sure. We have never tried with Orin Nano.

Regards the first link, I don't know what's the point you are looking for. Do you talk about this:
https://forums.developer.nvidia.com/t/mipi-csi2-cam-i2cmux-i2c-2-duplicates-my-i2c-0-entry/182583/4?u=masip85
and changing this line?

-- Yes, if that's applicable & possible based on your device tree.

What do you observe from below commands? sudo i2cdetect -l v4l2-ctl --list-devices

masip85 commented 1 month ago

[sudo] password for vmasip: i2c-0 i2c 3160000.i2c I2C adapter i2c-1 i2c c240000.i2c I2C adapter i2c-2 i2c 3180000.i2c I2C adapter i2c-4 i2c Tegra BPMP I2C adapter I2C adapter i2c-5 i2c 31b0000.i2c I2C adapter i2c-7 i2c c250000.i2c I2C adapter i2c-9 i2c i2c-2-mux (chan_id 1) I2C adapter i2c-10 i2c i2c-2-mux (chan_id 0) I2C adapter i2c-11 i2c NVIDIA SOC i2c adapter 0 I2C adapter

Cannot open device /dev/video0, exiting.

I am checking the device tree and it's dependencies, and I really don't know if that line must be changed. I've got a lack of understanding of device trees.

masip85 commented 3 weeks ago

I've been trying to obtain help from nvidia, but didn't work out. Do you have any clue I can try?