Tiny Core Base > Raspberry Pi

PWM on piCore

(1/2) > >>

boudinec:
Hello

I want to use pwm and spi on a raspberry 3 using piCore 15.0.

In /mnt/mmcblkp1, I added:
dtparam=spi=on
dtparam=pwm=on
Then I rebooted.

The SPI works, I can use /dev/spidev0.0
But I cannot manage to make the PWM module working: the directory /sys/class/pwm/ is still empty.

Can you help me to fix this ?
Bests

Cedric

Paul_123:
GPIO is all changed in the newer raspi kernels.  I'm not sure dtparam=pwm is even an option anymore.  Make sure you are looking at documentation from kernel 6.6.y

You need to look at the dtoverlays for pwm   

https://github.com/raspberrypi/linux/blob/14c5fee3bb3fd654605c33314645b27a8f1e7628/arch/arm/boot/dts/overlays/README#L4024

boudinec:
Hello
Thanks for you answer Paul

I forgot to tell that my RPi is a 3B.
I also tried:

--- Code: ---dtoverlay=pwm,pin=12,func=4
--- End code ---
and

--- Code: ---dtoverlay=pwm,pin=18,func=2
--- End code ---

Which is what is explained in the docs. But it doesn't works.
The documentation is the same as with bookworm (kernel 6.6.62) and the same config works.

I cannot see any errors in dmesg. Do you know if some errors messages are available about overlays?

I also tried to load from the shell but the overlays cannot be found:

--- Code: ---tc@box:~$ dtoverlay -a
*Failed to find overlays directory
--- End code ---

Do you know what show be the overlays directory?

Bests

Juanito:
The overlays directory is at /mnt/mmcblk0p1/overlays - you need to mount /dev/mmcblk0p1 first.

boudinec:
I mounted /dev/mmcblk0p1 with the graphical tool, so it is mounted as /mnt/mmcblk0p1.
And sitll dtoverlay fails to locate the overlays.

On raspberryPIOS, overlays are searched in /boot/overlays.
So, I created a simlink :

--- Code: ---sudo ln -s /mnt/mmcblk0p1 /boot
--- End code ---

The error has changed:

--- Code: ---$sudo overlay -l
mount: /config/device-tree: mount point does not exist.
dmesg(1) may have more information after failed mount system call
* Failed to mount configfs - 2

--- End code ---

dmesg gives no information about mount errors


Cedric

Navigation

[0] Message Index

[#] Next page

Go to full version