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

albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
JeremM34
Hello, how can I check the Phoenix version ? Thanks !
New
tduccuong
Hi, is there any work on GUI with Elixir, that is similar to Electron/Javascript? My idea is to bundle Phoenix and BEAM into a single se...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
earth10
Hi, I’m just starting to build a side-project with Elixir and Phoenix and doing some basic test with Elixir alone. What strikes me is th...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
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
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list. ...
New
dotdotdotPaul
Okay, I’m having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I’m sure I’...
New
WestKeys
Currently suffering from paralysis by [HTTP client] analysis. This is rather unusual in Elixirland as there tends to be consensus on the ...
New

Other popular topics Top

Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
274 41539 114
New
albydarned
Hello all! I am typing this post from my new MacBook Pro with the M1 chip. I’m loving it so far, and will probably use it as my daily dr...
New
shahryarjb
Hello, I have map which I want to convert it to string like this: the map: %{last_name: "tavakkoli", name: "shahryar"} the string I ne...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
Emily
I have VueJS GUIs with the project generated using Webpack. I have Elixir modules that will need to be used by the VueJS GUIs. I forese...
New
ashish173
I am using Ecto timestamps with postgres, I can see the timestamps() use the :naive_dateime but for my use case I wanted to store the ti...
New
boundedvariable
I am going through the kafka architecture. All the features what the kafka is providing are already in Erlang. I would like hear your opi...
New

We're in Beta

About us Mission Statement