Problem with pin 208 output default state

Hello nvidia support team.
I use Orin NX with custom carriar board, Jetson Linux 36.4.3
The pin208 configured as output with low level default state.
You can see my pinmux settings:

soc_gpio29_pq2 {
				nvidia,pins = "soc_gpio29_pq2";
				nvidia,function = "rsvd0";
				nvidia,pull = <TEGRA_PIN_PULL_NONE>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
				nvidia,enable-input = <TEGRA_PIN_PULL_NONE>;
				nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;
				nvidia,lpdr = <TEGRA_PIN_DISABLE>;
			};

gpio-output-low = <
				TEGRA234_MAIN_GPIO(Q, 2)    // 208 PQ.02

Just after power on pin208 state is 0 as expected.

But when I toggled pin208 level with gpiod library and exit from program used for pin control I see pin208 stay in high level not in low.

How can I set low level as default?

Hi kulikov.mh,

Pinmux is configured in MB1 during boot up. It seems you’ve configured it Output/Drive 0 and it behaves as expected.

It seems you need an external pull down resistor for this use case.

Thank you for answer
Is an external pull down resistor the only solution?
I can revert pin 208 in low state with following command:

sudo busybox devmem 0x02430050 w 0x00  

It seems gpiod library or gpio driver just uses wrong default state for pin 208. More over with same pinmux settings pin 206 works correct.

Do you mean that it returns to low if you configure the pinmux register to 0x0?

What’s the register value before you configure it as 0x0?

Yes, it returns in low when I write 00.
Just after power up value in 0x02430050 is 0x1000, and pin in low state.
After accessing pin208 with gpiod library or gpioset, value in 0x02430050 is 0x1400 and pin stay in high state

Bit 10 should not be enabled if you want to use it as GPIO/Output.

Please check if the patch from 40hdr - SPI1 gpio padctl register bit[10] effect by gpiod tools in JP6 - #20 by KevinFFF could help for your case.

thank you for information, I applied patches and rebuild kernel Image but I still read 0x1000 form 0x02430050. The pin 208 also still revert back in high level.
You can see my patched files in attach.
pinctrl-tegra.c.txt (22.2 KB)
pinctrl-tegra.h.txt (6.5 KB)
pinctrl-tegra234.c.txt (78.1 KB)

It is expected since bit 10 is ZERO now.

Could you try to configure this pin as Output/Drive 0 in pinmux spreadsheet instead?
It should not be pulled high with above configuration.

Do you connect this pin with any device? Or do you just leave it disconnected and use scope to check its state?

The pin208 already has been configured as output/driven0 , you can see it in my first message.

This pin routed directly to the connector where I get measures.

I found a temporary solution:

sudo busybox devmem 0x02430050 w 0x0    // PADCTL_G3_SCR_SCR_SOC_GPIO29_0, as gpio
sudo busybox devmem 0x02212640 w 0x3    // GPIO_Q_ENABLE_CONFIG_02_0, as output
sudo busybox devmem 0x0221264c w 0x0    // GPIO_Q_OUTPUT_CONTROL_02_0, driven 


sudo busybox devmem 0x02212650 w 0x1    // GPIO_Q_OUTPUT_VALUE_02_0 output high
sudo busybox devmem 0x02212650 w 0x0    // GPIO_Q_OUTPUT_VALUE_02_0 output low

This works, but it would be great if I could use the normal way of accessing gpio using the gpiod library.

Okay, I just suggest using spreadsheet to configure the pinmux/gpio dtsi in case you missed something or configure something invalid.

It seems you can control the pin through DRA for PQ.02.
Please try running the following command to use gpiod to control it.

$ sudo su
# gpioset --mode=wait `gpiofind "PQ.02"`=0

Unfortunately I can’t use this to control gpio because –mode=wait blocks the commands following it from executing.

You can simply adding & behind the command to keep it running in background.