.. _fan-62: 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 `_ . .. image:: ../../images/phycore-am62x/pb-07124_fan.png :width: 800px :alt: 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: .. list-table:: :header-rows: 1 * - 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 `_ .. image:: ../../images/phycore-am62x/pb-07124_fan_schematic_15761.png :width: 700px :alt: phyCORE-AM62x Fan Schematic Recommended Header Configuration ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. list-table:: :header-rows: 1 * - 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 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. .. list-table:: :header-rows: 1 * - 1576.1 - 1576.2 * - .. image:: ../../images/phycore-am62x/pb-07124_fan-closeup-pin1.png - .. image:: ../../images/phycore-am62x/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. .. code-block:: none :caption: Target (U-boot) setenv overlays k3-am62-phyboard-lyra-gpio-fan.dtbo boot .. note:: For more information about overlays see chapter :ref:`ConfiguringTheBootloader-62`. * Verify that the "gpio-fan" was exported properly to gpio-460. .. code-block:: none :caption: Target (Linux) cat /sys/kernel/debug/gpio .. code-block:: none :caption: Expected Output root@phyboard-lyra-am62xx-3:~# 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. .. code-block:: none :caption: 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. * Turn the fan OFF. .. code-block:: none :caption: Target (Linux) echo 0 > /sys/class/thermal/cooling_device0/cur_state