{"id":9717,"date":"2018-04-11T16:16:48","date_gmt":"2018-04-11T07:16:48","guid":{"rendered":"https:\/\/www.hardkernel.com\/?p=9717"},"modified":"2018-12-10T11:17:04","modified_gmt":"2018-12-10T02:17:04","slug":"how-to-control-odroid-xu4-cooling-fan","status":"publish","type":"post","link":"https:\/\/www.hardkernel.com\/ko\/blog\/how-to-control-odroid-xu4-cooling-fan\/","title":{"rendered":"How to control ODROID-XU4 Cooling fan"},"content":{"rendered":"<p><span style=\"font-family: arial;\">ODROID-XU4 CPU has four 2Ghz big cores and four 1.4Ghz LITTLE cores.<\/span><\/p>\n<div><span style=\"font-family: arial;\">It also has six GPU cores as well as 2GByte DRAM on the SoC with a package on package(PoP) process.<br \/>\n<\/span><\/p>\n<div><span style=\"font-family: arial;\">So this tiny SoC power consumption can be up to 10 Watt and it generates a lot of heat.<\/span><\/div>\n<\/div>\n<div><span style=\"font-family: arial;\">Therefore, we had to attach a cooling fan to the SoC to minimize the thermal throttling.<\/span><\/div>\n<div><\/div>\n<div>\n<div><span style=\"font-family: arial;\"><img decoding=\"async\" src=\"http:\/\/www.sae.org\/dlymagazineimages\/web\/516\/10102_12077.jpg\" alt=\"Exa_fan_comvec_cmyk_300.jpg\" \/><\/span><\/div>\n<div><span style=\"font-family: arial;\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: arial;\">Once the system boots, the cooling fan runs at full speed by the u-boot(bootloader) initialization code.<\/span><br \/>\n<span style=\"font-family: arial;\">When the Linux Kernel runs, the thermal management driver controls the fan speed automatically.<\/span><br \/>\n<span style=\"font-family: arial;\">There are three threshold points 60\u00b0C, 70\u00b0C and 80\u00b0C.<\/span><\/p>\n<table border=\"2\" width=\"400\" cellspacing=\"0\" cellpadding=\"2\" align=\"left\" bgcolor=\"\">\n<tbody>\n<tr>\n<td><span style=\"font-family: arial;\">Trip point<\/span><\/td>\n<td><span style=\"font-family: arial;\">0<\/span><\/td>\n<td><span style=\"font-family: arial;\">1<\/span><\/td>\n<td><span style=\"font-family: arial;\">2<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-family: arial;\">Temperature<\/span><\/td>\n<td><span style=\"font-family: arial;\">60\u00b0C<\/span><\/td>\n<td><span style=\"font-family: arial;\">70\u00b0C<\/span><\/td>\n<td><span style=\"font-family: arial;\">80\u00b0C<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-family: arial;\">Fan speed<\/span><\/td>\n<td><span style=\"font-family: arial;\">120<\/span><\/td>\n<td><span style=\"font-family: arial;\">180<\/span><\/td>\n<td><span style=\"font-family: arial;\">240<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><span style=\"font-family: arial;\"><br \/>\n<\/span><br \/>\n<span style=\"font-family: arial;\"><br \/>\n<\/span><br \/>\nThe fan speed value is connected to 8bit(0~255) PWM control register.<\/p>\n<div><span style=\"font-family: arial;\">When the SoC temperature is lower than 60\u00b0C, the fan doesn&#8217;t rotate.<\/span><\/div>\n<\/div>\n<\/div>\n<div><\/div>\n<div>\n<p>If you need to adjust the temperature threshold values, just modify the thermal control nodes in sysfs.<\/p>\n<div>\n<p>For example, if you want to set trip point 1 to be activated at 30\u00b0C, you can just write a value on them.<\/p>\n<pre class=\"code bash target\">$ echo 30000 | sudo tee \/sys\/devices\/virtual\/thermal\/thermal_zone{0,1,2,3}\/trip_point_0_temp\r\n$ cat \/sys\/devices\/virtual\/thermal\/thermal_zone{0,1,2,3}\/trip_point_0_temp\r\n# results\r\n30000\r\n30000\r\n30000\r\n30000\r\n<\/pre>\n<p>Then the fan starts spinning at 30\u00b0C.<\/p>\n<p>If you want to do that automatically, write some code in the \/etc\/rc.local file.<br \/>\nCopy the following codes and paste.<\/p>\n<pre># Target temperature: 30\u00b0C, 50\u00b0C, 70\u00b0C\r\nTRIP_POINT_0=30000\r\nTRIP_POINT_1=50000\r\nTRIP_POINT_2=70000\r\n\r\necho $TRIP_POINT_0 &gt; \/sys\/devices\/virtual\/thermal\/thermal_zone0\/trip_point_0_temp\r\necho $TRIP_POINT_0 &gt; \/sys\/devices\/virtual\/thermal\/thermal_zone1\/trip_point_0_temp\r\necho $TRIP_POINT_0 &gt; \/sys\/devices\/virtual\/thermal\/thermal_zone2\/trip_point_0_temp\r\necho $TRIP_POINT_0 &gt; \/sys\/devices\/virtual\/thermal\/thermal_zone3\/trip_point_0_temp\r\n\r\necho $TRIP_POINT_1 &gt; \/sys\/devices\/virtual\/thermal\/thermal_zone0\/trip_point_1_temp\r\necho $TRIP_POINT_1 &gt; \/sys\/devices\/virtual\/thermal\/thermal_zone1\/trip_point_1_temp\r\necho $TRIP_POINT_1 &gt; \/sys\/devices\/virtual\/thermal\/thermal_zone2\/trip_point_1_temp\r\necho $TRIP_POINT_1 &gt; \/sys\/devices\/virtual\/thermal\/thermal_zone3\/trip_point_1_temp\r\n\r\necho $TRIP_POINT_2 &gt; \/sys\/devices\/virtual\/thermal\/thermal_zone0\/trip_point_2_temp\r\necho $TRIP_POINT_2 &gt; \/sys\/devices\/virtual\/thermal\/thermal_zone1\/trip_point_2_temp\r\necho $TRIP_POINT_2 &gt; \/sys\/devices\/virtual\/thermal\/thermal_zone2\/trip_point_2_temp\r\necho $TRIP_POINT_2 &gt; \/sys\/devices\/virtual\/thermal\/thermal_zone3\/trip_point_2_temp<\/pre>\n<p>Reboot and check if the changes applied well or not.<\/p>\n<p>If you want to change the fan speed values in trip points, modify this system node.<\/p>\n<pre>\/sys\/devices\/platform\/pwm-fan\/hwmon\/hwmon0\/fan_speed<\/pre>\n<p>You can check current fan speed scaling.<\/p>\n<pre>$ cat \/sys\/devices\/platform\/pwm-fan\/hwmon\/hwmon0\/fan_speed\r\n# results\r\n0 120 180 240<\/pre>\n<p>You can adjust these values by writing value set to the file.<br \/>\nIf you want to make your fan more aggressively, you can write like below.<\/p>\n<pre>$ echo \"0 204 220 240\" | sudo tee \/sys\/devices\/platform\/pwm-fan\/hwmon\/hwmon0\/fan_speed\r\n# results\r\n0 204 220 240<\/pre>\n<p>If you want to do that automatically, write some code in the \/etc\/rc.local file.<br \/>\nCopy the following codes and paste.<\/p>\n<pre># Target fan speed (PWM): 0, 204, 220, 240\r\necho \"0 204 220 240\" &gt; \/sys\/devices\/platform\/pwm-fan\/hwmon\/hwmon0\/fan_speed<\/pre>\n<p>You can also control the fan speed fully manually.<\/p>\n<pre># Set fan to manual mode\r\n$ echo 0 | sudo tee \/sys\/devices\/platform\/pwm-fan\/hwmon\/hwmon0\/automatic<\/pre>\n<pre># Set speed to 100%\r\n$ echo 255 | sudo tee \/sys\/devices\/platform\/pwm-fan\/hwmon\/hwmon0\/pwm1<\/pre>\n<p>&nbsp;<\/p>\n<p>If you need further information, refer this WiKi page.<br \/>\n<a href=\"https:\/\/wiki.odroid.com\/odroid-xu4\/application_note\/manually_control_the_fan#fully_manual_way_to_control_the_fan_speed\" target=\"_blank\" rel=\"noopener\"><b>https:\/\/wiki.odroid.com\/odroid-xu4\/application_note\/manually_control_the_fan#fully_manual_way_to_control_the_fan_speed<\/b><\/a><\/p>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>ODROID-XU4 CPU has four 2Ghz big cores and four 1.4Ghz LITTLE cores. It also has six GPU cores as well as 2GByte DRAM on the SoC with a package on package(PoP) process. So this tiny SoC power consumption can be up to 10 Watt and it generates a lot of heat. Therefore, we had to [&#8230;]\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18463,20906],"tags":[20878],"class_list":["post-9717","post","type-post","status-publish","format-standard","hentry","category-blog","category-blog-2-ko","tag-odroid-xu4"],"_links":{"self":[{"href":"https:\/\/www.hardkernel.com\/ko\/wp-json\/wp\/v2\/posts\/9717","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hardkernel.com\/ko\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hardkernel.com\/ko\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hardkernel.com\/ko\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hardkernel.com\/ko\/wp-json\/wp\/v2\/comments?post=9717"}],"version-history":[{"count":3,"href":"https:\/\/www.hardkernel.com\/ko\/wp-json\/wp\/v2\/posts\/9717\/revisions"}],"predecessor-version":[{"id":12105,"href":"https:\/\/www.hardkernel.com\/ko\/wp-json\/wp\/v2\/posts\/9717\/revisions\/12105"}],"wp:attachment":[{"href":"https:\/\/www.hardkernel.com\/ko\/wp-json\/wp\/v2\/media?parent=9717"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hardkernel.com\/ko\/wp-json\/wp\/v2\/categories?post=9717"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hardkernel.com\/ko\/wp-json\/wp\/v2\/tags?post=9717"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}