Data capture from four 2 lane CSI sensors

Platform: xavier nx
Issue: not able to receive from one of the four 2-lane sensors connected to CSI pads AB CD & EF.

I have four sensors connected over two CSI Lanes each.

Sensor-1 is connected to CSI-A
Sensor-2 is connected to CSI-C
Sensor-3 is connected to CSI-D
Sensor-4 is connected to CSI-E

I have configured the dtsi file accordingly. “port-index” values for sensor-1 is “0” , for sensor-2 is “2”, for sensor-3 is “3” and for sensor-4 is “4”

I used sensor developer programming guide page to finalise the port index values.

For each sensor I have enabled two CSI lanes (bus-width) and 4 video devices i-e i am expecting data from each sensor from 4 video devices. I checked the video device from Xavier by listing them using ls /dev/vid* and using this command I am able to see 16 video devices (4 from each sensor)

The current status is I am able to receive data from sensors 1,2&4 but tried to read from sensor 3 results in select timeouts.

Can anyone please help me identify the issue which is preventing data reception from sensor-3 ? The hardware connections and sensors are all fine. I have pretty much looked into all relevant topics on Nvidia Forums but not able to solve the issue.

It would be great if someone could give some expert advice on this issue

Why is 16 video node for 4 sensors? Each sensor should only binding one video node.

Shane,

Sorry for the confusion.
It is a custom made sensor, with each sensor being a packaged unit of 4 other sensors. So there are a total of 16 sensors.

A better visualization would be , the setup is somewhat similar to the one in this diagram

image

The connections to CSI pads are different in the diagram above and in our setup. We have connections made to pads A, C, D & E

So both 4 sensors connect to CSI-D fail to capture? or what the sensor-3 connect to?

Hope this table clarifies,

sensors number connection status
0-3 CSI-0 (CSI-A) working
4-7 CSI-2 (CSI-C) working
8-11 CSI-3 (CSI-D) not working
12-15 CSI-4 (CSI-E) working

Check below link to get trace log for more information.

https://elinux.org/Jetson/l4t/Camera_BringUp

Ok I’ll look into it :)

Till then I have one more doubt related to this issue.

For a while I have been trying making changes to the port-index parameter in the dtsi in order to specify the correct CSI connections.

Is there some way to check if the correct port-index and other parameters are actually getting applied after copying the dtb files to /boot/ & /boot/dtb ?

You can enable the dev_dbg in csi5_fops.c/vi5_fops.c to confirm the configure.

Hi thanks for suggesting the file.

I performed an experiment,
I configured dtsi to initialize only the 12 sensor modules, i-e three groups of four sensors.

First I assigned the port-index value as 0, 2, & 4 for the three groups in the dtsi file. I guess this way I configured the setup for using sensors connected to CSI-A, CSI-C & CSI-E. This configuration worked fine and I was able to receive data from all the three group of sensors.

Now,

I changed the “port-index = <4>“ to “port-index = <3>“ and if my understanding is correct then this way I configured the setup to use CSI-A, CSI-C & CSI-D. But this time I was not able to receive any data from any of the sensor connected to CSI-E.

Now I moved on to look into the kernel source and I came around a function, *static int tegra_csi_channel_init_one(struct tegra_csi_channel chan) in kernel/nvidia/platform/tegra/camera/csi/csi.c and here in this function I added a printk() for chan->ports[i].csi_port after line 950.

Now after compiling the kernel src and copying the Image to /boot and the dtb file to /boot & /boot/dtb/, I ran my application but to my surprise I saw that the port numbers logged were 0,0,0,0,2,2,2,2,4,4,4,4 as if changing port-index to <3> did not have any effect.

I don’t know if I am banging my head in the right direction and files but if my explanation is clear then could you please share any comments or suggestions on this :)

If above findings are meaningful then is there any suggested change in kernel src to hardcode the src to use CSI-D as one of the csi ports.

This way I will be able to collect some data from the sensors at CSI-D :)

Make sure your Image and dtb was applied.
You can check by below command
dmesg | grep -i kernel
uname -a

Hi Shane,

Thanks for the help.

The issue has been fixed.

Until now, after building the kernel with dtsi changes, I had been simply coping the Image to /boot/ and dtb to /boot & /boot/dtb/ along with a new FDT entry in the /boot/extlinux/extlinux.conf file but the changes corresponding to the CSI parameters like “port-index” was not getting reflected on the jetson side. I was able to figure it out by adding some logs in the csi.c file. The logs showed that port numbers being used by the OS were not same as that specified in dtsi hence I tried to perform complete flash of the jetson instead of just copying the files to /boot etc. and this solved the issue.

This issue is very surprising as by simple copying of the files, other changes like video devices (/dev/video*) were getting reflected on the jetson but port-index was not !