leon

leon

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

Showing Posts 1 to 2

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!

leon

leon OP

Hi Frank,

Thanks for your response. I now have a custom nerves_system_rpi4 built and am currently experimenting with it. I cannot go the i2c route and have to use the hardware pwm as this is targeted to work with an existing daughterboard on the rpi4. I’ll create a PR for the nerves_system_rpi4 as soon as it works.

I never heard of the pigpio dma solution, right now I’m getting a 10khz frequency (from what I remember) on the hardware pwm pin 18 (gpio 12) which is working nice for led dimming. I’ll experiment with pigpio later too, thanks for the tip.

Regards,

Leon

— All posts loaded —

Where Next? Top

Trending in Questions Top

Blokh
Hey guys, I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly Do you guys have any suggestions what is the best prac...
New
RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
RemyXRenard
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
samoloth
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
FlyingNoodle
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New

Other Trending Topics Top

mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews