Fan
The phyBOARD-Electra AM64x includes a 4-pin connector at X12 for fan connectivity, designed for mounting the fan directly onto the processor heat sink for thermal management. The fan’s 5V power output can be controlled through a general-purpose control signal. When the control signal is set to a low state (0), the fan is powered on. Conversely, setting the control signal to a high state (1) turns off the 5V supply to the fan connector. This guide will demonstrate how to test your connections to the 4-pin connector at X12. For additional information on phyCORE-AM64x thermal management and fan operation, please refer to the Fan section in the Hardware Manual.

Requirements
The phyBOARD-Electra AM64x does not include a heat sink and fan. The below are the two fans that were tested on the PHYTEC hardware:
Item |
Description |
Link |
---|---|---|
Heat Sink (Optional) |
(29mmx29mmx9.5mm) |
|
Fan |
DC axial fan, 30mm square x 10mm |
|
Female Connector |
PCB 1566.2 version 4x pin keyed header |
|
Crimping Terminals |
4x crimping jackets |

Recommended Header Configuration
Pin |
Signal |
Wire Color |
---|---|---|
1 |
VCC_5V0_SW |
Red |
2 |
GND |
Black |
3 |
FAN_FG |
Yellow |
4 |
PWM |
Blue |
Hardware Setup
Connect fan to the 4-pin connector at X12.
Enabling the Overlay
Power on the development kit and stop in U-boot.
Load the device tree overlay required for exporting the GPIO signal that controls the fan and then boot the board.
sh-uboot:~# setenv overlays k3-am642-phyboard-electra-gpio-fan.dtbo sh-uboot:~# boot
Note
For more information about overlays see chapter Configuring the Bootloader.
Verify that the “gpio-fan” was exported properly.
sh-phyboard-electra-am64xx-2:~# gpioinfo | grep gpio-fan line 40: unnamed output active-low consumer=gpio-fan
Toggling the Fan
Turn the fan ON.
sh-phyboard-electra-am64xx-2:~# echo 1 > /sys/class/thermal/cooling_device0/cur_state
Note
The fan may not stay on due to a conflicting service. You may need to toggle it manually like this multiple times.
Turn the fan OFF.
sh-phyboard-electra-am64xx-2:~# echo 0 > /sys/class/thermal/cooling_device0/cur_state
Enabling a proper Thermal Governor
If your application includes a GPIO-based fan, PHYTEC recommends enabling the bang-bang thermal governor as the default setting. This governor uses hysteresis to manage fan state transitions, preventing abrupt on/off cycling and enabling smoother control for fans that only support binary on/off operation, rather than variable speed throttling.
- To check if you have the bang-bang thermal governer enabled, use the following command:
sh-phyboard-electra-am64xx-2:~# zcat /proc/config.gz | grep CONFIG_THERMAL_DEFAULT_GOV_BANG_BANG
Update the current thermal governor strategy to bang-bang using the command below:
sh-phyboard-electra-am64xx-2:~# echo bang_bang > /sys/class/thermal/thermal_zone0/policy
Note
To enable the bang-bang thermal governor by default, recompile the kernel with CONFIG_THERMAL_DEFAULT_GOV_BANG_BANG=y in the menuconfig configuration. For further details, please refer to the guide: Modify The BSP.
Note
For more information about thermal management, please see Thermal Zone.