Extending Jetson.GPIO to support gpio pins that are not on the 40 pin header

Hello,

I have an Orin Nano Devkit and I’m prototyping an AR0821 camera module.

I am trying to use the CAM0_MCLK signal as a gpio line(gpio-440/GPIO3_PP.00) to use as a trigger for the camera.
I assumed that I would have to update the pinmux, so I changed it from EXT_PERIPH1_CLK to GPIO3_PP.00. This created a change in the DTSI file to

 extperiph1_clk_pp0 {
                            nvidia,pins = "extperiph1_clk_pp0";
  •                           nvidia,function = "extperiph1";
    
  •                           nvidia,function = "rsvd1";
                              nvidia,pull = <TEGRA_PIN_PULL_NONE>;
                              nvidia,tristate = <TEGRA_PIN_DISABLE>;
                              nvidia,enable-input = <TEGRA_PIN_DISABLE>;
    

Now I want to use the Jetson.GPIO python library to manage this pin.
What are the values for the fields in the table, JETSON_ORIN_NX_PIN_DEFS, in the file gpio_pin_data.py for a GPIO pin that is NOT on the 40 pin header, or does Jetson.GPIO only support the 40 pin header?

If I can’t use Jetson.GPIO, what is the best way for me to manage this particular GPIO pin?

Thanks!

Hi Blair010,

What’s the Jetpack version in use?

How do you configure it in pinmux spreadsheet?
Except for configuring it as GPIO3_PP.00 in “Customer Usage”, do you also configure it as Input/Int PD for your use case?

Jetson.GPIO is designed for 40-pins header, but you also can customize it for your use case.
e.g. if you want to add the support for PP.00, please try to configure it as following.

JETSON_ORIN_NX_PIN_DEFS = [
+   (92, 'PP.00', "tegra234-gpio", 41, 28, 'CAM0_MCLK', 'GP52_CLK1', None, None),
    (144, 'PAC.06', "tegra234-gpio", 7, 4, 'GPIO09', 'GP167', None, None),
    (112, 'PR.04', "tegra234-gpio", 11, 17, 'UART1_RTS', 'GP72_UART1_RTS_N', None, None),

Thanks for the quick response. Here’s the answers to your questions:
Jetpack version is 5.1.4
CAM0_MCLK is tied to the CAM_TRIGGER line on the AR0821 Camera.
I think I want the gpio pin to be an output, not an input, as toggling this pin will provide the trigger. Am I missing something?

Thanks for the JETSON_ORIN_NX_PIN_DEFS line.
How did you determine the values for fields 4 (41), 5 (28), and 7 (GP52_CLK1)?

Thanks!

Okay, sorry that I’m not clear about camera. It should be okay if you’ve configured it as Output in pinmux spreadsheet.

41 and 28 are just 2 unused number in the list.
You can find GP52_CLK1 in column E of pinmux spreadsheet as following
image

Thanks! That solved the problem. I had to “unhide” the columns in the Tegra pinmux Excel spreadsheet to see everything.

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