We use some essential cookies to make our website work.

We use optional cookies, as detailed in our cookie policy, to remember your settings and understand how you use our website.

11 posts • Page 1 of 1
LukeSkyD
Posts: 6
Joined: Wed Apr 30, 2025 7:52 pm

Fedora 42, Raspberry Pi and gpio-fan overlay

Wed Apr 30, 2025 8:04 pm

Hello everyone!

Sorry if I'm missing something.

I need to put on the internet a service my friends can access.
Previously such service was implemented on Fedora 34, for security’s sake I thought an update was needed.
Installing and setting up f42 Server edition went smooth but now I’m having issues implementing a basic fan control.
I have a three pin fan, one ground, one voltage and the other control (blue cable in GPIO10 pin).

With f34, inside /boot/efi/control.txt i simply added:

Code: Select all

dtoverlay=gpio-fan,gpiopin=10,temp=65000
Which allowed the fan to start spinning when 65° celsius is reached.
Now the same configuration doesn’t work, the fan’s always on while the temp reported is 45°.

First I tried moving the line from under [pi4] to [all] or even before those two: doesn’t work.
Then I tried changing kernel because I thought config.txt was being skipped. It isn’t: a bad config.txt file doesnt allow the system to boot.
I checked with raspi-config or ways to make it work with fedora to no avail.

I checked with sudo gpioinfo how’s the status and noticed that there was no gpio10, rather an SPI port.
So i went to config.txt with dtparam trying to disable spi all together but no matter the settings, there was no way to have the pin as GPIO10, only SPI.

I moved the blue cable from GPIO10 to 17, updated config.txt: nothing.
gpioinfo was showing GPIO17 as input, with the line

Code: Select all

gpio=17=op,dh
I changed it to "output" thinking this was the problem, the fan is always on.

The only command i found working was

Code: Select all

sudo gpioset -c gpiochip0 17=0
it correctly turns off the fan, but i would like an automatic approach.

Without the -c i get the error

Code: Select all

gpioset: invalid line value: 'gpiochip0'
There is a gpio-fan file inside /boot/efi/overlays so i think that’s implemented.
With the command

Code: Select all

dmesg | grep -i fan
I get nothing.
WIth the command

Code: Select all

sudo dmesg | grep gpio
I get

Code: Select all

[ 2.161331] pinctrl-bcm2835 fe200000.gpio: GPIO_OUT persistence: no
kernel version:
6.14.4-300.fc42.aarch64

