Jetson.GPIO lib - PWM not working on Orin Nano Dev Kit

Hello!

Just got my hands on a Jetson Orin Nano Dev kit and I am having difficulty making use of the PWM, more specifically on PIN32.

I have enabled all PWMs in the device tree, and they are enabled and detected. So I looked into the source code of the Jetson.GPIO lib and I found some potential problems:

    JETSON_ORIN_NX: (
        JETSON_ORIN_NX_PIN_DEFS,
        {
            'P1_REVISION': 1,
            'RAM': '32768M, 65536M',
            'REVISION': 'Unknown',
            'TYPE': 'JETSON_ORIN_NX',
            'MANUFACTURER': 'NVIDIA',
            'PROCESSOR': 'A78AE'
        }
    ),
    JETSON_ORIN_NANO: (
        JETSON_ORIN_NX_PIN_DEFS,
        {
            'P1_REVISION': 1,
            'RAM': '32768M, 65536M',
            'REVISION': 'Unknown',
            'TYPE': 'JETSON_ORIN_NANO',
            'MANUFACTURER': 'NVIDIA',
            'PROCESSOR': 'A78AE'
        }
    ),
    JETSON_ORIN: (
        JETSON_ORIN_PIN_DEFS,
        {
            'P1_REVISION': 1,
            'RAM': '32768M, 65536M',
            'REVISION': 'Unknown',
            'TYPE': 'JETSON_ORIN',
            'MANUFACTURER': 'NVIDIA',
            'PROCESSOR': 'A78AE'
        }

Most of the info on the Orin modules is not updated, like the RAM and the board revision. In addition:

JETSON_ORIN_NX_PIN_DEFS = [
    (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),
    (50, 'PH.07', "tegra234-gpio", 12, 18, 'I2S0_SCLK', 'GP122', None, None),
    (122, 'PY.00', "tegra234-gpio", 13, 27, 'SPI1_SCK', 'GP36_SPI3_CLK', None, None),
    (85, 'PN.01', "tegra234-gpio", 15, 22, 'GPIO12', 'GP88_PWM1', '3280000.pwm', 0),
    (126, 'PY.04', "tegra234-gpio", 16, 23, 'SPI1_CS1', 'GP40_SPI3_CS1_N', None, None),
    (125, 'PY.03', "tegra234-gpio", 18, 24, 'SPI1_CS0', 'GP39_SPI3_CS0_N', None, None),
    (135, 'PZ.05', "tegra234-gpio", 19, 10, 'SPI0_MOSI', 'GP49_SPI1_MOSI', None, None),
    (134, 'PZ.04', "tegra234-gpio", 21, 9, 'SPI0_MISO', 'GP48_SPI1_MISO', None, None),
    (123, 'PY.01', "tegra234-gpio", 22, 25, 'SPI1_MISO', 'GP37_SPI3_MISO', None, None),
    (133, 'PZ.03', "tegra234-gpio", 23, 11, 'SPI0_SCK', 'GP47_SPI1_CLK', None, None),
    (136, 'PZ.06', "tegra234-gpio", 24, 8, 'SPI0_CS0', 'GP50_SPI1_CS0_N', None, None),
    (137, 'PZ.07', "tegra234-gpio", 26, 7, 'SPI0_CS1', 'GP51_SPI1_CS1_N', None, None),
    (105, 'PQ.05', "tegra234-gpio", 29, 5, 'GPIO01', 'GP65', None, None),
    (106, 'PQ.06', "tegra234-gpio", 31, 6, 'GPIO11', 'GP66', None, None),
    (41, 'PG.06', "tegra234-gpio", 32, 12, 'GPIO07', 'GP113_PWM7', None, None),
    (43, 'PH.00', "tegra234-gpio", 33, 13, 'GPIO13', 'GP115', '32c0000.pwm', 0),
    (53, 'PI.02', "tegra234-gpio", 35, 19, 'I2S0_FS', 'GP125', None, None),
    (113, 'PR.05', "tegra234-gpio", 36, 16, 'UART1_CTS', 'GP73_UART1_CTS_N', None, None),
    (124, 'PY.02', "tegra234-gpio", 37, 26, 'SPI1_MOSI', 'GP38_SPI3_MOSI', None, None),
    (52, 'PI.01', "tegra234-gpio", 38, 20, 'I2S0_SDIN', 'GP124', None, None),
    (51, 'PI.00', "tegra234-gpio", 40, 21, 'I2S0_SDOUT', 'GP123', None, None)
]

The pin map does not have any pwm associate with pin 32, despite being identified as a pwm pin. I was thinking the solution would be to just modify this pin 32 line too:
(41, 'PG.06', "tegra234-gpio", 32, 12, 'GPIO07', 'GP113_PWM7', '32a0000.pwm' , 0),
but its says “Errno 16 Device or resource busy”
What could be a solution for the PWM problem? Thank you in advance

Hi diogoremiao,

You could just modify pinmux spreadsheet or use Jetson-IO to modify pinmux register for PWM usage.

And refer to the following thread to use PWM and configure duty cycle through sysfs.
Strange behaviour with Jetson Nano DevKit PWM signal - #5 by WayneWWW

Hi Kevin, thank you for the quick reply.

I have done the changes to the device tree necessary to enable the PWM and also I have used the pwms using sysfs. My question is about the Jetson.GPIO, which I thought was the official library to handle the 40-pin header of Nvidia Dev Kit devices.

Given that is not properly working now for the Nano Orin Dev Kit, are there any plans to update it and make it compatible?

Do you mean PIN32 on 40-pins header (which is also known as GPIO07, GPIO3_PG.06)?

Could you help to share the result of the following command?

$sudo cat /sys/kernel/debug/gpio|grep PG.06

What do you mean here about “it”?

$sudo cat /sys/kernel/debug/gpio|grep PG.06

The output:

gpio-389 (PG.06               )

Jetson-IO:
image

What do you mean here about “it”?

I meant to make the Jetson.GPIO lib compatible with the Jetson Orin Nano Dev Kit to make use of the PWM of PIN32, of the GPIO header. Because, as I have showed in the first message, it does not seem to have the option to use that PWM at all:

PIn32 which does not work

    (41, 'PG.06', "tegra234-gpio", 32, 12, 'GPIO07', 'GP113_PWM7', None, None),

Pin 33 which works

(43, 'PH.00', "tegra234-gpio", 33, 13, 'GPIO13', 'GP115', '32c0000.pwm', 0),

Sorry for the late response, is this still an issue to support? Thanks

Hello!

Yes, there has been no update on the Jetson GPIO Lib so the problem stands. There is still no reference to PIN 32 (GPIO HEADER) being identified as a PWM on the lib.

Could you share the device tree and also the serial console log for further check?

Hey Kevin.

Im sorry but I dont see why that information is needed. To recap:

  • I have successfully enabled the PWM on the device tree
  • I was able to use all 3 PWMs through sysfs

What I want:

  • To make use of the Jetson GPIO Lib to use PWMs on the Jetson Orin Nano dev kit instead of using sysfs.

The problem:

  • I cannot use PIN32 (GPIO Header) as a PWM with Jetson GPIO Lib for python3 because it is not referenced as a possible PWM by the Lib
 PIN 32 not working -(41, 'PG.06', "tegra234-gpio", 32, 12, 'GPIO07', 'GP113_PWM7', None, None),
 PIN 33 working -(43, 'PH.00', "tegra234-gpio", 33, 13, 'GPIO13', 'GP115', '32c0000.pwm', 0),
  • Pin 18 and PIN 33 work correctly

I think this is merely a code update on the Python3 GPIO Lib. Let me know if you need any more clarification or if I should bring up this problem on the GitHub itself

Hi, I am responsible for Jetson.GPIO. I will look into this. If possible, can you open a pull request of a code change to make pwm work if you have figured it out?

Can you try this change

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