Verdin PWM example pwmchip permission denied

Hi,
I try to get the pwm example in c running from your git examples repo.

I already had issues to export the pwmchip to sysfs as described here: PWM (Linux)

“echo 0 > export” throws a permission denied. I found out that “sudo sh -c 'echo 0 > export” works and I ended up having command line control over the pwm channel. An LED at the output works fine…

However, I want to control the pwm channels from my application and there the export write gives my the following error:

Error Number 30

pwm: Read-only file system

failed to export

Is there a pwm usergroup I need to add the torizon user to in the buildcommands?
Or am I missing something in the general concept?

Thanks in advance!

Jan

Greetings @jan380,

It sounds like you’re not running this in a container, or are you? I’m asking since you mentioned running “sudo” which isn’t available in a container but is available on the host TorizonCore OS.

In any case to use PWM in a container on Torizon please see the article here: https://developer.toradex.com/knowledge-base/using-pwm-in-a-container

As stated in the article there’s a certain way you have to bindmount the PWM interface into as to not have a “read-only” error. Otherwise though there should be no user-groups required for PWM access.

Best Regards,
Jeremias