# Using IMX219-camera with TX2 4GB

**URL:** <https://forums.developer.nvidia.com/t/using-imx219-camera-with-tx2-4gb/203070>\
**Category:** Jetson TX2\
**Tags:** gstreamer, camera\
**Created:** [February 10, 2022, 2:25pm UTC](https://forums.developer.nvidia.com/t/using-imx219-camera-with-tx2-4gb/203070 "2022-02-10T14:25:42Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![bruker37](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@bruker37](https://forums.developer.nvidia.com/u/bruker37)\
**Post date:** [February 10, 2022, 2:25pm UTC](https://forums.developer.nvidia.com/t/using-imx219-camera-with-tx2-4gb/203070/1 "2022-02-10T14:25:42Z")

</div>

Hello!

I’m trying to get a camera to work with GStreamer on a TX2 4GB.

The camera is an IMX219 module (I think it is [this one from Amazon](https://www.amazon.com/Jetson-Nano-Camera-IMX219-160-8-Megapixels/dp/B07T43K7LC)) and connected to the TX2 4GB through a MIPI-connector on our custom PCB/carrier board.

The MIPI-connector is connected to CAM0 and CSI0 on the TX2 4GB (PINS G8, H8, H26, H27, G27, G28, F28, and F29) on the PCB.

I have tried to run GStreamer with  
“_gst-launch-1.0 nvarguscamerasrc ! omxh264enc ! splitmuxsink location=%02d.mp4 max-size-time=1000000000 max-files=100_”,  
but get an error with  
“_Error generated. /dvs/git/dirty/git-master\_linux/multimedia/nvgstreamer/gst-nvarguscamera/gstnvarguscamerasrc.cpp, execute:725 **No cameras available** _”.

I have tried to look for _/dev/video0_, but it doesn’t exist.  
I’ve also looked for imx219 in dmesg with “_dmesg | grep -i imx219_”, but that doesn’t return any results.

As far as I understand from searching this forum, I must edit some files in the device tree to enable the camera, but I have yet to understand where to begin.

Can anyone please help me get the camera working?

Best regards  
Magnus Johansen

---

<div class="post-metadata">

**Author:** ![DaneLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/danelll/32/14043_2.png) [@DaneLLL](https://forums.developer.nvidia.com/u/DaneLLL)\
**Post date:** [February 11, 2022, 3:49am UTC](https://forums.developer.nvidia.com/t/using-imx219-camera-with-tx2-4gb/203070/2 "2022-02-11T03:49:05Z")

</div>

Hi,  
By default we support Raspberry Pi camera v2 on Jetson Nano, Xavier NX, TX2 NX. For this camera, you would need to get help from the vendor for sensor driver porting. It is not plug and play.

---

<div class="post-metadata">

**Author:** ![bruker37](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@bruker37](https://forums.developer.nvidia.com/u/bruker37)\
**Post date:** [February 11, 2022, 8:17am UTC](https://forums.developer.nvidia.com/t/using-imx219-camera-with-tx2-4gb/203070/4 "2022-02-11T08:17:24Z")

</div>

Thank you for the quick reply!  
I will contact the vendor for help.

However, I do have some follow-up questions.

Why does is the camera plug and play on the Jetson Nano (in the Nano dev kit), but not on the TX2 4GB?

Is it not possible to use the same driver on both devices?

I’m sorry if they seem stupid, but I just want to understand.

Best regards  
Magnus

---

<div class="post-metadata">

**Author:** ![DaneLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/danelll/32/14043_2.png) [@DaneLLL](https://forums.developer.nvidia.com/u/DaneLLL)\
**Post date:** [February 11, 2022, 9:17am UTC](https://forums.developer.nvidia.com/t/using-imx219-camera-with-tx2-4gb/203070/5 "2022-02-11T09:17:44Z")

</div>

Hi,  
The socket of connecting to cameras is different. For TX2, please refer to this picture:  
[What are the parameters of the camera that comes with the TX2 development board?](https://forums.developer.nvidia.com/t/what-are-the-parameters-of-the-camera-that-comes-with-the-tx2-development-board/182087)

---

<div class="post-metadata">

**Author:** ![bruker37](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@bruker37](https://forums.developer.nvidia.com/u/bruker37)\
**Post date:** [February 11, 2022, 9:51am UTC](https://forums.developer.nvidia.com/t/using-imx219-camera-with-tx2-4gb/203070/6 "2022-02-11T09:51:05Z")

</div>

I see.  
Does that mean that the drivers for the TX2 4GB are set up for a different camera connector (the one in the picture you provided)?

We have our own PCB/carrier board, which has a CSI/MIPI-connector (like on the Nano dev kit).  
What must be done for the TX2 4GB to recognize the MIPI-connector?

---

<div class="post-metadata">

**Author:** ![DaneLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/danelll/32/14043_2.png) [@DaneLLL](https://forums.developer.nvidia.com/u/DaneLLL)\
**Post date:** [February 11, 2022, 10:30am UTC](https://forums.developer.nvidia.com/t/using-imx219-camera-with-tx2-4gb/203070/7 "2022-02-11T10:30:33Z")

</div>

Hi,  
Please refer to sensor driver programming guide in [developer guide](https://docs.nvidia.com/jetson/archives/l4t-archived/l4t-3261/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/camera_dev.html#), and debug tips in  
[Jetson/l4t/Camera BringUp - eLinux.org](https://elinux.org/Jetson/l4t/Camera_BringUp)

---

<div class="post-metadata">

**Author:** ![bruker37](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@bruker37](https://forums.developer.nvidia.com/u/bruker37)\
**Post date:** [February 14, 2022, 11:47am UTC](https://forums.developer.nvidia.com/t/using-imx219-camera-with-tx2-4gb/203070/8 "2022-02-14T11:47:13Z")

</div>

Hi, Dane!

Thank you for the references. I’ve been looking through them over the weekend, but there are still some things I don’t quite understand.

I’ve seen in the kernel and source code that a (generic?) driver for a (generic?) IMX219 is present. I understand that there might be some technical differences between cameras, but are they really so different that the kernel doesn’t even recognize that a camera is connected?

I’m sorry for bugging you, but I’m just trying to understand how the camera might be recognized, and how I might make it work.

-Magnus

---

<div class="post-metadata">

**Author:** ![DaneLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/danelll/32/14043_2.png) [@DaneLLL](https://forums.developer.nvidia.com/u/DaneLLL)\
**Post date:** [February 15, 2022, 10:06am UTC](https://forums.developer.nvidia.com/t/using-imx219-camera-with-tx2-4gb/203070/9 "2022-02-15T10:06:39Z")

</div>

Hi,  
You would need to add device tree accordingly. The device tree for Raspberry Pi camera v2 is in the dts files of Jetson Nano/Xavier NX/TX2 NX. You can refer to it and add to dts of TX2 4GB. And i2c bus number, connected CSI ports depend on hardware design. Would need to change it accordingly.

Please also refer to this tutorial:  
[Jetson Embedded Platform (JEP) Develop a V4L2 Sensor Driver](https://www.brainshark.com/1/player/nvidia?dm=5&pause=1&nrs=1&fb=0&r3f1=2e146a393538607222680b69632224353a617a527d222864&custom=jep_v4l2_sensordriver)

---

<div class="post-metadata">

**Author:** ![bruker37](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@bruker37](https://forums.developer.nvidia.com/u/bruker37)\
**Post date:** [February 17, 2022, 2:30pm UTC](https://forums.developer.nvidia.com/t/using-imx219-camera-with-tx2-4gb/203070/10 "2022-02-17T14:30:02Z")

</div>

Hi, Dane!

Thank you for the information! I think I’m starting to understand the fundamentals now.

I downloaded the source code for Nano, and think I found the device tree for the camera in _tegra210-porg-camera-rbpcv2-imx219.dtsi_ and _tegra210-camera-rbpcv2-imx219.dtsi_.

> And i2c bus number, connected CSI ports depend on hardware design. Would need to change it accordingly.

I see that on the Nano it uses i2c@546c0000, but how do I know which bus and CSI ports I should use for the TX2 4GB?

The camera is connected to the following pins (if that helps):

- I2C\_CAM\_CLK (C6)
- I2C\_CAM\_DAT (D6)
- CAM0\_PWR# (G8)
- CAM0\_RST# (H8)
- CSI0 data and clock pins (F28, F29, G27, G28, H26, H27)

---

<div class="post-metadata">

**Author:** ![DaneLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/danelll/32/14043_2.png) [@DaneLLL](https://forums.developer.nvidia.com/u/DaneLLL)\
**Post date:** [February 18, 2022, 2:05am UTC](https://forums.developer.nvidia.com/t/using-imx219-camera-with-tx2-4gb/203070/11 "2022-02-18T02:05:51Z")

</div>

Hi,  
Please check product design guide and confimr the pins are correctly connected:  
[https://developer.nvidia.com/embedded/dlc/jetson-tx2-series-oem-product-design-guide](https://developer.nvidia.com/embedded/dlc/jetson-tx2-series-oem-product-design-guide)

Please also try to get help from the camera vendor. To confirm if the board is compatible with TX2 4GB and if there is existing device tree/driver you can apply directly.

---

<div class="post-metadata">

**Author:** ![bruker37](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@bruker37](https://forums.developer.nvidia.com/u/bruker37)\
**Post date:** [February 18, 2022, 8:24am UTC](https://forums.developer.nvidia.com/t/using-imx219-camera-with-tx2-4gb/203070/12 "2022-02-18T08:24:32Z")

</div>

I’m still waiting for a reply from the vendor, however, I still want to keep working on it in the meantime.

I’ve looked through the MIPI CSI section of the Product Design Guide (ch. 9), and from what I can tell the pins are correctly connected. I’m still not sure about the i2c buses though. I see that most camera drivers for the TX2 series use “_i2c@3180000_”, so should I use that, or is it chosen in a particular way?

---

<div class="post-metadata">

**Author:** ![DaneLLL](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/danelll/32/14043_2.png) [@DaneLLL](https://forums.developer.nvidia.com/u/DaneLLL)\
**Post date:** [February 22, 2022, 1:35am UTC](https://forums.developer.nvidia.com/t/using-imx219-camera-with-tx2-4gb/203070/13 "2022-02-22T01:35:45Z")

</div>

Hi,  
Yes, I2C CAM is _i2c@3180000_. Please map table 66 in product design guide with device tree.

```auto
aliases {
                sdhci0 = "/sdhci@3400000";
                sdhci1 = "/sdhci@3420000";
                sdhci2 = "/sdhci@3440000";
                sdhci3 = "/sdhci@3460000";
                i2c0 = "/i2c@3160000";
                i2c1 = "/i2c@c240000";
                i2c2 = "/i2c@3180000";
                i2c3 = "/i2c@3190000";
                i2c4 = "/bpmp_i2c";
                i2c5 = "/i2c@31b0000";
                i2c6 = "/i2c@31c0000";
                i2c7 = "/i2c@c250000";
                i2c8 = "/i2c@31e0000";

```

In the table the index starts from 1 and in device tree it starts from 0, so index 1 in table maps to index 0 in device tree. Please note this.

---

<div class="post-metadata">

**Author:** ![bruker37](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@bruker37](https://forums.developer.nvidia.com/u/bruker37)\
**Post date:** [March 1, 2022, 8:25am UTC](https://forums.developer.nvidia.com/t/using-imx219-camera-with-tx2-4gb/203070/14 "2022-03-01T08:25:41Z")

</div>

Sorry for the late reply.  
I’ve been sick for a week with Covid, but I’m back on the project now!

Thanks for the info. I found the table in the design guide and saw that the third i2c is indeed for the camera.

I am going to attempt to write a driver for the camera this week, using the existing driver for rbpcv2 on the Nano as a base. If there is anything you think I should know about that you haven’t shared yet feel free to share it!

I will come back with the results as soon as I am able to.

Best regards  
Magnus

---

<div class="post-metadata">

**Author:** ![bruker37](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@bruker37](https://forums.developer.nvidia.com/u/bruker37)\
**Post date:** [March 9, 2022, 9:27am UTC](https://forums.developer.nvidia.com/t/using-imx219-camera-with-tx2-4gb/203070/15 "2022-03-09T09:27:09Z")

</div>

Quick update!

I’ve been having trouble figuring out how to flash the updated device tree to the Jetson.  
I tried to use the “dtc” command on the main file (tegra186-quill-p3489-0888-a00-00-base.dts), however, it failed to parse the file.  
I did some research and found out that the file in the source code is not a pure device tree.

I did find the device tree in the dtb-format in the kernel/dtb folder and converted that back to dts using the “dtc” command.  
However, I find that file more confusing to work with, probably because the source code is segmented into several files, while the device tree has all those files combined into one giant file.

I have also been pulled off this project for a couple of weeks, but I will update here to keep this thread alive until I’m back.

-Magnus

---

<div class="post-metadata">

**Author:** ![cuong.pham](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@cuong.pham](https://forums.developer.nvidia.com/u/cuong.pham)\
**Post date:** [September 13, 2022, 1:01am UTC](https://forums.developer.nvidia.com/t/using-imx219-camera-with-tx2-4gb/203070/16 "2022-09-13T01:01:55Z")

</div>

Hello @bruker37, I have the same camera as yours and I’m trying to connect it to a custom TX2 board. Have you managed to make it work? If yes, please share your solution! I’m not so familiar with modifying device tree files so if you could update your progress or potential solutions, I would be so grateful. Thank you very much!

---

<div class="post-metadata">

**Author:** ![bruker37](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@bruker37](https://forums.developer.nvidia.com/u/bruker37)\
**Post date:** [September 13, 2022, 6:47am UTC](https://forums.developer.nvidia.com/t/using-imx219-camera-with-tx2-4gb/203070/17 "2022-09-13T06:47:54Z")

</div>

Hi @cuong.pham

I, unfortunately, do not work on this project anymore and did not do it when the team solved the problem.  
However, I can reach out to the team and ask if any of them can update this post with the solution.

Best regards  
Magnus

---

<div class="post-metadata">

**Author:** ![cuong.pham](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@cuong.pham](https://forums.developer.nvidia.com/u/cuong.pham)\
**Post date:** [September 13, 2022, 7:29am UTC](https://forums.developer.nvidia.com/t/using-imx219-camera-with-tx2-4gb/203070/18 "2022-09-13T07:29:53Z")

</div>

Thanks a lot, @bruker37! Yes, if you can ask your team for any information regarding the project, please let me know as well. I really appreciate your help, Magnus.

Have a nice day!

Garlik

---

<div class="post-metadata">

**Author:** ![bruker37](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@bruker37](https://forums.developer.nvidia.com/u/bruker37)\
**Post date:** [September 13, 2022, 8:41am UTC](https://forums.developer.nvidia.com/t/using-imx219-camera-with-tx2-4gb/203070/19 "2022-09-13T08:41:16Z")

</div>

No problem, @cuong.pham

I have sent the team a mail asking if they can provide some info regarding the solution here.  
Hopefully, they have some time to help you too!

Have a nice day, you too!

Magnus

---

<div class="post-metadata">

**Author:** ![cuong.pham](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@cuong.pham](https://forums.developer.nvidia.com/u/cuong.pham)\
**Post date:** [September 13, 2022, 10:10am UTC](https://forums.developer.nvidia.com/t/using-imx219-camera-with-tx2-4gb/203070/20 "2022-09-13T10:10:44Z")

</div>

That’s great! Once again we really appreciate your help Magnus. Looking forward to your update!

Regards,  
Garlik

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [October 5, 2022, 5:36am UTC](https://forums.developer.nvidia.com/t/using-imx219-camera-with-tx2-4gb/203070/22 "2022-10-05T05:36:00Z")

</div>

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