VIM3 internal sensors

Does VIM3 have internal voltage temperature sensors that I can query?

For example in raspberry pi 3b I can use vcgencmd to get voltage & temperature:

vcgencmd measure_volts core
volt=1.2000V
vcgencmd measure_temp         
temp=58.0'C

Looking for a similiar thing on my khadas vim 3 board.

Thanks

The voltage doesnā€™t need to be measured as values are determined by device-tree and drivers and are essentially fixed (no overclocking possible). VIM3 also has thermal zones support and sensors show the temp readings for CPU and RAM temps. Where to read values from depends on the kernel version youā€™re using?

1 Like

Thanks for the response. Im on ubuntu server emmc version. I tried installing lm_sensors, but didnā€™t get any success with that.

This is what I get:

sensors-detect

# sensors-detect revision 6284 (2015-05-31 14:00:33 +0200)
# Kernel: 4.9.206 aarch64
# Processor:  (//)

This program will help you determine which kernel modules you need
to load to use lm_sensors most effectively. It is generally safe
and recommended to accept the default answers to all questions,
unless you know what you're doing.

Some south bridges, CPUs or memory controllers contain embedded sensors.
Do you want to scan for them? This is totally safe. (YES/no): y
modprobe: FATAL: Module cpuid not found in directory /lib/modules/4.9.206
Failed to load module cpuid.
Silicon Integrated Systems SIS5595...                       No
VIA VT82C686 Integrated Sensors...                          No
VIA VT8231 Integrated Sensors...                            No
AMD K8 thermal sensors...                                   No
AMD Family 10h thermal sensors...                           No
AMD Family 11h thermal sensors...                           No
AMD Family 12h and 14h thermal sensors...                   No
AMD Family 15h thermal sensors...                           No
AMD Family 16h thermal sensors...                           No
AMD Family 15h power sensors...                             No
AMD Family 16h power sensors...                             No
Intel digital thermal sensor...                             No
Intel AMB FB-DIMM thermal sensor...                         No
Intel 5500/5520/X58 thermal sensor...                       No
VIA C7 thermal sensor...                                    No
VIA Nano thermal sensor...                                  No

Lastly, we can probe the I2C/SMBus adapters for connected hardware
monitoring devices. This is the most risky part, and while it works
reasonably well on most systems, it has been reported to cause trouble
on some systems.
Do you want to probe the I2C/SMBus adapters now? (YES/no): y
Sorry, no supported PCI bus adapters found.

Next adapter: Meson I2C adapter (i2c-3)
Do you want to scan it? (YES/no/selectively): y

Next adapter: Meson I2C adapter (i2c-4)
Do you want to scan it? (YES/no/selectively): Yes
Client found at address 0x18
Handled by driver `khadas-mcu' (built-in), chip type `khadas-mcu'
    (note: this is probably NOT a sensor chip!)
Client found at address 0x51
Handled by driver `rtc-hym8563' (built-in), chip type `hym8563'
    (note: this is probably NOT a sensor chip!)

Sorry, no sensors were detected.
Either your system has no sensors, or they are not supported, or
they are connected to an I2C or SMBus adapter that is not
supported. If you find out what chips are on your board, check
http://www.lm-sensors.org/wiki/Devices for driver status.

sensors

No sensors found!
Make sure you loaded all the kernel drivers you need.
Try sensors-detect to find out which these are.

4.9 = legacy BSP kenel. Some ā€œfind / -name *thermal*ā€ should turn up the relevant bits of /proc filesystem where the nodes you need to read are probably located. My personal knowledge is oriented towards more modern kernels, so sorry I canā€™t be more specific.

Thanks, I will try newer kernel once my SD cards arrive, as this kernel is the only one supported with EMMC.

Looks like there are some thermal devices:

/sys/devices/virtual/thermal
/sys/devices/virtual/thermal/thermal_zone1
/sys/devices/virtual/thermal/thermal_zone0
find / -name *thermal*
/sys/kernel/debug/tracing/events/thermal_power_allocator
/sys/kernel/debug/tracing/events/thermal_power_allocator/thermal_power_allocator
/sys/kernel/debug/tracing/events/thermal_power_allocator/thermal_power_allocator_pid
/sys/kernel/debug/tracing/events/thermal
/sys/kernel/debug/tracing/events/thermal/thermal_temperature
/sys/kernel/debug/tracing/events/thermal/thermal_zone_trip
/sys/kernel/debug/tracing/events/thermal/thermal_power_cpu_get_power
/sys/kernel/debug/tracing/events/thermal/thermal_power_cpu_limit
/sys/kernel/debug/tracing/events/thermal/thermal_power_devfreq_get_power
/sys/kernel/debug/tracing/events/thermal/thermal_power_devfreq_limit
/sys/devices/virtual/thermal
/sys/devices/virtual/thermal/thermal_zone1
/sys/devices/virtual/thermal/thermal_zone0
/sys/class/thermal
/sys/class/thermal/thermal_zone1
/sys/class/thermal/thermal_zone0
/sys/firmware/devicetree/base/__symbols__/ddr_thermal
/sys/firmware/devicetree/base/__symbols__/soc_thermal
/sys/firmware/devicetree/base/d_tsensor@ff800228/#thermal-sensor-cells
/sys/firmware/devicetree/base/thermal-zones
/sys/firmware/devicetree/base/thermal-zones/ddr_thermal
/sys/firmware/devicetree/base/thermal-zones/ddr_thermal/thermal-sensors
/sys/firmware/devicetree/base/thermal-zones/soc_thermal
/sys/firmware/devicetree/base/thermal-zones/soc_thermal/thermal-sensors
/sys/firmware/devicetree/base/p_tsensor@ff634594/#thermal-sensor-cells
/sys/bus/platform/drivers/aml-thermal
/run/udev/data/+thermal:cooling_device4
/run/udev/data/+thermal:cooling_device5
/run/udev/data/+thermal:cooling_device0
/run/udev/data/+thermal:cooling_device1
/run/udev/data/+thermal:thermal_zone1
/run/udev/data/+thermal:thermal_zone0
/run/udev/data/+thermal:cooling_device3
/run/udev/data/+thermal:cooling_device2
/run/udev/data/+drivers:platform:aml-thermal
find: ā€˜/proc/6286/task/6286/netā€™: Invalid argument
find: ā€˜/proc/6286/netā€™: Invalid argument
/usr/share/initramfs-tools/hooks/thermal
/usr/src/linux-headers-4.9.206/include/linux/amlogic/aml_thermal_hw.h
/usr/src/linux-headers-4.9.206/include/linux/platform_data/db8500_thermal.h
/usr/src/linux-headers-4.9.206/include/linux/thermal.h
/usr/src/linux-headers-4.9.206/include/uapi/linux/thermal.h
/usr/src/linux-headers-4.9.206/include/dt-bindings/thermal
/usr/src/linux-headers-4.9.206/include/dt-bindings/thermal/thermal_exynos.h
/usr/src/linux-headers-4.9.206/include/dt-bindings/thermal/thermal.h
/usr/src/linux-headers-4.9.206/include/config/cpu/thermal.h
/usr/src/linux-headers-4.9.206/include/config/devfreq/thermal.h
/usr/src/linux-headers-4.9.206/include/config/amlogic/cpucore/thermal.h
/usr/src/linux-headers-4.9.206/include/config/amlogic/gpu/thermal.h
/usr/src/linux-headers-4.9.206/include/config/amlogic/gpucore/thermal.h
/usr/src/linux-headers-4.9.206/include/config/thermal
/usr/src/linux-headers-4.9.206/include/config/thermal.h
/usr/src/linux-headers-4.9.206/include/trace/events/thermal_power_allocator.h
/usr/src/linux-headers-4.9.206/include/trace/events/thermal.h
/usr/src/linux-headers-4.9.206/tools/thermal
/usr/src/linux-headers-4.9.206/drivers/amlogic/thermal
/usr/src/linux-headers-4.9.206/drivers/thermal
/usr/src/linux-headers-4.9.206/drivers/thermal/int340x_thermal
/usr/src/linux-headers-4.9.206/drivers/thermal/ti-soc-thermal
/usr/include/linux/thermal.h

/sys/firmware/devicetree/base/thermal-zones/ddr_thermal
/sys/firmware/devicetree/base/thermal-zones/soc_thermal

^ should have something readable, probably. Also, VIM3 has mainline u-boot support since the 2020.01 release so thereā€™s nothing to stop you putting something modern on the eMMC storage.

I tried fenix https://github.com/khadas/fenix but it doesnā€™t allow compiling newer versions to EMMC for some reason. Iā€™ll try hacking around the shell script, maybe it will run :wink:

khadas@258cddb06e72:~/fenix$ source env/setenv.sh

Choose Khadas board:
1. Edge
2. VIM1
3. VIM2
4. VIM3
5. VIM3L

Which board would you like? [2] 3

Choose uboot version:
1. uboot-2015.01
2. uboot-mainline

Which uboot version would you like? [1] 2

Choose linux version:
1. linux-mainline

Which linux version would you like? [1] 1

Choose distribution:
1. Ubuntu
2. Debian

Which distribution would you like? [1] 1

Choose Ubuntu release:
1. bionic
2. focal

Which Ubuntu release would you like? [1] 1

Choose Ubuntu type:
1. server
2. xfce
3. lxde

Which Ubuntu type would you like? [1] 1

Set architecture to 'arm64' by default.

Choose install type:
1. SD-USB

FYI Iā€™ve tried the latest Linux image which is available VIM3_Ubuntu-server-bionic_Linux-5.5-rc2_arm64_SD-USB_V0.8.2-20200103.7z and lm-sensors still donā€™t detect the sensors.

The weird part if I do:

cat /sys/devices/virtual/thermal/thermal_zone*/temp
57700
59200

I can see some numbers :slight_smile: