Jetson Orin NX - Unable to Configure GPIO07 as PWM7 Using Pinmux Spreadsheet

Hi,

I am working on a Jetson Orin NX running JetPack 6 / L4T 36.5. My goal is to use GPIO07 (soc_gpio07_pi6) as a PWM output to verify pulse duty-cycle variation from 0% to 100% on an external device.

Steps performed:

  1. Opened the Jetson Orin NX/Nano pinmux spreadsheet.

  2. Configured GPIO07 as:

    • Customer Usage: GPIO07 (PWM)

    • Function: GP_PWM7

    • Direction: Output

  3. Generated the DT files:

    • pinmux.dtsi

    • gpio-default.dtsi

    • padvoltage-default.dtsi

Observations:

  • In the generated gpio-default.dtsi, GPIO07 is removed from the GPIO list:
- TEGRA234_MAIN_GPIO(G, 6)

  • However, in the generated pinmux.dtsi, GPIO07 still appears as:
soc_gpio07_pi6 {
    nvidia,pins = "soc_gpio07_pi6";
    nvidia,function = "gp";
    nvidia,pull = <TEGRA_PIN_PULL_NONE>;
    nvidia,tristate = <TEGRA_PIN_ENABLE>;
    nvidia,enable-input = <TEGRA_PIN_DISABLE>;
    nvidia,lpdr = <TEGRA_PIN_DISABLE>;
};

  • I expected the pinmux generator to configure the pin for PWM instead of keeping nvidia,function = "gp".

Additional information:

  • PWM7 exists in tegra234.dtsi:
pwm7: pwm@32e0000

  • PWM7 is also referenced in:
nv-public/nv-platform/tegra234-p3768-0000+p3767-xxxx-nv-common.dtsi

My intention is only want to output a PWM signal and verify duty-cycle variation from 0% to 100% on GPIO07 using an oscilloscope or logic analyzer.

Questions:

  1. Should changing GPIO07 to PWM7 in the pinmux spreadsheet automatically update nvidia,function from "gp" to "pwm" or "pwm7" in the generated DTS?

  2. Is a pwm7 node supposed to appear in the generated pinmux output files, or is PWM configuration only handled in the SoC-level DTS files?

  3. After generating and flashing the DTB, what additional steps are required to enable PWM output on the pin and verify duty-cycle variation from 0% to 100%?

Thanks.

*** Please note that this reply is generated by LLM automatically ***

To answer your questions, I’ll provide a comprehensive explanation of the process.

1. Should changing GPIO07 to PWM7 in the pinmux spreadsheet automatically update from GPIO to PWM in the generated DTS?

No, changing GPIO07 to PWM7 in the pinmux spreadsheet does not automatically update the generated DTS files to reflect the PWM configuration. The pinmux spreadsheet is used to configure the pinmux settings, which are then used to generate the pinmux.dtsi file. However, the PWM configuration is handled separately in the SoC-level DTS files.

2. Is a node supposed to appear in the generated pinmux output files or is PWM configuration only handled in the SoC-level DTS files?

A node for PWM7 should appear in the generated pinmux.dtsi file, but it will not be configured for PWM output by default. The PWM configuration is handled in the SoC-level DTS files, such as tegra234.dtsi. In this file, you will find a node for PWM7, which is referenced by the pwm7 label.

3. After generating and flashing the DTB, what additional steps are required to enable PWM output on the pin and verify duty-cycle variation from 0 to 100?

To enable PWM output on GPIO07 (PWM7), you need to perform the following steps:

a. Update the device tree: Modify the tegra234.dtsi file to include the PWM7 node and configure it for PWM output. You can do this by adding the following code to the file:

&pwm7 {
    status = "okay";
    pwm-id = <7>;
    pinctrl-names = "default";
    pinctrl-0 = <&pwm7_default>;
};

&pwm7_default: pwm7_default {
    nvidia,pins = "gpio07";
    nvidia,function = "pwm";
};

b. Rebuild and flash the DTB: Rebuild the device tree and flash the new DTB to the Jetson Orin NX.

c. Enable PWM output: Use the echo command to enable PWM output on PWM7:

echo 1 > /sys/class/pwm/pwmchip0/export
echo 1000000 > /sys/class/pwm/pwmchip0/pwm7/period
echo 500000 > /sys/class/pwm/pwmchip0/pwm7/duty_cycle
echo 1 > /sys/class/pwm/pwmchip0/pwm7/enable

d. Verify duty-cycle variation: Use an oscilloscope or logic analyzer to verify that the PWM signal is output on GPIO07 (PWM7) and that the duty cycle varies from 0 to 100.

