Comments (13)
I finally have a Pi 5 available for testing, so I should be able to dive into this as soon as I get a chance.
RPPAL also has a software PWM available if you're going with @whattheflukz 's alternative suggestion. Worth a shot until this is resolved.
from rppal.
Fixed with release 0.18.0
from rppal.
Hey @whattheflukz. Unfortunately I don't have a Pi 5 available for testing, so I can't run your code myself. I do have a few suggestions you could try to pinpoint the cause of the issue though.
Besides running a minimal synchronous version of the code and seeing if that works, and making sure PWM is enabled in /boot/config.txt
, googling for PWM channels on the Pi 5 seems to suggest the RP1 PWM controller uses pwmchip2
on the Pi 5, while hardware PWM on previous Pi models was accessible through pwmchip0
. You could verify this with ls /sys/class/pwm
and check which devices are available. RPPAL is currently hardcoded to always use pwmchip0
, so it's possible that code needs to be tweaked for the Pi 5.
If you have some time to check, grab a copy of the RPPAL repo, and in the pwm::sysfs
module, try changing any pwmchip0
paths to pwmchip2
and see if that helps.
from rppal.
Hello @golemparts !
ls /sys/class/pwm
reports pwmchip0 pwmchip2 pwmchip6
I tried cloning the repo and changing all instances of pwmchip0
to pwmchip2
inside of the pwm::sysfs
module
I also tried running the example code found here https://github.com/golemparts/rppal/blob/master/examples/pwm_servo.rs verbatim with both pwmchip2
as well as pwmchip0
set in pwm::sysfs
.
I also probed GPIO12, GPIO13, GPIO18, and GPIO19 for all tests just in case i was an idiot and just looking at the wrong pins
from rppal.
Thanks for trying pwmchip2
. It's worth checking pwmchip6
as well since, as far as I'm aware, it just uses the next available device number. However, if that also doesn't fix the issue, I'm not sure what else it could be. Let me know whether using pwmchip6
resolves the issues. If not, I'll have to mark this as Help Wanted and get a hold of a Pi 5 myself so I can figure things out.
from rppal.
Hi again @golemparts
I just tried pwmchip6 , also I did make sure to enable pwm in /boot/firmware/config.txt
(as I'm using raspberry pi OS) I tried both pwm
as well as pwm-2chan
unfortunately no luck with any of this.
from rppal.
I also just tried doing the exact same setup on a raspberry pi 4, running the example code verbatim as well, and that works as expected so it's definitely a problem specific to the pi 5 (Rather than me just doing something stupid haha). I imagine because of the hardware differences with the new RP1 chip.
from rppal.
Thanks for the additional checks. Yeah, it definitely sounds like an RP1 specific issue. I'll have a Pi 5 coming in soon so I can figure out what's going on.
from rppal.
Hello Im experiencing the same issue, anyone figured out any workaround to get pwm for rpi5 to work?
from rppal.
Hello Im experiencing the same issue, anyone figured out any workaround to get pwm for rpi5 to work?
If youre willing to use python when I was messing with this the software pwm from some python libs seemed to work ok
from rppal.
I did some testing today. GPIO18 on the Pi 5 is tied to pwmchip2/pwm2, while RPPAL is hardcoded to use pwmchip0 with pwm0/pwm1 on all Pi models. I assume this change is related to the RP1 now handling the hardware PWM channels. I'll add an exception for Pi models that have an RP1 (and also check the other hardware PWM channels), after which everything should be working as expected.
from rppal.
A fix has been implemented on the master branch. I've run some tests on both Pwm0 and Pwm1 on a Pi 4 and a Pi 5, and everything seems to be working. I'll schedule a 0.18.0 release for tonight or tomorrow, which will include the fix.
from rppal.
A fix has been implemented on the master branch. I've run some tests on both Pwm0 and Pwm1 on a Pi 4 and a Pi 5, and everything seems to be working. I'll schedule a 0.18.0 release for tonight or tomorrow, which will include the fix.
Thanks so much for your effort!
from rppal.
Related Issues (20)
- GPIO starts fluctating HOT 1
- Set multiple pins at once? HOT 2
- Interrupt service routines for Timers? HOT 1
- is there any clear or clean or cleanup method? HOT 3
- Wrong library. My mistake. HOT 1
- Raspberry Pi5 HOT 53
- Banana Pi M5 support HOT 2
- Support concurrent reading and writing via Uart
- Using rppal with embedded_hal_async (async support) HOT 8
- Hardware field removed from /proc/cpuinfo causing identification issues HOT 5
- GPIO `is_low` output differs from rppal v0.17.0 impl compared to embedded-hal v1 impl
- Input pin mode not set correctly on Raspberry Pi 5 HOT 1
- Add an example of graceful shutdown when SIGINT (GPIO) HOT 1
- I2C connection with ADS1115 HOT 2
- pwm (or more specififally: ) the example `pwm_blinkled.rs` does not seem to work on my raspberry pi zero w HOT 6
- Multiple slave select lines on one SPI bus HOT 2
- Thanks for rppal, showcase of our app using it, and question HOT 5
- Many edge detection "interrupts" but level remains the same HOT 23
- Possible to read config at startup and detect busy pins HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rppal.