PWM device busy, can't echo to period/duty cycle
I was using PWM to control a cooling fan with the up2 for a while now and it was working until a recent system update (with updates to linux and linux-firmware).
I get 'Device or resource busy' error, see:
$ echo 0 > /sys/class/pwm/pwmchip0/export $ echo 3413333 > /sys/class/pwm/pwmchip0/pwm0/period /usr/bin/echo: write error: Device or resource busy $ echo 1706667 > /sys/class/pwm/pwmchip0/pwm0/duty_cycle /usr/bin/echo: write error: Invalid argument $ echo 1 > /sys/class/pwm/pwmchip0/pwm0/enable
I am on arch linux:
$ uname -a Linux up2 5.6.3-arch1-1 #1 SMP PREEMPT Wed, 08 Apr 2020 07:47:16 +0000 x86_64 GNU/Linux $ sudo pacman -Qs linux-firmware local/linux-firmware 20200316.8eb0b28-1 Firmware files for Linux
The latest 5.0 BIOS is used with restored/optimized defaults, except quiet boot is disabled and at IGD panel two settings are disabled.
In dmesg there are three 'pwm' related messages:
$ dmesg | grep -i pwm [ +0.105524] pwm-lpss 0000:00:1a.0: can't derive routing for PCI INT A [ +0.000005] pwm-lpss 0000:00:1a.0: PCI INT A: not connected [Apr13 11:46] pwm-lpss 0000:00:1a.0: PWM_SW_UPDATE was not cleared
Does anyone have a suggestion what might prevent me from echoing to the files in pwm0? What could be blocking the channel?
I tried also pwm pin 33, channel 1 but got the same error.
Thanks a lot in advance!
PS. I have some udev rules that lets the gpiousers group access to the pwmchip directory so I do not need sudo (in case you wondered), see:
$ cat /etc/udev/rules.d/50-pwm.rules SUBSYSTEM=="pwm", PROGRAM="/bin/sh -c '\ chown -R root:gpiouser /sys/class/pwm && chmod -R 770 /sys/class/pwm;\ chown -R root:gpiouser /sys/devices/pci0000:00/0000:00:1a.0/pwm/pwmchip* && chmod -R 770 /sys/devices/pci0000:00/0000:00:1a.0/pwm/pwmchip*;\ '"
- All Categories
- 105 Announcements & News
- 55 Product News - New Product/Product Change Notice/ End-of-life
- 186 Welcome Developers!
- 55 Unboxing & Project Sharing
- 50 Tech Updates
- 693 UP Products
- 11 UP 7000
- 1 UP Squared i12
- 10 UP Xtreme i12
- 11 UP Squared Pro 7000
- 1 UP Element i12 Edge
- 19 UP Squared V2
- 59 UP 4000
- 24 UP Xtreme i11
- 35 UP Squared 6000
- 60 UP Squared Pro
- 143 UP Xtreme
- 837 UP Squared
- 1.4K UP Board
- 89 UP Core Plus
- 222 UP Core
- 3 UP Xtreme Lite
- 44 UP AI Edge
- 216 Starter Kits & Peripheral