NVIDIA / jetson-gpio

A Python library that enables the use of Jetson's GPIOs
MIT License
936 stars 261 forks source link

PWM not working on Jetson Xavier NX #37

Closed ethancherki closed 4 years ago

ethancherki commented 4 years ago

I am trying to use pwm on the GPIO 33 of the Xavier NX board but the sample script is not working. I have seen that I might have to configure the pinmux. However, there is a document called "Jetson Nano Developer Kit 40-Pin Expansion Header Configuration" for the Nano but there is nothing for the Xavier NX.

What should I do ? How can I configure the board properly ?

swarren commented 4 years ago

Generally the same techniques apply to configuring the pinmux for any Jetson board.

ethancherki commented 4 years ago

Thank you for your answer. PWM is now activated on PIN 33 and seems to be working. However when I try to increase the pwm frequency from 50 Hz to 100Hz or 1000 Hz, I get the following error:

File "/usr/lib/python3/dist-packages/Jetson/GPIO/gpio.py", line 245, in _set_pwm_period f.write(str(period_ns)) OSError: [Errno 22] Invalid argument

Do you have any idea on how to solve this issue ? Is there any pwm frequency limitation on the Xavier NX ?

swarren commented 4 years ago

The various boards and SW releases do have some different limitations on PWM period. If this isn't covered in the L4T documentation, the best place to get an answer is on the NVIDIA Jetson forums; https://forums.developer.nvidia.com/c/agx-autonomous-machines/jetson-embedded-systems/70. Jetson-gpio simply exposes whatever the kernel/hardware support without additional restriction.

swarren commented 4 years ago

Closing; I assume that followup on the forum was successful.