Customer camera driver development

For Jetson Nano I wrote my camera driver based on camera dual imx219. I wrote new dtsi and c-file for my camera, modified / adapted the existing dtsi files, Kconfig etc.
It is correctly rebuilt with my new c-file.
After rebuild the kernel I copy
sudo cp $TEGRA_KERNEL_OUT/arch/arm64/boot/Image /boot/.
sudo cp -r $TEGRA_KERNEL_OUT/arch/arm64/boot/dts/* /boot/dtb/.

But finally after booting I can not find that my camera is recognized.

I try to use an alternative solution with flashing, by connecting my Nano with my host PC using usb cable, but my hostPC can not communicate with Nano

Could you pls help me? Thanks

Is there any way to know if driver of my camera (here ov4000) is loaded correctly?
I used
ls -1 /sys/bus/i2c/drivers |grep ov4000
and it returns ov4000

I believe that my driver is available.
Am I right here?

If it is available, then I do not know how to test the communications with my camera?
Any help?

Check dmesg to check if any clue.

dmesg | grep -i ov4000

No clue now!
What should I check else?

@ShaneCCC I used
dmesg > mylog.txt

and looked at this file and try to understand if imx219 (which my ov4000 based on) can be booted correctly.
But I found the following problems with imx219 too:
1.314553] i2c-mux-gpio cam_i2cmux: 2 port mux on Tegra I2C adapter adapter
[ 1.315199] imx219 7-0010: tegracam sensor driver:imx219_v2.0.6
[ 1.338493] tegra-vii2c 546c0000.i2c: no acknowledge from address 0x10
[ 1.338575] imx219 7-0010: imx219_board_setup: error during i2c read probe (-121)
[ 1.338642] imx219 7-0010: board setup failed
[ 1.338695] imx219: probe of 7-0010 failed with error -121
[ 1.339120] imx219 8-0010: tegracam sensor driver:imx219_v2.0.6
[ 1.340580] extcon-disp-state extcon:disp-state: cable 47 state 0
[ 1.340583] Extcon AUX1(HDMI) disable
[ 1.362422] tegra-vii2c 546c0000.i2c: no acknowledge from address 0x10
[ 1.362504] imx219 8-0010: imx219_board_setup: error during i2c read probe (-121)
[ 1.362607] imx219 8-0010: board setup failed
[ 1.362684] imx219: probe of 8-0010 failed with error -121

Surprisely, I can not found any text include “ov4000”.
Any idea? Thanks

That’s could be your device tree and kernel Image didn’t apply or device tree incorrect.

dmesg | grep -ir kernel
uname -a

@ShaneCCC I have another idea to look at a part of ov4000.dtsi file
/ {
tcp: tegra-camera-platform {
compatible = “nvidia, tegra-camera-platform”;
num_csi_lanes = <2>;
max_lane_speed = <1500000>;
min_bits_per_pixel = <10>;
vi_peak_byte_per_pixel = <2>;
vi_bw_margin_pct = <25>;
max_pixel_rate = <240000>;
isp_peak_byte_per_pixel = <5>;
isp_bw_margin_pct = <25>;

	modules {
		cam_module0: module0 {
			badge = "porg_front_RBPCV2";
			position = "front";
			orientation = "1";
			cam_module0_drivernode0: drivernode0 {
				pcl_id = "v4l2_sensor";
				devname = "ov4000 7-0010";
				proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@0/rbpcv2_ov4000_a@10";
			cam_module0_drivernode1: drivernode1 {
				pcl_id = "v4l2_lens";
				proc-device-tree = "/proc/device-tree/lens_ov4000@RBPCV2/";
		cam_module1: module1 {
			badge = "porg_rear_RBPCV2";
			position = "rear";
			orientation = "1";
			cam_module1_drivernode0: drivernode0 {
				pcl_id = "v4l2_sensor";
				devname = "ov4000 8-0010";
				proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@1/rbpcv2_ov4000_e@10";
			cam_module1_drivernode1: drivernode1 {
				pcl_id = "v4l2_lens";
				proc-device-tree = "/proc/device-tree/lens_ov4000@RBPCV2/";


I am NOT sure if the following registered data are correct:
devname = “ov4000 7-0010”;
proc-device-tree = “/proc/device-tree/cam_i2cmux/i2c@0/rbpcv2_ov4000_a@10”;

because ov4000 has I2CAdress 0x24
I do not know if we have to change it into (due to ov4000 adress 0x24???)
devname = “ov4000 7-0024”;
proc-device-tree = “/proc/device-tree/cam_i2cmux/i2c@0/rbpcv2_ov4000_a@24”;

Could you please check again?

Yes, you need change it to 0024 also need to confirm the i2c bus and modify 7 or 8 as right value.

@ShaneCCC what is a right value for 7 or 8?
How to choose them? Thanks

@ShaneCCC what does the value 7 or 8 mean in “ov4000 7-0024”?

It’s i2c bus number

@ShaneCCC i connect my camera via 2 CSI.
Where can I find out the i2c bus number?

@ShaneCCC I found a registeration:
DTS File Name: /dvs/git/dirty/git-master_linux/kernel/kernel-4.9/arch/arm64/boot/dts/…/…/…/…/…/…/hardware/nvidia/platform/t210/porg/kernel-dts/tegra210-p3448-0000-p3449-0000-b00.dts

If you are using Nano devkit the i2c should be 7 or connect 1 and 8 for connect 2.
The logs tell didn’t apply your device tree.

@ShaneCCC yes, I use Nano DevKit, so that my i2c bus number is correct.

After rebuilding kernel I copied Image and all dtb files into the boot folder (/boot).

What should I do so that my device tree can be applied ?

Add the FDT to the /boot/extlinux/extlinux.conf like below.

FDT /boot/tegra210-p3448-0000-p3449-0000-b00-user-custom.dtb

@ShaneCCC But I do not have any custom dtb file, because it is not generated after rebuilding.
I got only tegra210-p3448-0000-p3449-0000-b00.dtb, which is copied into both /boot and boot/dtb folder

I use the following command to convert this dtb-file into file temp.txt in the readable format (see my file in attachment)
./kernel/dtc -I dtb -O dts -o temp.txt /boot/dts/tegra210-p3448-0000-p3449-0000-b00.dtb

I found the device-tree for my ov4000 camera.

But I really do not understand, why the result of
dmesg | grep -i kernel
has the text:
DTS File Name: /dvs/git/dirty/git-master_linux/kernel/kernel-4.9/arch/arm64/boot/dts/…/…/…/…/…/…/hardware/nvidia/platform/t210/porg/kernel-dts/tegra210-p3448-0000-p3449-0000-b00.dts

Why did it not load DTS file tegra210-p3448-0000-p3449-0000-b00.dts from /boot folder as I expect???
temp.txt (334.7 KB)

@ShaneCCC I added FTD … line there and reboot again.
Now, I found my camera can be detected by Nano, something generated at /proc/device-tree like the dual imx219.
But I can not found /dev/video0 or /dev/video1, so that I am not able to open camera with any SW (Python or C++ using gstreamer).
Any idea? Thanks

Check the dmesg | grep -i ov4000 to check if any error case the video register failed.

No output from your check.
I believe it is ok