OV2740 for jetson nano

tegra210-p3448-0000-p3449-0000-b00-OV2740-overlay.dts (12.5 KB)

Hi all,

The above dts file is the current version that I have applied on my jetson nano. It seems that I need to change the port index and I am wondering if I should change it to port 5 or 6. I am not sure which port should I choose even though i have read
Tegra Linux Driver as a reference. Below is the error message when I use dmesg:

log.txt (872 Bytes)

Any help would be appreciated.

Update:
After i change the default_framerate to 30 it solve the bug and it work for v4l2-ctl --stream-mmap --stream-skip=100 --stream-count=1 -d /dev/video0 --stream-to=new-6.raw but gst-launch-1.0 don’t. The following log is the information of the testing:log2.txt (2.3 KB)

Check the devname and proc-device-tree in your device tree.

Error generated. /dvs/git/dirty/git-master_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:725 No cameras available

It seems that I haven’t added the camera to the plug-in manager so the devname still is “imx219 7-0010” and proc-device-tree is " /proc/device-tree/cam_i2cmux/i2c@0/rbpcv2@0/rbpcv2_imx219_a@10". For using the plugin-manager I am trying to use veye327_jetson_nano/tegra210-porg-p3448-common.dtsi at master · veyeimaging/veye327_jetson_nano · GitHub as an example. However, it seems it is a bit outdated with JetPack4.6 and l4t32.6. Could you please suggest any examples e.g. imx477 to follow to make a Loadable Kernel Module (LKM) like Tegra Linux Driver? Because I am not very sure how to change the dts files in porg-platform.

Suggest removing the plugin manager.

https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/camera_sensor_prog.47.2.html#wwpID0E0XF0HA

i have try to make the ov2740 like imx219. and successfully changed devname abd proc/device-tree like:


				drivernode0 {
					devname = "ov2740 7-0036";
					pcl_id = "v4l2_sensor";
					proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@0/rbpcv2_ov2740_a@36";
					phandle = <0x128>;
					linux,phandle = <0x128>;
				};
			};

			module1 {
				badge = "porg_rear_RBPCV2";
				phandle = <0x12a>;
				position = "rear";
				linux,phandle = <0x12a>;
				orientation = [31 00];

				drivernode1 {
					pcl_id = "v4l2_lens";
					proc-device-tree = "/proc/device-tree/lens_ov2740@RBPCV2/";
					phandle = <0x12c>;
					linux,phandle = <0x12c>;
				};

				drivernode0 {
					devname = "ov2740 8-0036";
					pcl_id = "v4l2_sensor";
					proc-device-tree = "/proc/device-tree/cam_i2cmux/i2c@1/rbpcv2_ov2740_e@36";
					phandle = <0x12b>;
					linux,phandle = <0x12b>;
				};

However, there are other errors:

$ dmesg |grep 2740
[    1.313742] Initializing OV2740 Device Driver
[    1.313843] ov2740 7-0036: probing v4l2 sensor.
[    1.314126] ov2740 7-0036: camera_common_regulator_get (null) ERR: ffffffffffffffea
[    1.314133] ov2740 7-0036: camera_common_regulator_get (null) ERR: ffffffffffffffea
[    1.314170] ov2740 7-0036: unable to power get
[    1.314174] ov2740 7-0036: tegra camera driver registration failed
[    1.314262] ov2740: probe of 7-0036 failed with error -14
[    1.314329] ov2740 8-0036: probing v4l2 sensor.
[    1.314414] ov2740 8-0036: camera_common_regulator_get (null) ERR: ffffffffffffffea
[    1.314421] ov2740 8-0036: camera_common_regulator_get (null) ERR: ffffffffffffffea
[    1.314432] ov2740 8-0036: unable to power get
[    1.314435] ov2740 8-0036: tegra camera driver registration failed
[    1.314471] ov2740: probe of 8-0036 failed with error -14

from camera_common_regulator_get returns an error and defers the probe it seems that some regulators should be turned off. Where can I turn off the regulator or other problem should I check?

Here are my tegra210-p3448-0000-p3449-0000-b00.dtb:
dtb.txt (302.9 KB)

Does you sensor need enable any regulator? If yes you need add it to your device tree if no you need remove the regulator_enable() function call in ov2740_power_on()

Thanks! I slove it by disable the regulator and now the gst-launch-1.0 can run but still having error and the error are:

~$ gst-launch-1.0 nvarguscamerasrc num-buffers=20 ! fakesink -e -vSetting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
/GstPipeline:pipeline0/GstNvArgusCameraSrc:nvarguscamerasrc0.GstPad:src: caps = video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1
/GstPipeline:pipeline0/GstFakeSink:fakesink0.GstPad:sink: caps = video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1
GST_ARGUS: Creating output stream
CONSUMER: Waiting until producer is connected...
GST_ARGUS: Available Sensor modes :
GST_ARGUS: 1920 x 1080 FR = 59.999999 fps Duration = 16666667 ; Analog Gain range min 0.000000, max 3.000000; Exposure Range min 1000, max 430000000;

GST_ARGUS: Running with following settings:
   Camera index = 0 
   Camera mode  = 0 
   Output Stream W = 1920 H = 1080 
   seconds to Run    = 0 
   Frame Rate = 59.999999 
GST_ARGUS: Setup Complete, Starting captures for 0 seconds
GST_ARGUS: Starting repeat capture requests.
CONSUMER: Producer has connected; continuing.
nvbuf_utils: dmabuf_fd -1 mapped entry NOT found
nvbuf_utils: Can not get HW buffer from FD... Exiting...
CONSUMER: ERROR OCCURRED
ERROR: from element /GstPipeline:pipeline0/GstNvArgusCameraSrc:nvarguscamerasrc0: CANCELLED
Additional debug info:
Argus Error Status
EOS on shutdown enabled -- waiting for EOS after Error
Waiting for EOS...
(Argus) Error EndOfFile: Unexpected error in reading socket (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadCore(), line 266)
(Argus) Error EndOfFile: Receiving thread terminated with error (in src/rpc/socket/client/ClientSocketManager.cpp, function recvThreadWrapper(), line 368)


Confirm the driver and output signal by below command.

v4l2-ctl --stream-mmap -c bypass_mode=0 -d /dev/video*

yes it work,

$ v4l2-ctl --stream-mmap -c bypass_mode=0 -d /dev/video*
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 60.00 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 59.70 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 59.66 fps
<<<<<<<<<<<<<<<<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<<<<<<<<<<<^C

Looks like the tegra_sinterface in device tree isn’t correct.

I have tried to set tegra_sinterface to “serial_c” or “serial_e”. However, both do not work and the error is similar. For more information, the following are the driver and error log from dmesg and
gst-launch-1.0. extracted_proc2.txt (305.4 KB)
full_log.txt (57.8 KB)
Also the i2cdetect:

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

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

Some error from syslog:

$ cat /var/log/syslog
Oct 25 12:24:28 desktop kernel: [ 3231.843139] ov2740 7-0036: Set Mode
Oct 25 12:24:29 desktop kernel: [ 3231.882297] ov2740 7-0036: Set Gain
Oct 25 12:24:29 desktop kernel: [ 3231.882303] ov2740 7-0036: Set Exposure
Oct 25 12:24:29 desktop kernel: [ 3231.882306] ov2740 7-0036: Set Frame Rate
Oct 25 12:24:29 desktop kernel: [ 3231.882308] ov2740 7-0036: Start Streaming
Oct 25 12:24:29 desktop kernel: [ 3232.189491] video4linux video0: tegra_channel_capture_done: MW_ACK_DONE syncpoint time out!0
Oct 25 12:24:29 desktop kernel: [ 3232.198617] vi 54080000.vi: TEGRA_CSI_PIXEL_PARSER_STATUS 0x00000080
Oct 25 12:24:29 desktop kernel: [ 3232.198627] vi 54080000.vi: TEGRA_CSI_CIL_STATUS 0x00000000
Oct 25 12:24:29 desktop kernel: [ 3232.198637] vi 54080000.vi: TEGRA_CSI_CILX_STATUS 0x00000000
Oct 25 12:24:29 desktop kernel: [ 3232.198700] vi 54080000.vi: cil_settingtime was autocalculated
Oct 25 12:24:29 desktop kernel: [ 3232.198711] vi 54080000.vi: csi clock settle time: 13, cil settle time: 10
Oct 25 12:24:29 desktop kernel: [ 3232.198761] ov2740 7-0036: Stop Streaming

Is it possible that the hardware is broken or the ov2740.c/ ov2740.h/ ov2740_mode_tbls.h should edited for jetson nano? Could you suggest which part should I check? Thanks!

The v4l2-ctl command working for both /dev/video0 and /dev/video1?

v4l2-ctl --stream-mmap -c bypass_mode=0 -d /dev/video0
v4l2-ctl --stream-mmap -c bypass_mode=0 -d /dev/video1

for video0 is ok

~$ v4l2-ctl --stream-mmap -c bypass_mode=0 -d /dev/video0
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 30.00 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.85 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.80 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.77 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.80 fps
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 29.78 fps

But video1 is not working since there is only video0 on the list

~$ v4l2-ctl --stream-mmap -c bypass_mode=0 -d /dev/video1
Failed to open /dev/video1: No such file or directory
~$ ls /dev/video*
/dev/video0

From https://developer.download.nvidia.com/assets/embedded/secure/jetson/tx2_nx/Jetson_Nano_XavierNX_TX2_NX_Camera_DG-09729-001_v1.2.pdf?btb-bOxu4K3dx1M-aBJB2_0k84w5Mpp_13WhJ3MmIgSW_6eeFybZkyALeqdIu4JjNU-1tUS6ew9yGPpdoY9ln44WeHW_cWV4o0I-oqtyKvWShFlwuBkJoTzjcKA_s0W9ZgfIfLJY_sX9zholC9Gba4irul_8huEswfpL0Qne0nUDkFwfD8V9BrvASCCQ-WTCG41aD2USnsvqrCbP
Table 3-1. Developer Kit Carrier Board Camera Connector #1 Pinout
We have checked that Camera Power-down
GPIO Camera MCLK Camera I2C clock Camera I2C data have out put. For Camera Lane 0, Camera Lane 1, it have co-directional wave signal.For Camera clock lane, keep 0V when it run. It there any file should I change for the camera output? e.g. .dts or .c/.h file

One more testing:
v4l2-ctl --stream-mmap --stream-count=200 -d /dev/video0

Oct 27 15:41:15 kernel: [  224.223143] ov2740 8-0036: Set Mode
Oct 27 15:41:15 kernel: [  224.297581] ov2740 8-0036: Set Mode OK
Oct 27 15:41:15 kernel: [  224.297602] ov2740 8-0036: Start Streaming
Oct 27 15:41:15 kernel: [  224.298235] ov2740 8-0036: Start Streaming OK
Oct 27 15:41:15 kernel: [  224.298504] ov2740 8-0036: Stop Streaming
Oct 27 15:41:15 kernel: [  224.299370] ov2740 8-0036: Stop Streaming OK
Oct 27 15:41:15 kernel: [  224.325579] ov2740 8-0036: Set Mode
Oct 27 15:41:15 kernel: [  224.392542] ov2740 8-0036: Set Mode OK
Oct 27 15:41:15 kernel: [  224.392554] ov2740 8-0036: Start Streaming
Oct 27 15:41:15 kernel: [  224.393091] ov2740 8-0036: Start Streaming OK
Oct 27 15:41:18 kernel: [  227.991329] video4linux video0: tegra_channel_capture_done: MW_ACK_DONE syncpoint time out!0
Oct 27 15:41:18 kernel: [  228.000858] ov2740 8-0036: Stop Streaming
Oct 27 15:41:18 kernel: [  228.001619] ov2740 8-0036: Stop Streaming OK

from Jetson/l4t/Camera BringUp - eLinux.org

please review the configuration of "line_length" in sensor driver
try to increase the delay between video lines data send via CSI
review the sensor datasheet to check the settings of FPS range

I have tried to change line_length to 1920/1934/3840 but it still has the same error. Is there any number should I try?

Just the your dts found the tegra_sinterface and port-index is incorrect in rbpcv2_ov2740_e@36

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