[SOLVED] PWM cannot be enabled on C4/4.9.277-83

Post Reply
dqbydt
Posts: 75
Joined: Wed Mar 01, 2017 7:52 am
languages_spoken: English
ODROIDs: C1+ C2 C4 HC4 XU4 VU5 VU7+
Has thanked: 1 time
Been thanked: 4 times
Contact:

[SOLVED] PWM cannot be enabled on C4/4.9.277-83

Post by dqbydt »

I am following the wiki here: https://wiki.odroid.com/odroid-c4/appli ... enable_pwm

I added pwm_ab to the overlays list in config.ini:

Code: Select all

; Device Tree Overlay
overlay_resize=16384
overlay_profile=
overlays="i2c0 i2c1 uart0 uart2 pwm_ab pcf8563"
I can see the pwmchip0 directory structure, and exporting results in pwm0 getting created but it cannot be enabled:

Code: Select all

root@odroidc4:~# echo 1 > /sys/class/pwm/pwmchip0/pwm0/enable 
-bash: echo: write error: Invalid argument
The only output related to pwm in dmesg is:
[ 0.835451] meson-pwm ff802000.pwm: pwm pinmux : can't get pinctrl

I saw this other post: viewtopic.php?f=205&t=42444 but @steve.jeong has not done anything different other than use a later image with a 5.15 kernel. I am using the older Ubuntu image with kernel 4.9.277-83.

How can PWM be enabled on the older kernel? And how can I test whether the overlay has taken effect? Will gpio readall show something indicating pwm? Or something in dmesg output?

User avatar
mctom
Posts: 3010
Joined: Wed Nov 11, 2020 4:44 am
languages_spoken: english, polish
ODROIDs: OGA, XU4, M1, H3+, SP3, Vu8M, N2L
Location: Gdansk, Poland
Has thanked: 407 times
Been thanked: 534 times
Contact:

Re: PWM cannot be enabled on C4/4.9.277-83

Post by mctom »

Just to be sure, have you set period before you attempted to turn on PWM output?
Punk ain't no religious cult, punk means thinking for yourself!
OpenUPS
PiStackMon

dqbydt
Posts: 75
Joined: Wed Mar 01, 2017 7:52 am
languages_spoken: English
ODROIDs: C1+ C2 C4 HC4 XU4 VU5 VU7+
Has thanked: 1 time
Been thanked: 4 times
Contact:

Re: PWM cannot be enabled on C4/4.9.277-83

Post by dqbydt »

mctom wrote:
Tue May 23, 2023 8:43 pm
Just to be sure, have you set period before you attempted to turn on PWM output?
Doh! Indeed I have not! And now that I look into it more closely, the wiki clearly indicates (in red, no less) that you must change period first.
Of course, it works fine when period is set first. Thank you @mctom!

Post Reply

Return to “Hardware and peripherals”

Who is online

Users browsing this forum: No registered users and 1 guest