Problem enabling PWM on Jetson Nano

Hi, i’ve been trying to enable the pwm pins of the Nvidia Jetson Nano and it still not working.

I tried with Configuring Jetson Expansion Header following the steps here generic-no-api-public_r2
When i do this i get a continous signal. I tested it in python with the sample of this repository jetson-gpio/samples at master · NVIDIA/jetson-gpio · GitHub and then i tested it sending the frequency directly to the pins using echo to /sys/class/pwm/pwmchip0

And now im trying to do it with the nvidia pinmux config template but I didnt find too much information.

Can someone help me with this?

Thank you all.

1 Like

Hi d.altares99,

Are you using the devkit or custom board for Jetson Nano?
What’s the Jetpack version in use?

Which PWM do you want to use?
Please share the detail steps you’ve done and the exact command you used.

Hi Kevin, im using th nvidia jetson nano developer kit with JetPack 4.6.5 and I need two PWM (One for a servo and the another one is for H-bridge) I think the PWM should be the pin 32 and 33 but it could be anyone if im wrong.

First I flashed the SD card with the begginer guide(Get Started With Jetson Nano Developer Kit | NVIDIA Developer) and then I tried this:

1 - sudo apt update and sudo apt upgrade
2 - sudo pip install Jetson.GPIO
3 - sudo groupadd -f -r gpio and sudo usermod -a -G gpio your_user_name
4 - Reboot the Jetson
5 - sudo /opt/nvidia/jetson-io/jetson-io.py
6 - Toggle pwm0 and pwm1 and then save and reboot again
7 - Connect the components (I tested the components with other board)
8 - python3 samples/simple_pwm.py (jetson-gpio/samples/simple_pwm.py at master · NVIDIA/jetson-gpio · GitHub)
9 - I measured it with the multimeter becouse the servo wasnt moving on any of the pins and it was like 1.7V and it didnt change while the for loop was running with the line p.ChangeDutyCycle(val) changing the val

The other way I tried is after this to test I read I can test the pins with this:

echo 0 > /sys/class/pwm/pwmchip0/export
echo 50000 > /sys/class/pwm/pwmchip0/pwm0/period or echo 25000 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle
echo 1 > /sys/class/pwm/pwmchip0/pwm0/enable

But i got the same result.

I dont know if its important but I flashed the SD card again with a VM and SDK Manager becouse maybe i did something wrong and i tried doing again the same steps and i got the same results.

I was having the same issue in Nvidia Jetson Nano. After configuring the PWM for pin 33 and 32, was not able to generate PWM signals using the sample program. There were no errors after running the code but it was not generating PWM.

Searching over the internet I found this workaround :

# Enable Pin 32 / PWM0
sudo busybox devmem 0x700031fc 32 0x45
sudo busybox devmem 0x6000d504 32 0x2

# Enable Pin 33 / PWM2
sudo busybox devmem 0x70003248 32 0x46
sudo busybox devmem 0x6000d100 32 0x00

After running these commands the PWM singals can be generated. BUT, each time I reboot the Jetson Nano I have to run these commands again.

So I have added the commands in sudo crontab.
To open crontab :
sudo crontab -e
Added this line at the end:
@reboot sleep 10 && busybox devmem 0x70003248 32 0x46 && busybox devmem 0x6000d100 32 0x00
It will sleep for 10 seconds and after that it will enable pin 33 for PWM. For pin 32 use:
@reboot sleep 10 && busybox devmem 0x700031fc 32 0x45 && busybox devmem 0x6000d504 32 0x2
Then save and exit.

Now it is working for me properly. But there should be any other solution not a workaround like this.

1 Like

Thank you!!!

Now its working perfectly, I love you. It was getting me crazy.

Again, thank you very much.

1 Like

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