J509 Camera Connector Pin Configuration

Hello,

I’m currently trying to configure (almost) all 128 pins of the J509 camera connector, such that I can use some pins for communication. I’m basically trying to do GPIO, I2C, SPI and CSI-2 over the J509 camera connector. Is there a possibility to configure the pins appropriately? I’m thinking of creating a device tree overlay, though I’m having hard time writing one, as I haven’t found a suitable template as of yet. I’d be nice to at least configure some pins and get SPI working for the time being.

Kind regards

How to install camera driver ?

hello michael.kammerer,

you may refer to… NVIDIA Jetson AGX Xavier Series Camera Module Hardware Design Guide.
please check developer guide, Sensor Software Driver Programming.
you may configure a sensor driver as a loadable module, and insert a kernel module to register camera device.
for instance, To load a new sensor module

Thank you for pointing me in the right direction. Most of these implementations communicate with I2C. For the time being I am only trying to use SPI over the camera connector. Is there an “easier” way to simply configure and use the SPI pins on the camera connector? I am currently not dealing with a full on physical camera, I instead try to only use the SPI pins.

Kind regards

please check developer guide, Changing the Pinmux.

Thank you for the quick response, though, unfortunately, I still have some additional questions.

By reading through this link I can see that CAM_SPI is located at pins 111-114. Are these the dedicated SPI pins of the camera connector? If so, do I have to enable them or do they also get used when I send something over the 40-pin connector SPI pins (as in, are the camera connector SPI pins directly connected to the 40-pin header SPI pins)? Also, what’s the “rework” the table talks about?

In the end I’d just like to have a /dev SPI node that allows me to send something over the J509 SPI pins. What are the steps to achieve that? The catch is to solely use the J509 connector and not the 40-pin connector.

Kind regards

The CAM_SPI of J509 is not connected to module pins as below. You need to mount 0ohm resistors R413 ~ 416 to enable it. It is SPI1 in fact.

spi1

Hi! The issue is resolved, though it was not as straight-forward as expected. Helpful resources include “How to enable SPI2 interface” and “SPI1 not work on Xavier”.

I used the pinmux spreadsheet to enable the SPI2 pins of the camera connector and then generated appropriate DTSI files as explained here. Flashing the device with the newly generated files was easy enough, though I also had to add something to the kernel device tree files on the Jetson platform itself to make /dev/spidev1.0 show up. I did the following on the Jetson platform:

% I entered the dtb boot directory
cd /boot/dtb

% Converted the kernel dtb file to dts to make it human-readable
sudo dtc -I dtb -O dts -o extracted_proc.dts kernel_tegra234-p3701-0000-p3737-0000.dtb

% Open extracted_proc.dts in your favorite editor
sudo nano extracted_proc.dts

% Use STRG+W (in case of nano) to search for “spi@c260000”
% 1. Change the status from “disabled” to “okay”
% 2. Add the following code after the “prod-settings”:

spi@0 {
    compatible = "tegra-spidev";
    reg = <0x00>;
    spi-max-frequency = <0x2faf080>;
    controller-data {
        nvidia,enable-hw-based-cs;
        nvidia,rx-clk-tap-delay = <0x10>;
        nvidia,tx-clk-tap-delay = <0x00>;
    };
};

% After editing and saving the file, I converted it back to a .dtb file …
sudo dtc -I dts -O dtb -o kernel_tegra234-p3701-0000-p3737-0000.dtb extracted_proc.dts

% … and applied it
sudo dd if=kernel_tegra234-p3701-0000-p3737-0000.dtb of=/dev/mmcblk0p3

% Then I restarted the device
sudo reboot now

% Which allowed me to check whether the status was set to “okay”
sudo cat /proc/device-tree/spi@c260000/status

% Further, spidev1.0 was now present under /dev/
sudo modprobe spidev && ls -l /dev/ | grep “spidev1.0”

Note: It’s also possible to change the SPI2 pin configurations during runtime, using devmem, but the changes will be lost upon reboot, so I suppose flashing the device is required for a permanent change of the SPI2 pins.

So if anyone has a similar problem in the future, this is how I did it. SPI communication is working flawlessly now.

:-)

1 Like

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