17 Replies Latest reply on Apr 29, 2020 11:37 PM by gdstew

    Reading BeagleBone AI Temperatures

    gdstew

      I finally brought up my BeagleBone AI with a 25mm x 7mm fan firmly screwed into the heat sink using M2 or

      M3 (they were salvaged so I don't know for sure) machine screws. It was a lot quieter than I was expecting

      although I don't believe it is running at the advertised 10K RPM. Attempting to update the software with

      apt-get upgrade (after doing apt-get update) died with the message "FATAL -> failed to fork" which turned out

      to be a low memory problem. The Getting Started program from the desktop was running the cloud9 IDE in

      the Chromium browser so I shut that down and did the upgrade again and it worked. I had no problems with

      any of the other updates after that.

       

      The next thing I did was go look for where the SoC temperatures could be read and I think I found them several

      sub-directories deep in the /sys directory. I do wish that there was a standard directory to put these in as

      everybody puts them in very different places in the /sys directory. There are 5 different thermal zones and

      each one has a directory in the /sys/devices/virtual/thermal/ directory named thermal_zone0 -  thermal_zone4.

      To display the temperature for thermal zone 0 use this command:

       

      debian@beaglebone:~$ cat /sys/devices/virtual/thermal/thermal_zone0/temp

      47000

      debian@beaglebone:~$

       

      The response, 47000 (your mileages WILL vary) is 47.0 deg. C.

       

      At the time the AI was mostly idle with me on a terminal inside an LXDE window. The temperatures I was

      reading were within a couple of degrees C across all the zones. There are many thermal management

      configuration files in the thermal_zoneX directories and it would be great to get documentation on what/where

      the thermal zones are as well as the thermal management settings used for them.

       

      While the idle temperatures were OK for checking out and doing light work on the AI I'm going to have to

      come up with some serious thermal solutions. A 40mm fan is the biggest you can get between the GPIO

      headers and I don't know if that will be big enough when you start loading up several of the more interesting

      cores.

        • Re: Reading BeagleBone AI Temperatures
          14rhb

          Thanks gdstew

           

          This is just the information I'll need soon. In a few days I'm expecting my USB-C cable and then I'll be powering up my BB-AI for the first time - having followed the various threads I'm keen to watch the temperatures.

          • Re: Reading BeagleBone AI Temperatures
            clem57

            Attempting to update the software with

            apt-get upgrade (after doing apt-get update) died with the message "FATAL -> failed to fork" which turned out

            to be a low memory problem.

            I too have noticed this. I think they got over zealous using TEMP in RAM... I plan to dial it back some. Also add external storage. The 16 G eMMC is a bit small. I will blog the results of tuning this over the weekend.

            1 of 1 people found this helpful
            • Re: Reading BeagleBone AI Temperatures
              14rhb

              I would have imagined all these BB-AI were the same, however very cautiously I too ran the sudo apt update and upgrade from the Loud9 IDE and it did work. No errors!

               

              I'm connected via Ethernet from a router/switch and connecting in via the Cloud9 web server from Mozilla Firefox.

              2 of 2 people found this helpful
              • Re: Reading BeagleBone AI Temperatures
                gdstew

                I just attached a bash shell script I wrote to read one or all temperature zones on a BeagleBone AI. There is a bin directory in the debian users home

                directory directory and I copied the script from a micro sd card to /home/debian/bin. The home/bin directory is not in the environment PATH variable

                so either have to add it to PATH, include the path with the file name when you execute it, or copy it somewhere already in PATH. I chose to copy it to

                /usr/local/bin using the command:

                 

                  debian@beaglebone:~$ sudo cp bin/ai_temp.sh /usr/local/bin

                 

                In order for the debian user to execute the script the file permissions have to be changed to allow it with the command:

                 

                   debian@beaglebone:~$ sudo chmod o+x /usr/local/bin/ai_temp.sh

                 

                After that:

                 

                To see all temperature zones type ai_temp.sh from the command line,

                 

                To see a specific zone temperature type ai_temp.sh X where X is the zone number from 0 - 4. If you type in an invalid zone number you will get an

                error message.

                 

                This script does use bash specific commands, specifically the ones used to extract characters from the temperature returned by the cat command.

                It also makes a couple of assumptions about the number of digits in the temperature. The first is that there are no more that two digits to the left of

                the decimal point. This is probably a safe assumption since the script will probably not be running if the AI temperature is > 99 deg. C. The second is

                that there there are two digits to the left of the decimal point. This is a reasonable assumption because the AI is not going below 10 deg. C unless

                some type of extreme cooling is used.

                 

                From testing the script it looks like zone 2 is the dual core ARM Cortex-A15. It is always the highest temperature by around 2 degrees C.

                4 of 4 people found this helpful
                  • Re: Reading BeagleBone AI Temperatures
                    mudz

                    Good Work you did there. Though, to be sure, you can always contact ti community, and get an official answer.

                    • Re: Reading BeagleBone AI Temperatures
                      rllbcheese

                      If you look at the /sys/devices/virtual/thermal/thermal_zoneX/type value, it gives you a 'name' for each of the thermal zones, as such:

                       

                      thermal_zone0/type = cpu_thermal

                      thermal_zone1/type = gpu_thermal

                      thermal_zone2/type = core_thermal

                      thermal_zone3/type = dspeve_thermal

                      thermal_zone4/type = iva_thermal

                       

                      gpu_thermal is clearly the SGX544, dspeve_thermal seems to be a combined thermal zone between the C66x and EVE cores, iva_thermal is the IVA-HD video engine.  Between the cpu_thermal and core_thermal, I would guess that you're right with zone 2 (core_thermal) being the actual A15 cores, with cpu_thermal being an overall package temperature.

                       

                      When idle, I'm finding iva_thermal is the highest, despite not decoding any video. 

                       

                      I've installed a fan (https://www.digikey.com/product-detail/en/nidec-copal-electronics/F251R-05LLC/563-1111-ND/1165505) so it's staying below 55 C while doing apt updates.  Works very well (and very quiet), although the fan connectors can pop out if you're not careful.

                      1 of 1 people found this helpful
                        • Re: Reading BeagleBone AI Temperatures
                          gdstew

                          Thanks for the information. I plan on putting it in the script sometime in the near(?) future. However I have to think about the best way to do

                          it a bit first and I am real busy with a couple of other projects right now.

                           

                          I'm not happy with my fan connection either. I have no problem with the leads staying put, although I am usually really careful. They just stick

                          out too far and are in the way as far as cases or capes go with no good solution, other than a fan cape or soldering iron, for getting them out

                          of the way. It was obvious that a fan would be needed, it would be nice if a fan connector was available.

                      • Re: Reading BeagleBone AI Temperatures
                        mfetting

                        The pre-attached heat sink has M3 holes spaced 20x20 mm.

                        The height of the heat sink clears the USB type A socket, and all other components on the board except the 46-way header sockets and the Ethernet socket.

                        2 of 2 people found this helpful
                          • Re: Reading BeagleBone AI Temperatures
                            gdstew

                            You also need enough room between the fan and any cape above it to allow the air to flow as freely as possible for more efficent cooling and to keep the load on the fan motor as low as possible.

                            I've wondered how many existing capes have header pins long enough to properly clear the fan and allow them to be used on the AI. As I said in another post, I understand why the wanted to

                            keep the BeagleBone form factor, but due to the thermal  problems everybody is seeing I think that it was a mistake. One possible way of getting around that would have been to put the GPIO

                            headers on the bottom of the board instead of the top. You could still use existing capes by using headers with male pins on both sides to connect between them and leave the top of the AI free

                            for a larger heat sink/fan. I have a Snickerdoodle Xilinx FPGA board that had this as a build option. It also had an option for a tall copper heat sink for the FPGA. Mine has both.

                            1 of 1 people found this helpful
                          • Re: Reading BeagleBone AI Temperatures
                            mp2100

                            Thanks for this information.  I bookmarked it for the day when my BB AI arrived.  And here it is.  Now it's up and running, it already crashed when doing the "sudo apt upgrade".  :-(   Fixed that with "sudo dpkg --configure -a"

                             

                            And now it's idling, only running the lxqt desktop, and thermal_zone2 is at 74 degr. C.  Idling at 74.  Ok, I don't have a fan on it.  I've seen all the advice about heat sinks and fans.  But idling at 74 C?  I even set the frequency to 400 MHz assuming it would drop the temperature, using Derek Molloy's instruction at Changing the Beaglebone CPU Frequency | derekmolloy.ie   Still idling at 74 C.

                            1 of 1 people found this helpful
                              • Re: Reading BeagleBone AI Temperatures
                                clem57

                                mp2100 sorry but no way getting around it. A fan on the passive heatsink is required. I tried without, to no avail.

                                Clem

                                • Re: Reading BeagleBone AI Temperatures
                                  gdstew

                                  Hi Allen,

                                   

                                  Due to prior warnings I never even turned on my BB AI until I had a fan installed so unfortunately I have no idea what to expect as far as idle temperatures without a fan

                                  goes. I do think that 74 deg. C at idle is too high especially if it is running at 400 MHz after you set it to do so. I suspect that the governor setting may be overriding yours

                                  but I'm not sure why it would at idle. Could you provide a display of the output of the cpufreq-info command for your BB AI? I recently spent some time using the cpufreq utility

                                  programs (actually trying to figure out how to turn the cpufrequtil off on a HP PC) so I have some familiarity with them.

                                   

                                  You are still going to need a fan on the BeagleBone AI even if you are just tinkering around. I have no idea how effective a small fan with the heat sink will be if/when you

                                  dial it up to 11. My guess is not very, and due to physical design constraints there is not much else you can do.

                                  1 of 1 people found this helpful
                                    • Re: Reading BeagleBone AI Temperatures
                                      mp2100

                                      Thanks for your interest Gary.  Here's the result from my cpufreq-info.

                                      debian@beaglebone:~$ cpufreq-info
                                      cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
                                      Report errors and bugs to cpufreq@vger.kernel.org, please.
                                      analyzing CPU 0:
                                        driver: cpufreq-dt
                                        CPUs which run at the same hardware frequency: 0 1
                                        CPUs which need to have their frequency coordinated by software: 0 1
                                        maximum transition latency: 460 us.
                                        hardware limits: 400 MHz - 1.50 GHz
                                        available frequency steps: 400 MHz, 1000 MHz, 1.18 GHz, 1.50 GHz
                                        available cpufreq governors: conservative, ondemand, userspace, powersave, performance
                                        current policy: frequency should be within 400 MHz and 400 MHz.
                                                        The governor "powersave" may decide which speed to use within this range.
                                        current CPU frequency is 400 MHz.
                                        cpufreq stats: 400 MHz:99.52%, 1000 MHz:0.00%, 1.18 GHz:0.00%, 1.50 GHz:0.48%  (2)
                                      analyzing CPU 1:
                                        driver: cpufreq-dt
                                        CPUs which run at the same hardware frequency: 0 1
                                        CPUs which need to have their frequency coordinated by software: 0 1
                                        maximum transition latency: 460 us.
                                        hardware limits: 400 MHz - 1.50 GHz
                                        available frequency steps: 400 MHz, 1000 MHz, 1.18 GHz, 1.50 GHz
                                        available cpufreq governors: conservative, ondemand, userspace, powersave, performance
                                        current policy: frequency should be within 400 MHz and 400 MHz.
                                                        The governor "powersave" may decide which speed to use within this range.
                                        current CPU frequency is 400 MHz.
                                        cpufreq stats: 400 MHz:99.52%, 1000 MHz:0.00%, 1.18 GHz:0.00%, 1.50 GHz:0.48%  (2)
                                      debian@beaglebone:~$
                                      

                                       

                                      I tried a few frequency settings and tried a few "governor" settings, but I didn't see the temperature change. It showed the new settings.  Perhaps I'm not doing it right, but it always (99.52% of the time) says it is running at 400 MHz.  That doesn't seem likely though since it overheats.  On my Pi 4, I can see it throttle the speed down to 600 MHz, and the temperature starts cooling down.  Is it possible the cpufreq-set command doesn't work on the BB AI?

                                       

                                      I'm running a test now with a better passive heat sink and then I'll add a fan and see what the temperature trends are.

                                        • Re: Reading BeagleBone AI Temperatures
                                          gdstew

                                          Well the output of the cpufreq-info command looks like it is always running the CPUs at 400 MHz like you told it to. Another command to

                                          try is cat /proc/cpuinfo. It should list both cores and among other things what frequency they are running at just as a second opinion

                                          although it may get the temperature from the same /sys directory so they will always be the same.

                                           

                                          It finally struck me that the most obvious explanation for what you are seeing is that the governor is already holding the CPU's to 400 MHz

                                          most of the time even when idle because of the temperature. The cpufreq-info command could help to verify this if you go back to the

                                          governor controlling the CPUs frequency and seeing what it says the percentages for the different frequencies are.

                                           

                                          I have come to the conclusion that the only adequate solution to allow the BB AI to run at full potential and allow access to the GPIO and

                                          other headers is a large, as in full PCB size, heat sink (and fan probably) that mounts on the bottom side using two or three heat pipes to

                                          move the heat from the SoC to the heat sink. Some problems with this are:

                                           

                                          *  It would be expensive

                                          *  It requires professional design and manufacturing

                                          *  It would work a lot better if there were holes in the PCB that could be used to clamp the heat pipes to the SoC and be able to use a "real"

                                              high performance thermal compound (thermal pads are just not good enough for this application). As is it will be difficult at best to maintain

                                              a good SoC to heat pipe physical contact. A thought just occurred to use springs on the heat sink mounts to maintain good contact with

                                              the SoC.

                                          *  It requires removing the existing heat sink without damaging the BB AI which is more than a little tricky because of the glued on heat pad.

                                              I have done this successfully a couple of times before replacing heat sinks I added to Raspberry Pis but it always causes me great concern

                                              when I do it.

                                          2 of 2 people found this helpful
                                            • Re: Reading BeagleBone AI Temperatures
                                              mp2100

                                              Gary, thank you, after you pointed out the obvious to me, it makes more sense.  Usually I'm not this slow to understand   It was always throttling at 400 MHz due to temperature.  Now I've put a spare fan on it, and I set the cpu to "performance", and the BBAI is so much faster.  I tried several passive heat sinks, and they helped, but it would not run at 1.5 GHz without a fan.  Thanks for the insight.

                                               

                                              I did all the updates including the new kernel and scripts.  After watching Jason's video on hackster.io, I have TIDL demo program working perfectly.

                                              1 of 1 people found this helpful
                                                • Re: Reading BeagleBone AI Temperatures
                                                  gdstew

                                                  Well if it makes you feel any better it took me a while and a couple of command responses to figure out the obvious. I am glad to see you got it to do what you wanted it to.

                                                  When I bought mine I planned to use a lot of the SoC resources, at least one of the DSPs, both of the "AI processors", both of the PRUs, and OpenCL on the GPUs. And

                                                  there is no way that is going to happen without a serious effort on thermal control along the lines of my previous response. Some of the time throttling would work and I

                                                  definitely want to limit power consumption when I can. But some times I'm going to need everybody working hard and the AI won't be able to do it as is.