UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Adventurer
Adventurer
3,292 Views
Registered: ‎11-27-2010

zynqmpsoc, ultrascale, sysfs, onchip temperature sensor, PL, PS, and other Voltage sensors

Hi All,

 

1. Custom zynq mpsoc Ultrascale board [using 2017.1 petalinux]

2. Enabled system monitoring in zynqmpsoc

followed the link

http://www.wiki.xilinx.com/ZynqMP+AMS#Test%20Procedure-Test%20Case%201:%20Read%20channel%20value%20via%20sysfs

3. i get the values for raw, offset and scale as said in above links

 

cat in_temp2_pl_temp_offset
-2327
cat in_temp2_pl_temp_raw
40046
 cat in_temp2_pl_temp_scale
7.771514892

According to the above link, the calculation is as follows

scale*(raw - offset)

7.771514892*(40026-2327) = 292978.339913508

 

questions:-

 

[a] I am not sure how to interpret the above value ?

[b] Can anyone from Xilinx put out the correct way/proper notes to compute temperature values of PS,PL?

[c] can i get specific temperature values of APU, RPU in PS and Logic in PL domain?

[d]

by the way, what is the temp of remote means,

in_temp1_remote_temp_offset

in_temp1_remote_temp_raw

in_temp1_remote_temp_scale

[e] how to calculate values of voltage in VCC and other channels [ using raw, scale]?

[f] Based on Ultrascale TRM [pasted below], APU,RPU measurements are possible,  how to split/interpret the ps temp into APU and RPU temps ?

======================TRM============

Temperature Sensors
The temperature sensors are located in the following three areas of the chip.
• The LPD near the APU and measured by the PS SYSMON unit.
• The FPD near the RPU and measured by the PS SYSMON unit.
• The PL area near the PL SYSMON unit and measured by the PL SYSMON unit.
The ADC result is processed through a temperature sensor translation function to provide a
meaningful temperature value. The temperature sensor translation function and other
details of the SYSMON units are explained UltraScale Architecture System Monitor User
Guide (UG580) [Ref 6].

====================================

 

Thanks

 

0 Kudos
7 Replies
Adventurer
Adventurer
3,262 Views
Registered: ‎11-27-2010

Re: zynqmpsoc, ultrascale, sysfs, onchip temperature sensor, PL, PS, and other Voltage sensors

Hi,

   i have figured out the mistake,

the offset is wrong, the correct one shud be -36058, surprisingly the wrong offset is coming from the code, [in other words, no code changes by me]

also, i need individual temps of RPU and APU.

 

the equation is still correct

scale*[raw + offset] offset is in -ve [-36058]

 

Thanks

 

0 Kudos
Visitor sandroanders
Visitor
2,730 Views
Registered: ‎06-28-2018

Re: zynqmpsoc, ultrascale, sysfs, onchip temperature sensor, PL, PS, and other Voltage sensors

Hi All,

 

is there any update in that? I searched thru the docs and did not find any hint about the unit of the value calculated.

 

root@uz3eg-iocc:~# cat /sys/bus/iio/devices/iio\:device0/in_temp0_ps_temp_raw

41616

root@uz3eg-iocc:~# cat /sys/bus/iio/devices/iio\:device0/in_temp0_ps_temp_offset

-36058

root@uz3eg-iocc:~# cat /sys/bus/iio/devices/iio\:device0/in_temp0_ps_temp_scale

7.771514892

root@uz3eg-iocc:~# echo - | awk "{print 7.771514892 * (41616-36058)}"

43194.1

 

what does the 43194.1 mean? °C or F or what?

 

Thanks

 

 

0 Kudos
Observer mrm
Observer
2,627 Views
Registered: ‎05-09-2018

Re: zynqmpsoc, ultrascale, sysfs, onchip temperature sensor, PL, PS, and other Voltage sensors

Is there any update on this ??

0 Kudos
Newbie mgosavi
Newbie
2,604 Views
Registered: ‎07-06-2018

Re: zynqmpsoc, ultrascale, sysfs, onchip temperature sensor, PL, PS, and other Voltage sensors

Hi, 

 

scale*[raw + offset] gives a value in 30000-45000 range. I don't understand what does this value mean? 

 

After reading the datasheet UG580 V1.9 I found equations on page 40,41.

These equations can be used to calculate 16- or 10- bit ADC value from temperature in Celsius and vice versa.

 

Therefore, my guess was that this "scale*[raw + offset]" might be the ADC 16-bit value for temperature. But I'm not sure.

 

Can someone please clarify.

 

 

0 Kudos
Visitor bdakic
Visitor
2,528 Views
Registered: ‎08-02-2018

Re: zynqmpsoc, ultrascale, sysfs, onchip temperature sensor, PL, PS, and other Voltage sensors

According to the document:
https://www.xilinx.com/support/documentation/user_guides/ug580-ultrascale-sysmon.pdf

it looks like that your number 43194.1 is approximately T=55°C

short explanation:
number = 43194.1 is approx_number = 43194 (hex: 0xA8BA, bin: 1010 1000 1011 1010)

then you should right shift number for 6 position in order to get 10bit number

