AR0330 on Apalis TK1

Hello, i’ve recently made custom carrier board with custom AR0330 based camera module.
I would like to ask, which kernel modules should I use and how to configure them inside device tree?
I can see my AR0330 using “i2cdetect -y -r 2” on address 0x10 (address pin tied low).
Currently I have these modules built in:

CONFIG_TEGRA_CAMERA=y
CONFIG_VIDEO_AR0330=y

And the following inside the device tree:

        i2c3: i2c@7000c500 {
                status = "okay";
                clock-frequency = <100000>;

                ar0330@10 {
                        compatible = "nvidia,ar0330";
                        reg = <0x10>;
                        nvidia,ext_reg = <1>;
                };
        };

Kernel module gets loaded, but transmits nothing over I2C bus, V4L2 device is not available and when I tried nvcamerasrc in gstreamer, I get

NvCamHwHalOpen: Failure to open Camera Kernel Node
NvOdmImagerDeviceDetect: Failed to open HW HAL.
NvCamHwHalOpen: Failure to open Camera Kernel Node
NvOdmImagerGetModuleList: Camera node not detected - No such file or directory
IMX135 ****  Can not open camera device: No such file or directory
NvOdmImagerOpenExpanded 462: Sensor ERR
NvOdmImagerOpenExpanded FAILED!

My kernel is

Linux apalis-tk1 3.10.40-2.7.5+g22e0897 #3 SMP PREEMPT Wed Feb 21 14:27:30 CET 2018 armv7l GNU/Linux

Thank you in advance!

While NVIDIA’s Linux for Tegra aka L4T Linux kernel sources our downstream BSP is based on contains two camera stacks only the regular SoC camera one is supported by NVIDIA for the Tegra K1. Therefore nvcamerasrc which is using the other stack is not really supported. Please have a look at how our OV5640 camera module is integrated and find a suitable AR0330 sensor driver as well. Please note however that in general camera integration may require custom configuration and tuning. You may also contact our camera partner Antmicro or any other of our partner network companies knowledgeable in that domain.

Thank you, I’ve managed to configure the right stack and camera gets detected and “configured”. I’ve been also missing that I need to modify board sources in the kernel.
After that kernel stucked always imediately after gstreamer start due to syncpt failure. I’ve been able to overcome this issue by setting TC_VI_REG_WT(cam, TEGRA_VI_CFG_VI_INCR_SYNCPT_CNTRL, (1 << 8)); according to NVidia community topic. But after many hours of documentation reading, trial and error, I am still not able to get it working without lagging and permanent syncpt failures (each even syncpt). But it behaves deterministic (same state registers values for each configuration/startup procedure) and signals are looking good on oscilloscope. So I think, it is all about CSI timing setup inside AR0330, but I am not able to find out correct values.
Can you please point me to appropiate CSI (timing) registers or required configuration for tegra_camera module?

Thank you,

You are very welcome.

I’ve managed to configure the right stack and camera gets detected and “configured”. I’ve been also missing that I need to modify board sources in the kernel.

Yes, as I mentioned before.

After that kernel stucked always imediately after gstreamer start due to syncpt failure. I’ve been able to overcome this issue by setting TC_VI_REG_WT(cam, TEGRA_VI_CFG_VI_INCR_SYNCPT_CNTRL, (1 << 8)); according to NVidia community topic. But after many hours of documentation reading, trial and error, I am still not able to get it working without lagging and permanent syncpt failures (each even syncpt).

That usually points towards some configuration/hardware issue.

But it behaves deterministic (same state registers values for each configuration/startup procedure) and signals are looking good on oscilloscope.

You mean you looked at the eye diagrams of those 600 MHz/1.2 Gbps diff pairs and judged that they looked fine, right?

So I think, it is all about CSI timing setup inside AR0330, but I am not able to find out correct values. Can you please point me to appropiate CSI (timing) registers or required configuration for tegra_camera module?

I’m really sorry, but I only know that this works just fine with our OV5640 setup so I seriously doubt the issue is on the tegra camera side of things. As mentioned before I suggest you contacting one of our partner network companies knowledgeable in this area for help.