Fan

The phyCORE-AM62x development kit provides fan connectivity via a 4-pin Hirose connector at X16 (VCC_5V0_SW rail). The fan is intended to be mounted directly to the processor heat sink for thermal management. The regulated 5V output is enabled by driving a GPIO0 low (0), turning the fan on. When the GPIO0 is pulled high (1), the 5V supplied to the fan connector will be turned off. This guide will demonstrate how to test your connections to the header x16. To learn more information about the phyCORE-AM62x thermal management and fan utilization, please see section 4.9 in the Hardware Manual .

phyCORE-AM62x 1576.1 Fan

Requirements

The phyCORE-AM62x development kit 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

(29mmx29mmx9.5mm)

Digikey link (heat sink)

Fan

DC axial fan, 30mm square x 10mm

Digikey link (fan)

Female Connector

PCB 1576.1 version 4xpin keyed header

Digikey link (female connector for 1576.1)

Female Connector

PCB 1576.2 version 4xpin keyed header

Digikey link (female connector for 1576.2)

Crimping Terminals

4x crimping jackets

Mouser link

phyCORE-AM62x Fan Schematic

Hardware Setup

  • Connect fan to the 4-pin Hirose connector located at X16.

    Warning

    Please note that the PCB version 1576.1 has a different connector and pin 1 placement than the newer PCB 1576.2 version.

1576.1

1576.2

../../_images/pb-07124_fan-closeup-pin1.png ../../_images/pb-07124_fan-2.png

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.

    Target (U-boot)
    setenv overlays k3-am62-phyboard-lyra-gpio-fan.dtbo
    boot
    

Note

For more information about overlays see chapter Configuring the Bootloader.

  • Verify that the “gpio-fan” was exported properly to gpio-460.

    Target (Linux)
    cat /sys/kernel/debug/gpio
    
    Expected Output
    root@phyboard-lyra-am62xx-2:~# cat /sys/kernel/debug/gpio
    gpiochip2: GPIOs 360-367, parent: i2c/1-0021, pcf8574, can sleep:
    gpio-360 (GPIO0_HDMI_RST      |reset               ) out hi ACTIVE LOW
    gpio-361 (GPIO1_CAN0_nEN      |standby             ) out lo
    gpio-362 (GPIO2_LED2          |led-2               ) out lo
    gpio-363 (GPIO3_LVDS_GPIO     )
    gpio-364 (GPIO4_BUT2          |menu                ) in  lo IRQ
    gpio-365 (GPIO5_LVDS_BKLT_EN  )
    gpio-366 (GPIO6_ETH1_USER_RESE)
    gpio-367 (GPIO7_AUDIO_USER_RES)
    
    gpiochip1: GPIOs 368-419, parent: platform/601000.gpio, 601000.gpio:
    gpio-391 (                    |home                ) in  lo
    
    gpiochip0: GPIOs 420-511, parent: platform/600000.gpio, 600000.gpio:
    gpio-433 (                    |green:heartbeat     ) out lo
    gpio-452 (                    |led-1               ) out lo
    gpio-460 (                    |gpio-fan            ) out lo ACTIVE LOW
    

Toggling the Fan

  • Turn the fan ON.

    Target (Linux)
    echo 1 > /sys/class/thermal/cooling_device0/cur_state
    

Note

Run the command above 3-4 times to have the fan stay ON consistently. See the section below “Consistent Fan Flow (Advanced)” for more information.

  • Turn the fan OFF.

    Target (Linux)
    echo 0 > /sys/class/thermal/cooling_device0/cur_state
    

Consistent Fan Flow (Advanced)

The GPIO that controls the fan is also being toggled by thermal zone control, therefore causing the inconsistent fan flow from the simple GPIO toggle above. This inconsistency can be solved by making edits to the device tree overlay that exports the GPIO, k3-am62-phyboard-lyra-gpio-fan.dtso.

  • Build the BSP on a Linux machine. Follow this guide: Build the BSP

  • Locate the “k3-am62-phyboard-lyra-gpio-fan.dtso” file in BSP build.

    Ubuntu
    cd /home/<user>/<path-to-your-bsp-build>/build/tmp/work-shared/phyboard-lyra-am62xx-2/kernel-source/arch/arm64/boot/dts/ti
    
  • Edit the overlay file.

    Ubuntu
    vim k3-am62-phyboard-lyra-gpio-fan.dtso
    

Note

The fan be set to consistently flow by either commenting out the “cooling-map” section or (prefered method) by lowering the thermal zone trip point temperature.

The second method could be simply implemented by changing the trip point temperature to be 40C .

  • Then follow the guide Modify The BSP section “Change the Linux Kernel Device Tree” in order to rebuild your kernel image with the adjusted temperature.