Driving a servo motor using the Jetson Xavier NX

I’m looking to drive two servo motors with a PWM Frequency of 9.2kHz using the Jetson Xavier NX.

I understand that Pin 32 and 33 can be configured to PWM using the file: /opt/nvidia/jetson-io/jetson-io.py

After configuration, save and reboot, the configuration doesn’t seem to apply.

To test, I’m using the jetson-gpio library (e.g. simple_pwm.py) to output a PWM signal on pin 33.

Unfortunately the oscilloscope does not show any PWM output on pin 33. Also using the file:

/opt/nvidia/jetson-io/config-by-pin.py

pin 33 is displayed as unused (not PWM output).

In order to configure PWM output on pin 33 and 32, would I need to go through the steps of creating a pinmux configuration file?

If so, can you please outline the steps to take?

Thank you!

hello peter.moser,

these pin by default configured as GPIOs. according to Jetson Xavier NX Pinmux Table,
for example,
pin-32/ GPIO07/ GPIO3_PR.00
pin-33/ GPIO13 / GPIO3_PN.01

you should customize the spreadsheet for the configuration of your board, please refer to developer guide, Pinmux Changes for the steps.
you should also check the python script, $OUT/Linux_for_Tegra/kernel/pinmux/t19x/pinmux-dts2cfg.py, and there’s readme file it demonstrate how to use this tool to convert pinmux, gpio and pad dts file into cfg format.
thanks

Hi Jerry,
I configured the pinmux table in Excel for pin 32/33 and generated a .dtsi file.
I understand that the file /pinmux-dts2cfg.py is available through the SDK manager. Unfortunately I currently only have Mac OS systems and don’t have a dedicated host linux machine running x86 available. Is there another way to access /pinmux-dts2cfg.py? Thanks!

hello peter.moser,

MacOS is currently not supported.
for an alternative ways, please consider install virtual machine to setup an environment.
you may meet some USB issue of device recognize, it’s expected, you should also google it around for some quick workarounds.

Hi Jerry, thanks for your reply. I was able to overcome some hurdles (USB issue, Excel on Mac issues, pinmux-dts2cfg.py issues).
I’m running the virtualbox on mac and after installing the virtualbox extension pack I was able to access the USB port by adding the ‘Nvidia Linux for Tegra’ USB device in the virtualhost settings and making sure the USB port is visible from the host machine (cmd lsusb).
The pinmux table on Exel seems to have some issues as it requires forward slashes (that works on Windows OS but not on Mac). After debugging the VB script I was able to fix the issues and generate the .dtsi files. If anyone is interested in the pinmux table that works on Mac OSX let me know.
When generating the cfg I ran into another small issue but found a post that mentioned to omit --mandatory-pinmux-file which is somewhat ironic. Anyway, I have a cfg file and I’m ready to flash but still have an open question:
I understand that the generated .cfg file now needs to be put into the /bootloader/t186ref/BTC folder but is there a filename convention the generated .cfg file needs to have so the pin32/33 changes are getting applied?

Hi Jerry, it has been more than a week and I was wondering if you have any updates, thank you!

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