Hi,
I am following: How to Use PWM on Torizon OS | Toradex Developer Center
However, instead of downloading and building image from PC, I try to use Visual Code → Toradex: Create C/C++ project. Copy paste the code from: toradex/torizon-samples/pwm/
It compiled successfully. However I got:
Error Number 2
pwm: No such file or directory
failed to export
Is it possible to mount SYS from the Torizon configuration (appconfig_0)?
Is it possible to mount SYS from the Torizon configuration (appconfig_0)?
Yes, it is possible: Add a new entry in the volumes property, then put /sys as key and as value of the new element. You can find more information about the extension properties here: IDE Extension | Toradex Developer Center.
This message:
pwm: No such file or directory
possibly indicates that directory pwm in /sys/class/pwm/pwmchip0/export is not being found by the container. It shouldn’t happen if /sys is bind mounted as described above.
How are you trying to run the program on the module exactly? Deploying it through VSCode (e.g. by pressing F5), or running docker run directly on the module?
Here you were changing the value of the element when you should’ve changed the key. Notice that it was still written sys on the left and not /sys. If you ever need to change the key of an entry in volumes just remove it by pressing the ‘-’ icon and add an entry again: it will first ask for a key, then for a value.