I am trying to stream MIPI CSI-2 data from a VG5761 (STM) sensor through custom GMSL2 ser/des carrier boards into a Jetson AGX Orin (JetPack 6.0). I eventually want it to be compatible with GStreamer.
I’m new to kernel development and have a couple questions:
What’s the minimum device tree overlay setup needed to see data (raw or visual) from the sensor on the Orin? I think the best approach is to write a .dts file from scratch since I have custom boards, but I’m not sure what needs to be included for basic functionality.
I currently have an external I2C script that configures the camera and ser/des via the Jetson GPIO header pins. Does this need to be part of a kernel driver, or can it just run as a separate script?
I’ve looked at some of the reference imx drivers and .dts(i) files from Nvidia, but they’re quite large and I’m not sure which pieces are necessary for my use case. Any guidance on the minimal DTS structure or driver setup would be greatly appreciated.
I am following the developer guide and am wondering how to bind the driver to the device. In the example device tree node for the IMX185 V4L2 sensor driver, the line is compatible = "nvidia,imx185";. Because I do not have a .c driver but am instead using a separate I2C script that sets the registers (using i2ctransfer calls), I do not have a name to set compatible to. Do I need to create a dummy .c file for the .dts to bind with? If so, what needs to be in it?
Is it necessary to build a custom kernel or driver module in this case? If my I2C script is doing the work of a driver in terms of configuring the ser/des and imager via the I2C pins, is there a simpler way for the Jetson to read the MIPI data on the CSI port?
The short answer to your question is:
Yes, it is still necessary to build a custom driver for your sensor even though you already have a script that configures the SERDES interface and the camera through it.
Now the reason for this is that the way NVIDIA Jetson camera subsystem works, it requires the driver to setup the video device for it to be accessible through v4l2. This means that even if your driver is not controlling the power sequence or configuring the register table of your camera module, it still needs to configure the Jetson board camera subsystem so that it can handle whatever is going to be coming through MIPI/CSI.
If you go this route, you will end up with what we could call a “Dummy Driver”, which is really not driving anything, but rather providing an interface and configuration for the embedded platform to operate using the systems that area already in place.
What I would suggest you do in this stage is to create a driver that really does nothing else than creating the video devices. You will need the device tree to have the proper CSI and NVCSI configuration. The compatible shall match with your “Dummy Driver” compatible. And your “Dummy Driver” will only ensure that the video device is created and configured with what the DTB states.
This setup should get you up and running with video capture.
Then, for production. You can convert your GMSL configuration script into a GMSL driver to configure the SERDES interface there. This would be cleaner and easier to maintain.
Hope this helps.
Please do not hesitate to reach out if you require further support, we would love to give you a hand.
best regards,
Andrew
Embedded Software Engineer at ProventusNova
Thanks for your help. I am in the process of writing the dummy driver to create the video device, but I have not gotten anything to show up in the media-ctl -p device topology. What are the necessary functions (and libraries) needed to create and configure the video device? Also, should I be using the tegracam headers or just the v4l2 ones?
Great to hear you are already on track with the driver development.
I would suggest you base on a simple driver like the IMX219 camera driver.
You will only need probe function to execute successfully so that all necessary video devices are registered.
Please keep me posted, and don’t hesitate to reach out if you need further support.
best regards,
Andrew
Embedded Software Engineer at ProventusNova
Thanks for the help. I recently found the real driver for my imager, so I am starting with that. I have replaced the contents of each read and write function in the driver with return 0;
When I load the driver with sudo insmod, I get a few errors:
reset-gpios not found
unable to get platform data
tegra camera driver registration failed
Is there something else I need to modify in the driver, or is this something else at a device tree level? I have a .dtbo for the imager that I am overlaying with jetson-io and then I insmod after boot.
I resolved the issue by commenting out all lines related to the gpios in the driver. It now runs through the entire probe function without error, but after loading the driver, there is still no video0 node.
The calls for tegracam_device_register and tegracam_v4l2subdev_register inside probe run without error, so I am not sure what else I need to do to make video0 appear.