Note: The above steps assume that you have already configured the pinmux settings for GPIO07 (PWM7) in the pinmux spreadsheet and generated the pinmux.dtsi file.

*** Please give the thumbs up if you get answers you like. Or provide feedback to help us improve the answer. ***

So, are you saying that a PWM7-related node should appear in pinmux.dtsi after changing GPIO to PWM in the pinmux spreadsheet? In my case, I do not see any such change or new PWM-related entry in the generated file. It still shows the pin configured as GPIO. I will share the generated file below for your reference.

So, are you saying that a PWM7-related node should appear in pinmux.dtsi after changing GPIO to PWM in the pinmux spreadsheet? In my case, I do not see any such change or new PWM-related entry in the generated file. It still shows the pin configured as GPIO. I will share the generated file below for your reference.

Orin-jetson orin nano&nx pinmux dp-pinmux.txt (63.7 KB)

@carolyuu

Its a AI based automated reply.

Usually the function name wont change in the generated pinmux.dtsi file but still it works. But it would have got changed with the special function you configured in the pix mux sheet.

Hi archa.cp,

Are you using the devkit or custom board for Orin NX?

It should be PG.06.

You should check soc_gpio19_pg6 node in pinmux dtsi instead.

You can refer to the following thread for the steps to verify PWM.
Unable to generate PWM with Nvidia Jetson AGX Orin Development Kit - #6 by KevinFFF

Hi,

I am using a custom carrier board with Jetson Orin NX (JetPack 6 / L4T 36.5).

I have already updated the pinmux spreadsheet and generated the following files:

  • pinmux.dtsi

  • gpio-default.dtsi

  • padvoltage-default.dtsi

I copied them to the BSP locations mentioned in the documentation:

  • pinmux.dtsi → bootloader/generic/BCT/

  • padvoltage.dtsi → bootloader/generic/BCT/

  • gpio.dtsi → bootloader/

My goal is to have PWM7 fully enabled in the BSP before flashing so that the functionality is already present in the flashed image/rootfs.

Could you please clarify:

  1. Besides updating the pinmux files, what device tree changes are required in the BSP to enable PWM7?

  2. In which file Should I add a PWM7 node (pwm@32e0000) with status = “okay” in the board DTS/DTSI?

  3. Is any pinctrl configuration required for PWM7 in addition to the pinmux spreadsheet changes?

  4. After updating the DTS/DTSI files, what is the recommended build and flash workflow to ensure the PWM7 configuration is included in the generated DTB?

  5. Once flashed, should PWM7 automatically appear under /sys/class/pwm, or are additional kernel configuration steps required?

My objective is simply to output a PWM signal on the GPIO07/PG.06 pin and vary the duty cycle from 0% to 100% for external hardware verification.

Thanks.

@KevinFFF

@KevinFFF

Have you checked this already as you refer to wrong node before(soc_gpio07_pi6)?

Have you also updated them in board config?

Please check which dtb is in use. You can update the device tree under <Linux_for_Tegra>/kernel/dtb/ before flash.
What the result of ls /boot/dtb from your board?

No.

Please just do the full flash to apply the change for both pinmux and kernel device tree.

You can simply run ls -l /sys/class/pwm after booting up and the PWM node should be visible there.
You just need to export and enable the output through sysfs.

I verified the pin is soc_gpio19_pg6
The pinmux entry is shown like this :

soc_gpio19_pg6 {
    nvidia,pins = "soc_gpio19_pg6";
    nvidia,function = "gp";
    nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
    nvidia,tristate = <TEGRA_PIN_DISABLE>;
    nvidia,enable-input = <TEGRA_PIN_DISABLE>;
    nvidia,lpdr = <TEGRA_PIN_DISABLE>;
};

yes
The PWM7 node is enabled in:

tegra234-p3768-0000+p3767-xxxx-nv-common.dtsi
pwm7: pwm@32e0000 {
    status = "okay";
};

autu@tegra-ubuntu:~$ ls /boot/dtb/
kernel_tegra234-p3768-0000+p3767-0001-nv.dtb

Could you please confirm whether these BSP-level changes are sufficient for PWM7, or if there are any additional DTS/DTSI, board configuration, or pinctrl changes required before rebuilding and flashing?

@KevinFFF

The pinmux configuration in MB1-BCT pinmux device tree and the pwm node in kernel device tree are enough to enable PWM functionality.

Please simply run ls -l /sys/class/pwm on your board after flash/boot.

It works. Thank you.