I’m out of options, anyone can help me?
Do i really need to do a script (which wouldnt be that hard, but I'm stubborn)?
Thanks!

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6874
Joined: Mon Sep 29, 2014 1:07 pm

LukeSkyD
Posts: 6
Joined: Wed Apr 30, 2025 7:52 pm

Re: Fedora 42, Raspberry Pi and gpio-fan overlay

Wed Apr 30, 2025 9:47 pm

PhilE wrote:
Wed Apr 30, 2025 9:29 pm
Post the complete config.txt.
Here:

Code: Select all

# Options you can adjust for all Raspberry Pi Revisions
# https://www.raspberrypi.com/documentation/computers/config_txt.html
# Some settings may impact device functionality. See link above for details
# To use this on Fedora you need to use firmware provided device tree, not kernel
# For this functionality follow the following guide:
# https://fedoraproject.org/w/index.php?title=Architectures/ARM/Raspberry_Pi/HATs
# Details on overlays and additional parameters are documented in
# /boot/efi/overlays/README
# Default Fedora configs for all Raspberry Pi Revisions
# Put the RPi into 64 bit mode
arm_64bit=1
# We use U-Boot
kernel=rpi-u-boot.bin
# Run as fast as the firmware allows
arm_boost=1
# Enable UART
# Only enable UART if you're going to use it as it has speed implications
# Serial console is ttyS0 on RPi3 and ttyAMA0 on all other variants
# u-boot will auto detect serial and pass corrent options to kernel if enabled
# Speed details: https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=141195
enable_uart=1
# Enable audio (loads snd_bcm2835)
dtparam=audio=on
# Old FW camera
camera_auto_detect=0
# Automatically load overlays for detected DSI displays
display_auto_detect=1
# Enable DRM VC4 V3D driver
dtoverlay=vc4-kms-v3d
max_framebuffers=2
# Don't have the firmware create an initial video= setting in cmdline.txt.
# Use the kernel's default instead.
disable_fw_kms_setup=1
# Stop the RPi turning on HDMI monitors on reboot
hdmi_ignore_cec_init=1
# Raspberry Pi 3 series
[pi3]
dtoverlay=upstream
# Zero series
[pi0]
gpu_mem=16
# Raspberry Pi 4 series
[pi4]
dtoverlay=upstream-pi4
# Allow 256Mb of CMA by default on RPi4+
dtoverlay=cma,cma-256
# 4K display support - RPi4+ only, only one port possible
# hdmi_enable_4kp60=1
# Raspberry Pi CM4
[cm4]
# Enable host mode on the 2711 built-in XHCI USB controller.
# This line should be removed if the legacy DWC2 controller is required
# (e.g. for USB device mode) or if USB support is not required.
otg_mode=1
# Raspberry Pi 5
[pi5]
# Allow 256Mb of CMA by default on RPi4+
dtoverlay=cma,cma-256
# 4K display support - RPi4+ only, only one port possible
# hdmi_enable_4kp60=1
[all]
gpio=17=op,dh
dtoverlay=gpio-fan,gpiopin=17,temp=65000
# HAT and DT overlays. Documentation at Raspberry Pi here:
# https://www.raspberrypi.org/documentation/configuration/device-tree.md
# Each dtoverlay line is an individual HAT/overlay, multiple lines allowed
# dtoverlay=rpi-sense
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on
# For cameras enable the sensor, examples below, support is still very early
# EG RPi Camera Module 2
# dtparam=imx219

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6874
Joined: Mon Sep 29, 2014 1:07 pm

Re: Fedora 42, Raspberry Pi and gpio-fan overlay

Thu May 01, 2025 8:44 am

Fedora 42 appears to be using an upstream kernel, but possibly with downstream Device Tree files. It's also using U-boot, which is another complicatio. The fact that you need a system running a Fedora image to install a Pi Fedora image means I won't be investigating myself.

You can look for pin owners with:

Code: Select all

$ sudo cat /sys/kernel/debug/pinctrl/fe200000.gpio-pinctrl-bcm2711/pinmux-pins
And it may speed things up if you can upload a copy of your Pi's DT (/sys/firmware/fdt) somewhere I can download it.

LukeSkyD
Posts: 6
Joined: Wed Apr 30, 2025 7:52 pm

Re: Fedora 42, Raspberry Pi and gpio-fan overlay

Thu May 01, 2025 9:02 am

PhilE wrote:
Thu May 01, 2025 8:44 am
Fedora 42 appears to be using an upstream kernel, but possibly with downstream Device Tree files. It's also using U-boot, which is another complicatio. The fact that you need a system running a Fedora image to install a Pi Fedora image means I won't be investigating myself.

You can look for pin owners with:

Code: Select all

$ sudo cat /sys/kernel/debug/pinctrl/fe200000.gpio-pinctrl-bcm2711/pinmux-pins
And it may speed things up if you can upload a copy of your Pi's DT (/sys/firmware/fdt) somewhere I can download it.
pin owners:

Code: Select all

Pinmux settings per pin
Format: pin (name): mux_owner gpio_owner hog?
pin 0 (gpio0): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 1 (gpio1): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 2 (gpio2): fe804000.i2c (GPIO UNCLAIMED) function alt0 group gpio2
pin 3 (gpio3): fe804000.i2c (GPIO UNCLAIMED) function alt0 group gpio3
pin 4 (gpio4): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 5 (gpio5): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 6 (gpio6): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 7 (gpio7): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 8 (gpio8): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 9 (gpio9): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 10 (gpio10): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 11 (gpio11): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 12 (gpio12): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 13 (gpio13): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 14 (gpio14): fe215040.serial (GPIO UNCLAIMED) function alt5 group gpio14
pin 15 (gpio15): fe215040.serial (GPIO UNCLAIMED) function alt5 group gpio15
pin 16 (gpio16): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 17 (gpio17): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 18 (gpio18): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 19 (gpio19): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 20 (gpio20): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 21 (gpio21): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 22 (gpio22): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 23 (gpio23): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 24 (gpio24): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 25 (gpio25): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 26 (gpio26): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 27 (gpio27): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 28 (gpio28): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 29 (gpio29): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 30 (gpio30): fe201000.serial (GPIO UNCLAIMED) function alt3 group gpio30
pin 31 (gpio31): fe201000.serial (GPIO UNCLAIMED) function alt3 group gpio31
pin 32 (gpio32): fe201000.serial (GPIO UNCLAIMED) function alt3 group gpio32
pin 33 (gpio33): fe201000.serial (GPIO UNCLAIMED) function alt3 group gpio33
pin 34 (gpio34): fe300000.mmc (GPIO UNCLAIMED) function alt3 group gpio34
pin 35 (gpio35): fe300000.mmc (GPIO UNCLAIMED) function alt3 group gpio35
pin 36 (gpio36): fe300000.mmc (GPIO UNCLAIMED) function alt3 group gpio36
pin 37 (gpio37): fe300000.mmc (GPIO UNCLAIMED) function alt3 group gpio37
pin 38 (gpio38): fe300000.mmc (GPIO UNCLAIMED) function alt3 group gpio38
pin 39 (gpio39): fe300000.mmc (GPIO UNCLAIMED) function alt3 group gpio39
pin 40 (gpio40): fe20c800.pwm (GPIO UNCLAIMED) function alt0 group gpio40
pin 41 (gpio41): fe20c800.pwm (GPIO UNCLAIMED) function alt0 group gpio41
pin 42 (gpio42): (MUX UNCLAIMED) pinctrl-bcm2711:554
pin 43 (gpio43): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 44 (gpio44): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 45 (gpio45): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 46 (gpio46): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 47 (gpio47): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 48 (gpio48): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 49 (gpio49): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 50 (gpio50): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 51 (gpio51): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 52 (gpio52): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 53 (gpio53): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 54 (gpio54): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 55 (gpio55): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 56 (gpio56): (MUX UNCLAIMED) (GPIO UNCLAIMED)
pin 57 (gpio57): (MUX UNCLAIMED) (GPIO UNCLAIMED)
fdt:
It's attached here, I had to rename it to fdt.zip so i could upload it but it's still "fdt" file.
Attachments
fdt.zip
(39.5 KiB) Downloaded 111 times

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6874
Joined: Mon Sep 29, 2014 1:07 pm

Re: Fedora 42, Raspberry Pi and gpio-fan overlay

Thu May 01, 2025 9:23 am

Hmmm - all the SPI interfaces are disabled as expected, so I really don't think it's the kernel getting in the way. I'm curious to see the output you got from gpioinfo for GPIO 10 (and 17, while you're at it) if you still have it or can recreate it.

