Difference between revisions of "DESK-XZ7-L/Peripherals/Temperature sensor"

From DAVE Developer's Wiki
Jump to: navigation, search
(Created page with "<section begin=History/> {| style="border-collapse:collapse; " !colspan="4" style="width:100%; text-align:left"; border-bottom:solid 2px #ededed"|History |- !style="border-le...")
 
 
Line 6: Line 6:
 
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|Notes
 
!style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#73B2C7; padding:5px; color:white"|Notes
 
|-
 
|-
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000"|2023/01/23
+
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|2024/01/23
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#ededed; padding:5px; color:#000000"|DESK-XZ7-L-1.0.1 release
+
|style="border-left:solid 2px #73B2C7; border-right:solid 2px #73B2C7;border-top:solid 2px #73B2C7; border-bottom:solid 2px #73B2C7; background-color:#edf8fb; padding:5px; color:#000000"|DESK-XZ7-L-1.0.1 release
 
|-
 
|-
 
|}
 
|}
 
<section end=History/>
 
<section end=History/>
 +
__FORCETOC__
 
<section begin=Body/>
 
<section begin=Body/>
  
== Temperature sensors ==
+
==Peripheral Temperature sensors ==
Bora and BoraX SOMs has a [http://www.ti.com/lit/ds/symlink/tmp422.pdf TMP421AIDCN] temperature sensor onboard.
 
  
The following commands can be issued from command line in order to get the SOM temperatue:
+
[[BORA SOM | BORA]] and [[BORA Xpress SOM | BORA Xpress]] SOMs has a [http://www.ti.com/lit/ds/symlink/tmp422.pdf TMP421AIDCN] temperature sensor onboard.
* read the PCB temperature
+
 
 +
===Accessing the peripheral ===
 +
 
 +
The temperature information can be accessed through the <code>sysfs</code> interface:  
 +
 
 +
==== read the PCB temperature ====
 
<pre>
 
<pre>
 
root@bora:~# cat /sys/devices/soc0/axi/e0004000.i2c/i2c-0/0-004f/hwmon/hwmon1/temp1_input
 
root@bora:~# cat /sys/devices/soc0/axi/e0004000.i2c/i2c-0/0-004f/hwmon/hwmon1/temp1_input
 
</pre>
 
</pre>
 
the returned value has to be divided by 1000 for a °C temperature
 
the returned value has to be divided by 1000 for a °C temperature
* read the CPU temperature
+
==== read the CPU temperature ====
 
<pre>
 
<pre>
 
root@bora:~# cat /sys/devices/soc0/axi/e0004000.i2c/i2c-0/0-004f/hwmon/hwmon1/temp2_input
 
root@bora:~# cat /sys/devices/soc0/axi/e0004000.i2c/i2c-0/0-004f/hwmon/hwmon1/temp2_input
Line 28: Line 33:
 
the returned value has to be divided by 1000 for a °C temperature
 
the returned value has to be divided by 1000 for a °C temperature
  
Moreover, the SOC has an internal temperature sensor device which can be read using the following shell script:
+
==== internal SoC temperature  ====
 +
 
 +
Moreover, the SoC has an internal temperature sensor device which can be read using the following shell script:
 
<pre>
 
<pre>
 
root@bora:~# cat temp.sh
 
root@bora:~# cat temp.sh
Line 44: Line 51:
 
Cpu Temp: 46.0172
 
Cpu Temp: 46.0172
 
</pre>
 
</pre>
<section end=Temperature sensors/>
 
  
 
<section end=Body/>
 
<section end=Body/>
  
----
+
[[Category:BORA]] [[Category:BORA Xpress]]
 
 
[[Category:BORA]]
 

Latest revision as of 09:16, 26 January 2024

History
Issue Date Notes
2024/01/23 DESK-XZ7-L-1.0.1 release



Peripheral Temperature sensors[edit | edit source]

BORA and BORA Xpress SOMs has a TMP421AIDCN temperature sensor onboard.

Accessing the peripheral[edit | edit source]

The temperature information can be accessed through the sysfs interface:

read the PCB temperature[edit | edit source]

root@bora:~# cat /sys/devices/soc0/axi/e0004000.i2c/i2c-0/0-004f/hwmon/hwmon1/temp1_input

the returned value has to be divided by 1000 for a °C temperature

read the CPU temperature[edit | edit source]

root@bora:~# cat /sys/devices/soc0/axi/e0004000.i2c/i2c-0/0-004f/hwmon/hwmon1/temp2_input

the returned value has to be divided by 1000 for a °C temperature

internal SoC temperature[edit | edit source]

Moreover, the SoC has an internal temperature sensor device which can be read using the following shell script:

root@bora:~# cat temp.sh
#!/bin/sh

# Tcpu
TEMP_RAW=`cat /sys/devices/soc0/axi/f8007100.adc//iio\:device1/in_temp0_raw`
TEMP_OFFSET=`cat /sys/devices/soc0/axi/f8007100.adc//iio\:device1/in_temp0_offset`
TEMP_SCALE=`cat /sys/devices/soc0/axi/f8007100.adc//iio\:device1/in_temp0_scale`
TEMP=`awk "BEGIN {print (($TEMP_RAW+$TEMP_OFFSET)*$TEMP_SCALE)/1000}"`

echo "Cpu Temp: ${TEMP}"
root@bora:~# chmod u+x temp.sh
root@bora:~# ./temp.sh
Cpu Temp: 46.0172