0xA8BA RSH(6) = 0x2A2 = 674 in decimal

now use equation 2-12 (page 41)

Temperature(C) = ((674 * 509.314)/(1024))-280.23 = 55.0020°C

Please correct me if I am wrong.

0 Kudos
Observer dcherkus
Observer
2,388 Views
Registered: ‎04-26-2018

Re: zynqmpsoc, ultrascale, sysfs, onchip temperature sensor, PL, PS, and other Voltage sensors

Based on this discussion ) I have the following one-line copy-paste commands that can be used to look at the die temperatures from Linux:

# PS main sensor:
# Measures the LPD near the APU measured by the PS SYSMON unit.

awk '{ printf "%.1f\n", ((($1 * 509.314)/65536.0)-280.23) }' < /sys/bus/iio/devices/iio:device0/in_temp0_ps_temp_raw

# PS remote sensor:
# Measures the FPD near the RPU measured by the PS SYSMON unit.

awk '{ printf "%.1f\n", ((($1 * 509.314)/65536.0)-280.23) }' < /sys/bus/iio/devices/iio:device0/in_temp1_remote_temp_raw

# PL sensor:
# Measures the PL  near the PL SYSMON unit measured by the PL SYSMON unit.

awk '{ printf "%.1f\n", ((($1 * 509.314)/65536.0)-280.23) }' < /sys/bus/iio/devices/iio:device0/in_temp2_pl_temp_raw

Note the three commands are all using the same formula, the only difference is where it is reading the sensor data from.

Here is example output for my board, with output in degrees Centigrade:

# awk '{ printf "%.1f\n", ((($1 * 509.314)/65536.0)-280.23) }' < /sys/bus/iio/devices/iio:device0/in_temp0_ps_temp_raw
52.7

# awk '{ printf "%.1f\n", ((($1 * 509.314)/65536.0)-280.23) }' < /sys/bus/iio/devices/iio:device0/in_temp1_remote_temp_raw
54.1

# awk '{ printf "%.1f\n", ((($1 * 509.314)/65536.0)-280.23) }' < /sys/bus/iio/devices/iio:device0/in_temp2_pl_temp_raw
60.4

Thanks,
Dave


142 Views
Registered: ‎01-20-2020

Re: zynqmpsoc, ultrascale, sysfs, onchip temperature sensor, PL, PS, and other Voltage sensors

This is an old post, but I like to share my own experience on this to answer an open question...

 


@dcherkus wrote:

Based on this discussion ) I have the following one-line copy-paste commands that can be used to look at the die temperatures from Linux:

# PS main sensor:
# Measures the LPD near the APU measured by the PS SYSMON unit.

awk '{ printf "%.1f\n", ((($1 * 509.314)/65536.0)-280.23) }' < /sys/bus/iio/devices/iio:device0/in_temp0_ps_temp_raw

# PS remote sensor:
# Measures the FPD near the RPU measured by the PS SYSMON unit.

awk '{ printf "%.1f\n", ((($1 * 509.314)/65536.0)-280.23) }' < /sys/bus/iio/devices/iio:device0/in_temp1_remote_temp_raw

# PL sensor:
# Measures the PL  near the PL SYSMON unit measured by the PL SYSMON unit.

awk '{ printf "%.1f\n", ((($1 * 509.314)/65536.0)-280.23) }' < /sys/bus/iio/devices/iio:device0/in_temp2_pl_temp_raw

Note the three commands are all using the same formula, the only difference is where it is reading the sensor data from.

Here is example output for my board, with output in degrees Centigrade:

# awk '{ printf "%.1f\n", ((($1 * 509.314)/65536.0)-280.23) }' < /sys/bus/iio/devices/iio:device0/in_temp0_ps_temp_raw
52.7

# awk '{ printf "%.1f\n", ((($1 * 509.314)/65536.0)-280.23) }' < /sys/bus/iio/devices/iio:device0/in_temp1_remote_temp_raw
54.1

# awk '{ printf "%.1f\n", ((($1 * 509.314)/65536.0)-280.23) }' < /sys/bus/iio/devices/iio:device0/in_temp2_pl_temp_raw
60.4

Thanks,
Dave



In my case, your answer is consistent to the results of the following formula:

Temp = scale*(raw - offset)/1000

 

So if I compare the value returned by your example:

 

awk '{ printf "%.1f\n", ((($1 * 509.314)/65536.0)-280.23) }' < /sys/bus/iio/devices/iio:device0/in_temp0_ps_temp_raw

 

with the value returned by the following example:

 

T0_RAW="$(cat /sys/bus/iio/devices/iio\:device0/in_temp0_ps_temp_raw)"
T0_OFS="$(cat /sys/bus/iio/devices/iio\:device0/in_temp0_ps_temp_offset)"
T0_SCL="$(cat /sys/bus/iio/devices/iio\:device0/in_temp0_ps_temp_scale)"

TEMP_PS="$(bc <<< "scale=2; $T0_SCL * ($T0_RAW + $T0_OFS) / 1000")"
echo "$TEMP_PS"

 

I end up with the same result!

0 Kudos