Can't use CAM0_PWDN on Jetson Orin Nano DevKIt over script

I have a MIPI CSI camera connected to the CSI0 J20 connector. The camera has a trigger feature and its trigger_to_sensor port is connected to the CAM0_PWDN port on Jetson Orin Nano DevKit. From the document
< Jetson_Orin_Nano_DevKit_Carrier_Board_Specification_SP-11324-001_v1.1.pdf>, CAM0_PWND is pin 114 on J20 connector. I tried to test it over the GPIO library with a script but it says Channel 114 is not valid. Here is the script:

import Jetson.GPIO as GPIO
import time

CAM0_PWDN_PIN = '114'

# Pin Setup:
# Board pin-numbering scheme
GPIO.setmode(GPIO.BOARD)
# Set pin as an output pin with optional initial state of HIGH
GPIO.setup(CAM0_PWDN_PIN, GPIO.OUT, initial=GPIO.HIGH)

try:
    print("Toggling CAM0_PWDN pin")
    while True:
        # Turn the camera power down off (enable the camera)
        GPIO.output(CAM0_PWDN_PIN, GPIO.HIGH)
        print("Camera enabled")
        time.sleep(2)
        
        # Turn the camera power down on (disable the camera)
        GPIO.output(CAM0_PWDN_PIN, GPIO.LOW)
        print("Camera disabled")
        time.sleep(2)

finally:
    GPIO.cleanup()  # Clean up GPIOs for the next run

I installed their driver with the attached dtsi file.
new_orinnano.dtsi (2).txt (24.0 KB)

How can I use the pins on the J20 connector or J21 for triggering?

I also played with jetson-io but it did not work out so far.

Platform: Jetpack 5.1.2 with Jetson Linux 35.4.1 on Jetson Orin Nano Developer Kit

Camera: MIPI CSI IMX568c camera module from Vision Components

Camera Repo: Vision Components MIPI® Camera Modules · GitHub

How do you figure out the 114?

Suppose it should be gpio-394

From the page 23 of this file, Jetson Download Center | NVIDIA Developer

Also, I tried pin 394 with the mode GPIO.BCM and GPIO.BOARD but it still says invalid channel.

It’s HW pin #
It should be the GPIO PH.06 should be 397 of it.

