leon

leon

Rpi4 hardware pwm dtoverlay need kernel module?

Hi all!

Really loving the Nerves system :slight_smile: I am trying to get hardware PWM working on Nerves on a RPI4. I had this working on Raspbian before. For Nerves, I was able to customize things to get the dtoverlay added in /boot/config.txt and having the pwm.dtbo file copied into /boot/overlays as well - these by using the custom fwup.conf etc.

But after this I still don’t have a /sys/class/pwm present in my sysfs.

I tried adding dtdebug=1 to config.txt too, but that didn’t give me more info in dmesg.

So I am now thinking that I’m missing the appropriate kernel module, thinking I need to have the pwm-bcm2835.ko which is not present in kernel/drivers.

I also checked the linux-4.19.defconfig and nerves_defconfig in the nerves_system_rpi4 repo and could not find any mention of CONFIG_PWM_BCM2835.

Does this mean I will have to clone the nerves_system_rpi4 repo, make my own changes and have the kernel recompiled in order to get this kernel module ?

Did someone else try to make this work earlier ?

Hoping to get some more info before I go down this rabbithole only to find out there’s an easier way :slight_smile:

Thanks,

Leon

Most Liked

fhunleth

fhunleth

Co-author of Nerves

Hi Leon,

The current answer for adding that option is yes, you’ll need to clone nerves_system_rpi4 and make a custom system. We’re aware that this is a lot of work for making a one line kernel configuration change.

Having said that, I think that it’s an oversight that the hardware PWM kernel module isn’t being built in the official RPi4 Nerves system. While our systems aim to be minimal, for the Raspberry Pi ones, we have been trying to error on the side of including the basics for attaching hardware devices. If you would like to send a PR to the repository that enables it, that would be appreciated.

There’s also some history on PWM support on the Raspberry Pi. Since the Pi has so few hardware PWM pins, most people (myself included) had either used an I2C->PWM module or used pigpio’s DMA controller-based PWM support. pigpio is included in the default Nerves systems for Raspberry Pi specifically for PWM support. If you go the I2C->PWM module route, there are quite a few options. Pololu, Adafruit, and Sparkfun all have modules for them and sometimes have servo connectors if that’s why you’re interested in PWM.

Hope this helps!

Where Next?

Popular in Questions Top

beno
I will often find my self writing things similar to: case some_value do nil -> something() "" -> something() _ -> somethi...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 records...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New
hariharasudhan94
Lets say I have map like this fetching from my database %{"_id" => #BSON.ObjectId<58eb1a7a9ad169198c3dXXXX>, "email" => ...
New

Other popular topics Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
lastday4you
I wanted to check elixir version in phoenix because i found that my elixir is 1.5 but when i use Enum.chunk_by it said the function is un...
New
chrismccord
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
baxterw3b
Hi guys, i’m new in the Elixir world, and i have to say, that i love it! i’m having some problem to understand anonymous functions with ...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
gausby
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
1207 39297 209
New
KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36128 110
New
Qqwy
Update: How to use the Blogs & Podcasts section You can post links to your blog posts or podcasts either in one of the Official Blog...
3271 126479 1222
New
PeterCarter
There are pre-rolled solutions for other frameworks that do work. However, Phoenix does not seem to have these. Have people had good expe...
New

We're in Beta

About us Mission Statement