The most likely explanation is that the overlay is not working - you aren't seeing evidence in the kernel log such as:

Code: Select all

~$ dmesg | grep -i fan
[ 7.257793] gpio-fan gpio-fan@0: GPIO fan initialized
Take a quick look for kernel errors with "dmesg -l err,warn", and for errors from the firmware with "sudo vclog -m". If vclog isn't installed, you can built it yourself: https://github.com/raspberrypi/utils/tree/master/vclog

LukeSkyD
Posts: 6
Joined: Wed Apr 30, 2025 7:52 pm

Re: Fedora 42, Raspberry Pi and gpio-fan overlay

Thu May 01, 2025 10:29 am

PhilE wrote:
Thu May 01, 2025 9:23 am
Hmmm - all the SPI interfaces are disabled as expected, so I really don't think it's the kernel getting in the way. I'm curious to see the output you got from gpioinfo for GPIO 10 (and 17, while you're at it) if you still have it or can recreate it.

The most likely explanation is that the overlay is not working - you aren't seeing evidence in the kernel log such as:

Code: Select all

~$ dmesg | grep -i fan
[ 7.257793] gpio-fan gpio-fan@0: GPIO fan initialized
Take a quick look for kernel errors with "dmesg -l err,warn", and for errors from the firmware with "sudo vclog -m". If vclog isn't installed, you can built it yourself: https://github.com/raspberrypi/utils/tree/master/vclog
dmesg:

Code: Select all

[ 0.798561] pci_bus 0000:01: supply vpcie3v3 not found, using dummy regulator
[ 0.798643] pci_bus 0000:01: supply vpcie3v3aux not found, using dummy regulator
[ 0.798693] pci_bus 0000:01: supply vpcie12v not found, using dummy regulator
[ 2.482673] device-mapper: core: CONFIG_IMA_DISABLE_HTABLE is disabled. Duplicate IMA measurements will not be recorded in the IMA log.
[ 5.031588] usb_phy_generic phy: dummy supplies not allowed for exclusive requests (id=vbus)
[ 5.133046] dwc2 fe980000.usb: supply vusb_d not found, using dummy regulator
[ 5.142292] dwc2 fe980000.usb: supply vusb_a not found, using dummy regulator
[ 13.122555] kauditd_printk_skb: 32 callbacks suppressed
[ 13.761054] vchiq: module is from the staging directory, the quality is unknown, you have been warned.
[ 14.339117] brcmfmac mmc0:0001:1: Direct firmware load for brcm/brcmfmac43455-sdio.raspberrypi,4-model-b.bin failed with error -2
[ 14.459928] snd_bcm2835: module is from the staging directory, the quality is unknown, you have been warned.
[ 14.514529] hci_uart_bcm serial0-0: supply vbat not found, using dummy regulator
[ 14.527283] hci_uart_bcm serial0-0: supply vddio not found, using dummy regulator
[ 14.925401] Bluetooth: hci0: BCM: firmware Patch file not found, tried:
[ 14.932311] Bluetooth: hci0: BCM: 'brcm/BCM4345C0.raspberrypi,4-model-b.hcd'
[ 14.932322] Bluetooth: hci0: BCM: 'brcm/BCM4345C0.hcd'
[ 14.932325] Bluetooth: hci0: BCM: 'brcm/BCM.raspberrypi,4-model-b.hcd'
[ 14.932327] Bluetooth: hci0: BCM: 'brcm/BCM.hcd'
[ 15.077368] bcm2835_mmal_vchiq: module is from the staging directory, the quality is unknown, you have been warned.
[ 15.127388] bcm2835_v4l2: module is from the staging directory, the quality is unknown, you have been warned.
While vclog returns
Fatal error: Could not determine logs location from Device Tree