gpio-397 (PH.06

Yeah, I did find the GPIO PH.06 but not sure where 397 comes from. Is that a kind of calculation?

Also, I tried 397 with the following script but still returns invalid.

import Jetson.GPIO as GPIO
import time

CAM0_PWDN_PIN = '397'

# Pin Setup:
# Board pin-numbering scheme
GPIO.setmode(GPIO.BCM)
# Set pin as an output pin with optional initial state of HIGH
GPIO.setup(CAM0_PWDN_PIN, GPIO.OUT, initial=GPIO.HIGH)

try:
    print("Toggling CAM0_PWDN pin")
    while True:
        # Turn the camera power down off (enable the camera)
        GPIO.output(CAM0_PWDN_PIN, GPIO.HIGH)
        print("Camera enabled")
        time.sleep(2)

        # Turn the camera power down on (disable the camera)
        GPIO.output(CAM0_PWDN_PIN, GPIO.LOW)
        print("Camera disabled")
        time.sleep(2)

finally:
    GPIO.cleanup()  # Clean up GPIOs for next run

Is there any other way I can try the pin?

Check the number by below command.

sudo cat /sys/kernel/debug/gpio

From the command, I can see that

 gpio-397 (PH.06               |camera-control-outpu) out lo 

when I tried to test it via script or gpioset gpiochip0 397=1 command but it said invalid.

Then I run gpioinfo

gpiochip0 - 164 lines:
	line   0:      "PA.00" "fixed-regulators:regulator@8" output active-high [used]
	line   1:      "PA.01"       unused   input  active-high 
	line   2:      "PA.02"       unused   input  active-high 
	line   3:      "PA.03"       unused   input  active-high 
	line   4:      "PA.04"       unused   input  active-high 
	line   5:      "PA.05"       unused   input  active-high 
	line   6:      "PA.06"       unused   input  active-high 
	line   7:      "PA.07"       unused   input  active-high 
	line   8:      "PB.00"       unused   input  active-high 
	line   9:      "PC.00"       unused   input  active-high 
	line  10:      "PC.01"       unused   input  active-high 
	line  11:      "PC.02"       unused   input  active-high 
	line  12:      "PC.03"       unused   input  active-high 
	line  13:      "PC.04"       unused   input  active-high 
	line  14:      "PC.05"       unused   input  active-high 
	line  15:      "PC.06"       unused   input  active-high 
	line  16:      "PC.07"       unused   input  active-high 
	line  17:      "PD.00"       unused   input  active-high 
	line  18:      "PD.01"       unused   input  active-high 
	line  19:      "PD.02"       unused   input  active-high 
	line  20:      "PD.03"       unused   input  active-high 
	line  21:      "PE.00"       unused   input  active-high 
	line  22:      "PE.01"       unused   input  active-high 
	line  23:      "PE.02"       unused   input  active-high 
	line  24:      "PE.03"       unused   input  active-high 
	line  25:      "PE.04"       unused   input  active-high 
	line  26:      "PE.05"       unused   input  active-high 
	line  27:      "PE.06"       unused   input  active-high 
	line  28:      "PE.07"       unused   input  active-high 
	line  29:      "PF.00"       unused   input  active-high 
	line  30:      "PF.01"       unused   input  active-high 
	line  31:      "PF.02"       unused   input  active-high 
	line  32:      "PF.03"       unused   input  active-high 
	line  33:      "PF.04"       unused   input  active-high 
	line  34:      "PF.05"       unused   input  active-high 
	line  35:      "PG.00" "force-recovery" input active-low [used]
	line  36:      "PG.01"       unused   input  active-high 
	line  37:      "PG.02"       unused   input  active-high 
	line  38:      "PG.03"       unused   input  active-high 
	line  39:      "PG.04"       unused   input  active-high 
	line  40:      "PG.05"       unused   input  active-high 
	line  41:      "PG.06"       unused   input  active-high 
	line  42:      "PG.07"         "cd"   input  active-high [used]
	line  43:      "PH.00"       unused   input  active-high 
	line  44:      "PH.01"       unused   input  active-high 
	line  45:      "PH.02"       unused   input  active-high 
	line  46:      "PH.03"       unused   input  active-high 
	line  47:      "PH.04"       unused   input  active-high 
	line  48:      "PH.05"       unused   input  active-high 
	line  49:      "PH.06" "camera-control-output-low" output active-high [used]
	line  50:      "PH.07"       unused   input  active-high 
	line  51:      "PI.00"       unused   input  active-high 
	line  52:      "PI.01"       unused   input  active-high 
	line  53:      "PI.02"       unused   input  active-high 
	line  54:      "PI.03"       unused   input  active-high 
	line  55:      "PI.04"       unused   input  active-high 
	line  56:      "PI.05"       unused   input  active-high 
	line  57:      "PI.06"       unused   input  active-high 
	line  58:      "PJ.00"       unused   input  active-high 
	line  59:      "PJ.01"       unused   input  active-high 
	line  60:      "PJ.02"       unused   input  active-high 
	line  61:      "PJ.03"       unused   input  active-high 
	line  62:      "PJ.04"       unused   input  active-high 
	line  63:      "PJ.05"       unused   input  active-high 
	line  64:      "PK.00"       unused   input  active-high 
	line  65:      "PK.01"       unused   input  active-high 
	line  66:      "PK.02"       unused   input  active-high 
	line  67:      "PK.03"       unused   input  active-high 
	line  68:      "PK.04"       unused  output  active-high 
	line  69:      "PK.05"       unused  output  active-high 
	line  70:      "PK.06"       unused   input  active-high 
	line  71:      "PK.07"       unused   input  active-high 
	line  72:      "PL.00"       unused   input  active-high 
	line  73:      "PL.01"       unused   input  active-high 
	line  74:      "PL.02" "nvidia,pex-wake" input active-low [used]
	line  75:      "PL.03"       unused   input  active-high 
	line  76:      "PM.00"       unused   input  active-high 
	line  77:      "PM.01"       unused   input  active-high 
	line  78:      "PM.02"       unused   input  active-high 
	line  79:      "PM.03"       unused   input  active-high 
	line  80:      "PM.04"       unused   input  active-high 
	line  81:      "PM.05"       unused   input  active-high 
	line  82:      "PM.06"       unused   input  active-high 
	line  83:      "PM.07"       unused   input  active-high 
	line  84:      "PN.00"       unused   input  active-high 
	line  85:      "PN.01"       unused   input  active-high 
	line  86:      "PN.02"       unused   input  active-high 
	line  87:      "PN.03"       unused   input  active-high 
	line  88:      "PN.04"       unused   input  active-high 
	line  89:      "PN.05"       unused   input  active-high 
	line  90:      "PN.06"       unused   input  active-high 
	line  91:      "PN.07"       unused   input  active-high 
	line  92:      "PP.00"       unused   input  active-high 
	line  93:      "PP.01"       unused   input  active-high 
	line  94:      "PP.02"       unused   input  active-high 
	line  95:      "PP.03"       unused   input  active-high 
	line  96:      "PP.04"       unused   input  active-high 
	line  97:      "PP.05"       unused   input  active-high 
	line  98:      "PP.06"       unused   input  active-high 
	line  99:      "PP.07"       unused   input  active-high 
	line 100:      "PQ.00"       unused   input  active-high 
	line 101:      "PQ.01"       unused   input  active-high 
	line 102:      "PQ.02"       unused   input  active-high 
	line 103:      "PQ.03"       unused  output  active-high 
	line 104:      "PQ.04"       unused   input  active-high 
	line 105:      "PQ.05"       unused   input  active-high 
	line 106:      "PQ.06"       unused   input  active-high 
	line 107:      "PQ.07"       unused   input  active-high 
	line 108:      "PR.00"       unused   input  active-high 
	line 109:      "PR.01"       unused   input  active-high 
	line 110:      "PR.02"       unused   input  active-high 
	line 111:      "PR.03"       unused   input  active-high 
	line 112:      "PR.04"       unused   input  active-high 
	line 113:      "PR.05"       unused   input  active-high 
	line 114:      "PX.00"       unused   input  active-high 
	line 115:      "PX.01"       unused   input  active-high 
	line 116:      "PX.02"       unused   input  active-high 
	line 117:      "PX.03"       unused   input  active-high 
	line 118:      "PX.04"       unused   input  active-high 
	line 119:      "PX.05"       unused   input  active-high 
	line 120:      "PX.06"       unused   input  active-high 
	line 121:      "PX.07"       unused   input  active-high 
	line 122:      "PY.00"       unused   input  active-high 
	line 123:      "PY.01"       unused   input  active-high 
	line 124:      "PY.02"       unused   input  active-high 
	line 125:      "PY.03"       unused   input  active-high 
	line 126:      "PY.04"       unused   input  active-high 
	line 127:      "PY.05"       unused   input  active-high 
	line 128:      "PY.06"       unused   input  active-high 
	line 129:      "PY.07"       unused   input  active-high 
	line 130:      "PZ.00"       unused   input  active-high 
	line 131:      "PZ.01"  "interrupt"   input  active-high [used]
	line 132:      "PZ.02"       unused   input  active-high 
	line 133:      "PZ.03"       unused   input  active-high 
	line 134:      "PZ.04"       unused   input  active-high 
	line 135:      "PZ.05"       unused   input  active-high 
	line 136:      "PZ.06"       unused   input  active-high 
	line 137:      "PZ.07"       unused   input  active-high 
	line 138:     "PAC.00" "camera-control-output-low" output active-high [used]
	line 139:     "PAC.01"       unused   input  active-high 
	line 140:     "PAC.02"       unused   input  active-high 
	line 141:     "PAC.03"       unused   input  active-high 
	line 142:     "PAC.04"       unused   input  active-high 
	line 143:     "PAC.05"       unused   input  active-high 
	line 144:     "PAC.06"       unused   input  active-high 
	line 145:     "PAC.07"       unused   input  active-high 
	line 146:     "PAD.00"       unused   input  active-high 
	line 147:     "PAD.01"       unused   input  active-high 
	line 148:     "PAD.02"       unused   input  active-high 
	line 149:     "PAD.03"       unused   input  active-high 
	line 150:     "PAE.00"       unused   input  active-high 
	line 151:     "PAE.01"       unused   input  active-high 
	line 152:     "PAF.00"       unused   input  active-high 
	line 153:     "PAF.01"       unused   input  active-high 
	line 154:     "PAF.02"       unused   input  active-high 
	line 155:     "PAF.03"       unused   input  active-high 
	line 156:     "PAG.00"       unused   input  active-high 
	line 157:     "PAG.01"       unused   input  active-high 
	line 158:     "PAG.02"       unused   input  active-high 
	line 159:     "PAG.03"       unused   input  active-high 
	line 160:     "PAG.04"       unused   input  active-high 
	line 161:     "PAG.05"       unused   input  active-high 
	line 162:     "PAG.06"       unused   input  active-high 
	line 163:     "PAG.07"       unused   input  active-high 
gpiochip1 - 32 lines:
	line   0:     "PAA.00"       unused   input  active-high 
	line   1:     "PAA.01"       unused   input  active-high 
	line   2:     "PAA.02"       unused   input  active-high 
	line   3:     "PAA.03"       unused   input  active-high 
	line   4:     "PAA.04"       unused  output  active-high 
	line   5:     "PAA.05" "fixed-regulators:regulator@12" output active-high [used]
	line   6:     "PAA.06"       unused   input  active-high 
	line   7:     "PAA.07"       unused   input  active-high 
	line   8:     "PBB.00"       unused   input  active-high 
	line   9:     "PBB.01"       unused   input  active-high 
	line  10:     "PBB.02"       unused   input  active-high 
	line  11:     "PBB.03"       unused  output  active-high 
	line  12:     "PCC.00"       unused  output  active-high 
	line  13:     "PCC.01"       unused  output  active-high 
	line  14:     "PCC.02"       unused  output  active-high 
	line  15:     "PCC.03"        "mux"  output  active-high [used]
	line  16:     "PCC.04"       unused   input  active-high 
	line  17:     "PCC.05"       unused   input  active-high 
	line  18:     "PCC.06"       unused   input  active-high 
	line  19:     "PCC.07"       unused   input  active-high 
	line  20:     "PDD.00"       unused   input  active-high 
	line  21:     "PDD.01"       unused   input  active-high 
	line  22:     "PDD.02"       unused   input  active-high 
	line  23:     "PEE.00"       unused   input  active-high 
	line  24:     "PEE.01"       unused   input  active-high 
	line  25:     "PEE.02"       unused   input  active-high 
	line  26:     "PEE.03"       unused   input  active-high 
	line  27:     "PEE.04"  "power-key"   input   active-low [used]
	line  28:     "PEE.05"       unused   input  active-high 
	line  29:     "PEE.06"       unused   input  active-high 
	line  30:     "PEE.07"       unused   input  active-high 
	line  31:     "PGG.00"       unused   input  active-high 


and from the gpiochip0, I can see that line 49: "PH.06" "camera-control-output-low" output active-high [used]
Then I tried setting up and down with the commands gpioset gpiochip0 49=<1 or 0> and it returned no error but I also didn’t see any effect on the camera feed. What do you think about this route?

You need remove it from the device tree if you want to control it by gpiofs.

Thanks

I want to explore the options for both use it from software and hardware. Is there a guide I can get help for this?

Also, why do I have to remove it from the device tree because it says [used]?, and what specifically do I need to remove from where?

Yes, the sensor driver was using, You can unload the sensor driver to release the GPIO pin to use by gpiofs.

But if I release the camera sensor, then I can not use the camera. The purpose here is to trigger the camera module via CAM0_PWDN so it captures frames at the triggered moment. I did not understand the context of using by gpiofs.

Like using python libs to control the GPIO.

Please note Jetson NVCSI/VI don’t support trigger mode.

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