ar0330 on Jetson TK1

Hi,

For our computer vision experiments, we have hooked an ar0330 camera module from leopard imaging to a Jetson Tk1 devkit. The camera module was detected after a minor change in the camera dtsi file (reset line was not properly dealt with).

So the i2c path works properly and after loading the camera host driver (tegra_camera) we had a v4l device.

The ar0330 driver only partially sets up the camera module, further settings are done via user space. The fact that the driver was enabled by default in the jetson kernel and that it was detected by camera_device_detect led us to belief that the user space tool for streaming video (i.e. nvgstcapture-1.0 is aware of this device and would do proper configuration via the ar0330 device. Unfortunately, this does not seem to be the case. Since we do not have the source code of nvgstcapture, we can only guess that it only provides support for imx135.

So we have written a small program for setting up de ar0330 module through i2c. After doing so, we see communication on the MIPI bus. When we try to access the v4l device, linux crashes (see below for kernel logging).

We’d like to know whether the ar0330 is supposed to work out of the box on the Jetson TK1 devkit.

Also, we are curious to learn whether someone has the ar0330 properly working on the Jetson TK1 (or other tegra k1 platform).

Kind regards,

Jan Willem

[ 71.990862] vi vi.0: CSI_A syncpt timeout, syncpt = 11, err = -11
[ 71.999349] TEGRA_CSI_CSI_CIL_A_STATUS 0x00000010
[ 72.005359] TEGRA_CSI_CSI_CILA_STATUS 0x00000041
[ 72.010907] TEGRA_CSI_CSI_CIL_B_STATUS 0x00000000
[ 72.015883] TEGRA_CSI_CSI_CIL_C_STATUS 0x00000000
[ 72.020808] TEGRA_CSI_CSI_CIL_D_STATUS 0x00000000
[ 72.025916] TEGRA_CSI_CSI_CIL_E_STATUS 0x00000000
[ 72.030830] TEGRA_CSI_CSI_PIXEL_PARSER_A_STATUS 0x00000000
[ 72.040635] TEGRA_CSI_CSI_PIXEL_PARSER_B_STATUS 0x00000000
[ 72.046222] TEGRA_VI_CSI_0_ERROR_STATUS 0x00000000
[ 72.051310] TEGRA_VI_CSI_1_ERROR_STATUS 0x00000000
[ 72.255754] vi vi.0: CSI_A syncpt timeout, syncpt = 12, err = -11
[ 72.263893] TEGRA_CSI_CSI_CIL_A_STATUS 0x00000010
[ 72.269849] TEGRA_CSI_CSI_CILA_STATUS 0x00000041
[ 72.275103] TEGRA_CSI_CSI_CIL_B_STATUS 0x00000000
[ 72.280235] TEGRA_CSI_CSI_CIL_C_STATUS 0x00000000
[ 72.285053] TEGRA_CSI_CSI_CIL_D_STATUS 0x00000000
[ 72.290092] TEGRA_CSI_CSI_CIL_E_STATUS 0x00000000
[ 72.294949] TEGRA_CSI_CSI_PIXEL_PARSER_A_STATUS 0x00000000
[ 72.300597] TEGRA_CSI_CSI_PIXEL_PARSER_B_STATUS 0x00000000
[ 72.306238] TEGRA_VI_CSI_0_ERROR_STATUS 0x00000000
[ 72.311268] TEGRA_VI_CSI_1_ERROR_STATUS 0x00000000
[ 72.515872] vi vi.0: CSI_A syncpt timeout, syncpt = 13, err = -11
[ 72.523567] TEGRA_CSI_CSI_CIL_A_STATUS 0x00000010
[ 72.529269] TEGRA_CSI_CSI_CILA_STATUS 0x00000041
[ 72.535176] TEGRA_CSI_CSI_CIL_B_STATUS 0x00000000
[ 72.540568] TEGRA_CSI_CSI_CIL_C_STATUS 0x00000000
[ 72.545608] TEGRA_CSI_CSI_CIL_D_STATUS 0x00000000
[ 72.550430] TEGRA_CSI_CSI_CIL_E_STATUS 0x00000000
[ 72.557741] TEGRA_CSI_CSI_PIXEL_PARSER_A_STATUS 0x00000000
[ 72.566105] TEGRA_CSI_CSI_PIXEL_PARSER_B_STATUS 0x00000000
[ 72.571885] TEGRA_VI_CSI_0_ERROR_STATUS 0x00000000
[ 72.576884] TEGRA_VI_CSI_1_ERROR_STATUS 0x00000000
[ 72.781807] vi vi.0: CSI_A syncpt timeout, syncpt = 14, err = -11
[ 73.291707] Host read timeout at address e1341400
[ 73.296438] MSELECT error detected! status=0x3
[ 73.300949] ------------[ cut here ]------------
[ 73.305566] kernel BUG at drivers/platform/tegra/hier_ictlr/hier_ictlr.c:54!
[ 73.312610] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM
[ 73.318444] Modules linked in: bnep rfcomm bluetooth rfkill dm_crypt dm_mod
[ 73.325341] CPU: 0 PID: 4 Comm: kworker/0:0 Not tainted 3.10.40 #55
[ 73.331778] Workqueue: events tegra_camera_work
[ 73.336144] task: ee0d9a80 ti: ee0fc000 task.ti: ee0fc000
[ 73.341711] PC is at tegra_hier_ictlr_irq_handler+0x3c/0x40
LR is at tegra_hier_ictlr_irq_handler+0x3c/0x40
[ 73.352849] pc : [] lr : [] psr: 200e0193
[ 73.352849] sp : ee0fdca0 ip : 00000001 fp : c0c8e2f0
[ 73.364313] r10: 00000000 r9 : 00000000 r8 : ee0fc000
[ 73.369535] r7 : ee0fdd50 r6 : 0000009f r5 : c0b5f910 r4 : ed11cdc0
[ 73.376057] r3 : 00000002 r2 : 00010100 r1 : 200e0193 r0 : 00000022
[ 73.382582] Flags: nzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment kernel

Hi JW2000,

I don’t have an ar0330 working but i have done some work on other sensors so I might be able to help. By the way where did you get the board to interface the ar0330. Is it custom made?

First of all from your output log you seem to have bumped on a bug. If you look more carerfully at your log: kernel BUG at drivers/platform/tegra/hier_ictlr/hier_ictlr.c:54

Download the kernel sources (if you haven’t done it already) and look for this file: hier_ictlr.c In line 54 you will find something like this:
if (status != 0) {
pr_err(“MSELECT error detected! status=0x%x\n”,
(unsigned int)status);
BUG();
}
This BUG(); causes your crash.
Comment it out. This will not solve your problem but it may reveal it.
In addition to that modify the following file: drivers/media/platform/soc_camera/tegra_camera/vi2.c
Find a method called vi2_capture start and add the following line just after the variable declarations: TC_VI_REG_WT(cam, TEGRA_VI_CFG_VI_INCR_SYNCPT_CNTRL, (1 << 8));

Some useful information. I am not familiar with the specification of the ar0330 but do not try to initiate a capture in the YUV colorspace. Use RGB/RAW. There are a couple of lines missing in the vi2.c file, if I am not mistaken (you can find them by searching for a comment containing TBD) that will prevent you from doing it. You can also use tools like cheese or the command line tools for invoiking gstreamer pipelines.

The code that you get in your log (TEGRA_CSI_CSI_CILA_STATUS 0x00000041), indicates, if I am not mistaken, a problem with your clock. Make the changes I suggested and post the output. You might actually get the true error.

Have you checked the board-ardbeg-sensors.c file. It looks ok but check for the ar0330. If i recall correctly there are two references for ar0330 (front, back) So you might be using the wrong one although It does not seem like it, but just in case.

I hope I helped.

Hi Jan,

I am using e-CON systems 13MP camera based on Aptina AR1820HS sensor for our Jetson TK1 Kit. The camera connects through the MIPI interface. they come with the V4L2 driver.

[url]http://www.e-consystems.com/13MP-MIPI-Camera-nvidia-Jetson-TK1.asp[/url]

Hi Jan,

We are also trying to get a ar0330 camera module from leopard imaging working with jetson TK1.

We were unable to see the ar0330 camera module on I2C Bus 0. On which I2C bus did you connect the module ?
Could you share the pinout of the cable you made ?

Regards,
Romary Sonrier