and it doesnt seem to be a way to change which directory it's searching for.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6874
Joined: Mon Sep 29, 2014 1:07 pm

Re: Fedora 42, Raspberry Pi and gpio-fan overlay

Thu May 01, 2025 12:12 pm

That's annoying - your firmware must be too old to support vclog. What does "vcgencmd version" report?

If you have a second Pi, or some other device with a serial interface, you may be able to capture the boot time diagnostics by putting the following in config.txt

Code: Select all

enable_uart=1
uart_2ndstage=1
The UART TX appears on header pin 8, with a convenient GND on pin 6. Pin 10 is the RX.

Fortunately some errors from the firmware have made it through into the FDT you provided:

Code: Select all

dterror: can't find symbol 'i2c2'
dterror: Failed to resolve overlay 'vc4-kms-v3d'
Failed to open command line file 'cmdline.txt'
You can read them with:

Code: Select all

$ cat /proc/device-tree/chosen/user-warnings
If the file doesn't exist, that's because there were no warnings.

The i2c2 message makes me think that it hasn't loaded the correct vc4-kms-v3d for your Pi 4.
1. Does changing config.txt to refer to vc4-kms-v3d-pi4 instead make a difference?
2. Is there a file overlay_map.dtb in the overlays directory?

LukeSkyD
Posts: 6
Joined: Wed Apr 30, 2025 7:52 pm

Re: Fedora 42, Raspberry Pi and gpio-fan overlay

Thu May 01, 2025 2:52 pm

PhilE wrote:
Thu May 01, 2025 12:12 pm
That's annoying - your firmware must be too old to support vclog. What does "vcgencmd version" report?

If you have a second Pi, or some other device with a serial interface, you may be able to capture the boot time diagnostics by putting the following in config.txt

Code: Select all

enable_uart=1
uart_2ndstage=1
The UART TX appears on header pin 8, with a convenient GND on pin 6. Pin 10 is the RX.

Fortunately some errors from the firmware have made it through into the FDT you provided:

Code: Select all

dterror: can't find symbol 'i2c2'
dterror: Failed to resolve overlay 'vc4-kms-v3d'
Failed to open command line file 'cmdline.txt'
You can read them with:

Code: Select all

$ cat /proc/device-tree/chosen/user-warnings
If the file doesn't exist, that's because there were no warnings.

The i2c2 message makes me think that it hasn't loaded the correct vc4-kms-v3d for your Pi 4.
1. Does changing config.txt to refer to vc4-kms-v3d-pi4 instead make a difference?
2. Is there a file overlay_map.dtb in the overlays directory?
Had to build vcgencmd too.

Code: Select all

sudo ./vcgencmd version
Can't open device file: /dev/vcio
Try creating a device file with: sudo mknod /dev/vcio c 100 0
Using that mknod command doesnt change the anything.

I unfortunately dont have any device that can read from serial port.

Changing from vc4-kms-v3d to vc4-kms-v3d-pi4 didn't solve the fan issue but now from cat user-warnings only the cmdline error appears.

There is no overlay_map.dtb in the overlays directory, there are some
ov2311.dtbo
ov5647.dtbo
ov64a40.dtbo
ov7251.dtbo
ov9281.dtbo

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6874
Joined: Mon Sep 29, 2014 1:07 pm

Re: Fedora 42, Raspberry Pi and gpio-fan overlay

Thu May 01, 2025 4:48 pm

I don't think I'm going to be able to help you any further, but I've moved the topic into the Fedora section of the Forums in case somebody else can.

LukeSkyD
Posts: 6
Joined: Wed Apr 30, 2025 7:52 pm

Re: Fedora 42, Raspberry Pi and gpio-fan overlay

Thu May 01, 2025 5:38 pm

PhilE wrote:
Thu May 01, 2025 4:48 pm
I don't think I'm going to be able to help you any further, but I've moved the topic into the Fedora section of the Forums in case somebody else can.
Ok, thank you for your time and patience!

11 posts • Page 1 of 1

Return to "Pidora / Fedora"

AltStyle によって変換されたページ (->オリジナル) /