I setup 2 PWM channels on my Verdin AM62 module using the EPWM0 peripheral and both channels are usable but i need root access in order to control channel B.
I tested the PWM control from within torizon base O.S.(not inside a docker container and i can export both channels via sysfs but i need root access in order to write the settings for channel B and not for channel A (can be accessed via torizon user).
Is there a specific reason channel B requires root access in contrary to channel A?
Any help/explanation would by appreciated
Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!
Did you like my answer?
Hello,
It sounds like you’re encountering a permissions issue with PWM channel B on your Verdin AM62 module, where it requires root access, unlike channel A. This is likely due to differences in system permissions for each channel.
In Torizon OS, the ‘torizon’ user is typically part of several groups that allow access to hardware peripherals without needing root privileges. If channel B requires root access, it might be due to specific permission settings on the sysfs entries for that channel.
Here are some steps you can take to troubleshoot and potentially resolve this issue:
-
Check Permissions:
- Navigate to the sysfs directory for your PWM channels, usually located at
/sys/class/pwm/
.
- Use the
ls -l
command to list the permissions of the files associated with both PWM channels. Compare the permissions for channel A and channel B.
-
Adjust Permissions:
- If you find that the permissions for channel B are more restrictive, you can adjust them by creating a udev rule to set the appropriate permissions when the device is initialized.
- Create a new udev rule file in
/etc/udev/rules.d/
, for example, 99-pwm.rules
, and add a rule to set the permissions for the PWM device files.
-
Group Membership:
- Ensure that the ‘torizon’ user is part of the necessary groups for accessing PWM devices. You can check this by running
groups torizon
and verifying the output includes the relevant group (e.g., pwm
).
-
Device Tree Configuration:
- If the issue persists, it might be related to how the device tree is configured. Ensure that there are no specific settings in the device tree that could affect the permissions or access to channel B.
By following these steps, you should be able to identify and correct the permission issue, allowing non-root access to PWM channel B.
Best regards,
Toradex AI Assistant
Please, also check if these links can help you solve your problem:
Verdin AM62 native LVDS display issues.
Hi @RiBe_Act!
Sorry for the delayed response.
How did you set up these 2 channels? Besides that, as Toradex AI said, could you check the permissions on /sys/class/pwm
using ls -l
?
Best regards.
Lucas Azeituno.
HI Lucas,
The output of “ls-l” is the following:
I added no specific settings for the PWM channels as i only implemented them for future references. My device tree buildup is based around the Mallow NON-wifi board (i copied this and created a custom dts file with all our necessary changes) but i made no changes to the PWM channels whatsoever.
i exported channel 0 and 1 via torizon O.S. export (0 and 1) to pwmchip0 > export.
Whenever i try to write to channel 0 and 1 i can write to channel 0 (pwm0) but i cannot write to channel 1 (pwm1).
hope it scheds some light.
kind regards.
Richard
Hi @RiBe_Act!
Sorry for the delayed response.
I’ve tested the PWM with AM62 and noticed the permissions on pwm0
and pwm1
are different. If you use ls -l /sys/class/pwm/pwmchip0/pwm0
and ls -l /sys/class/pwm/pwmchip0/pwm1
you can see that pwm1
needs root permissions.
It should not be like this, and you should be able to manage this in user space, so I already talked with our R&D team, and they will fix it ASAP. Until then, you’ll need root access to manage pwm1
.
Best regards.
Lucas Azeituno
Hi Lucas,
Thank you for the research, knowing that it is not a device tree issue on my side is comforting.
Marked as solved.
Kind regards.
Richard
1 Like