patching / compiling kernel with Auvidea J20 CSI camera module / IMX219 on TX2 Jetpack 3.2 (28.2)

Hi,
New in here and to the TX2 :)
I have patched the kernel source (jetpack 3.2) to include the Auvidea J20 module, selected and enabled it in xconfig.

But while compiling it looks for this files and cant find them:

+#include <media/v4l2-chip-ident.h>
+#include <media/camera_common.h>
+#include <media/soc_camera.h>

drivers/media/i2c/j20.c:32:35: fatal error: media/v4l2-chip-ident.h: No such file or directory

I can manually locate and copy the camera_common.h and soc_camera.h, but those again wants a lot of other header files that are suppose to be in media/

The v4l2-chip-ident.h is no where to be found, but i am sure i am doing something wrong, i should-en need to locate this files should i ?

I am compiling the kernel directly on the TX2 like this description:
https://github.com/jetsonhacks/buildJetsonTX2Kernel

I have also downloaded the kernel sources on my Ubuntu machine just in case there was some difference between building on the TX2 or a Ubuntu pc, but the v4l2-chip-ident.h is still no where to be found, going crazy here :)

I was looking around and I see v4l2-chip-ident.h only in the 3.x kernel series…it doesn’t seem to be part of the newer releases with the 4.x kernel series. The patch probably wasn’t intended for a recent kernel.

Ahh… you seem to be correct :/

I asked Auvidea for the most resent version of the Auvidea J20 module patch when i ordered it about 3 weeks back, never got a reply…

So i got a patch from a very helpful member of this forum, but it’s for the TX1, was hoping that part hadn’t changed to much on the TX2 :/

The patch i have is called: 0003-add-j20-board-driver.patch

There is users that have the J20 working on the TX2 in here, so maybe someone that reads this could share it with me ? (spawn3232@hotmail.com)

When it comes to the IMX219 sensor, Ridgerun has provided me with a set of patches for Jetpack 3.1 TX2 so those will probably not be to hard to get working on Jetpack 3.2…

So, in the lack of any complete info on how to get the Auvidea J20 board to work on Jetson TX2 JP3.2, this is my findings so far:

First of, the J20 board wont work with anything if you don’t set up the hardware first.
Auvidea say’s in their J20_technical_reference_1.0 that:

“The CAM_CLK by default is connected to the CAM_CLK
signals of the 120 pin dev kit connector. So R11, R12, R15,
R16, R17, and R18 are installed. 0R resistors (0603 size) or
solder jumpers.”

This is simply not true, the board comes with no 0r resistors or jumpers set up and want work with anything, make a solder jumper on R11,12,15,16,17 and 18.

Next of, if you are using the board on a TX1 and want to manual test the J20 / gpio do what the
J20_technical_reference_1.0 say’s:

sudo i2cset -f -y 1 0x77 3 0xfb
sudo i2cset -f -y 6 0x20 6 0x3e
sudo i2cset -f -y 6 0x20 7 0x33
sudo i2cset -f -y 6 0x20 2 0xfe
sudo i2cset -f -y 6 0x20 3 0xff

The Gpio led on the J20 will light up and you should be able to find your camera’s i2c address using: sudo i2cdetect -y -r 0

Now comes the secret part :) that only Ridgerun will tell you and not mentioned by a word on the Auvidea web site, as you know, the TX2 with JetPack 3.2 has changed the gpio so to do the same on a TX2 you must use:

sudo i2cset -f -y 0 0x77 3 0xfb
sudo i2cset -f -y 2 0x20 6 0x3e
sudo i2cset -f -y 2 0x20 7 0x33
sudo i2cset -f -y 2 0x20 2 0xfe
sudo i2cset -f -y 2 0x20 3 0xff

If i do a sudo i2cdetect -y -r 1 now, i will get:

 0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f

00: – -- – -- – -- – -- – -- – -- –
10: 10 – -- – -- – -- – -- – -- – -- – -- –
20: – -- – -- – -- – -- – -- – -- – -- – --
30: – -- – -- – -- – -- – -- – -- – -- – --
40: – -- – -- – -- – -- – -- – -- – -- – --
50: – -- – -- – -- – -- – -- – -- – -- – --
60: – -- – -- 64 – -- – -- – -- – -- – -- –
70: – -- – -- – -- – --

0x10 is the correct address for a Raspberry pi 2.1 cam IMX219 sensor and 0x64 is the i2c crypto chip, so the J20 is working :)

So my next step was to copy media/v4l2-chip-ident.h from JetPack 3.0 ? (doesn’t exist in the newer 3.1 / 3.2), and apply the 0003-add-j20-board-driver.patch.

This went ok and diden’t complain / throw any errors, after that there should be a src/drivers/media/i2c/j20.c file in your kernel source.

enabled J20 in menuconfig, compiled, copied new kernel and did a reboot, i know would assume that the gpio led should light up after boot, like when you do this manually with i2cset, but that docent happen.

Shouldn’t the J20 driver now enable the correct gpio pins, and start probing for a known camera sensor ? (have not patch or made any attempt on the IMX219.C yet, need to know that J20.c works first)

It might have something to do with the old and the new way of setting up the gpio, like i did manually in the post over this one, but where is that reflected / changed ?

The TX2, J20 and dual RPI 2.1 cams are going to be the “work horse” and “eye’s” in a Inmoov robot project:
http://inmoov.fr/build-yours/.

And will for sure be looking in to Nvidia’s Isaac SDK when it gets released :)
https://blogs.nvidia.com/blog/2018/03/27/isaac-robotics-sdk/

Any help to get the RPI cams and the J20 running on the TX2 JetPack 3.2 (28.2) would really be appreciated, and speed things up for me / us (we are more users that has acquired the same setup to be used in the Inmoov) :)

Edit:
The j20.c is released under MODULE_LICENSE(“GPL v2”);
So i attached it here if someone wants to have a look.

tested it with both #include <dt-bindings/gpio/tegra-gpio.h> and #include <dt-bindings/gpio/tegra186-gpio.h> , same result…

j20.c (2.94 KB)

Any luck in getting this to work?