This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[FAQ] SK-AM62: How do I measure power and temperature on the AM62A and the AM62X?

Part Number: SK-AM62

I want to understand power and temperature relationships on the AM62A and/or the AM62X. How do I do this with the starter kit (SK) EVM?

  • Regarding power, the starter kit EVMs for the AM62x and AM62A contain on-board current sensors to measure power usage on all of the voltage rails powering the SoC. These current sensors are INA231 ICs, and can be configured and read over an I2C bus.

    There are 6 voltage rails into the SoC, and each of these is read by an INA using voltage measurements.:

    1. VDD Core
    2. VDDR Core
    3. digital VDD 3.3V
    4. digital VDD 1.8 V
    5. analog VDD 1.8V
    6. VDD DDR (or LPDDR).

    Power is measured by reading a voltage across a small ( <<1 Ohm ) shunt resistor and the voltage of the bus itself (low side of the resistor). The shunt voltage is a proxy for current, and is calculated by knowing the value of the shunt resistor precisely. We use a high precision resistor (1%).

    Since these INA’s are accessible over an I2C bus, they can be read directly from the SoC for measuring power during the active state. Please find the two python scripts below for the am62x and am62a, respectively. The only difference is in the I2C addresses and shunt resistor values.

    Here are two python scripts for measuring power on the AM62A and AM62X starter kit EVMs:

    AM62A:  /cfs-file/__key/communityserver-discussions-components-files/791/read_5F00_power_5F00_am62a.py

    AM62X: /cfs-file/__key/communityserver-components-multipleuploadfilemanager/3fbe1178_2D00_ad90_2D00_4e4a_2D00_b6ff_2D00_b18b64c3e929-360457-complete/read_5F00_power_5F00_am62x.py

    To run these, a network connection is necessary so that a python package can be installed via pip.

    python3 -m ensurepip
    pip3 install smbus2

    Note that network settings and certificates may cause pip3 to throw errors. Explicitly trusting the host sites should fix this. It may be necessary to add a proxy with the --proxy tag if the device is behind a firewall e.g. on a corporate network.

    pip3 --trusted-host pypi.org --trusted-host pypi.python.org --trusted-host files.pythonhosted.org  install smbus2

    When running AM62A in idle operation and with a high-load application, we can see a change in power usage. A heavy load application is run with the following command, which runs 4 streams of video with deep learning based analysis. Notice the increase in VDD core and LPDDR

    /opt/edgeai-gst-apps/apps_python/app_edgeai.py /opt/edgeai-gst-apps/configs/multi_input_multi_infer.yaml

  • Regarding temperature, there are 3 Voltage and Thermal Monitors located around hotspots on the AM62A die. Note that since the sensors are on the SoC, the steps for measuring temperature are not dependent on using the AM62A SK EVM.

    • Temp sensor 0: DDR
    • Temp sensor 1: A53
    • Temp sensor 2: C7x

    The dtsi file containing the temperature threshold configuration for AM62A can be found in:

    <ti-processor-sdk-linux-path>/board-support/linux-<version> /arch/arm64/boot/dts/ti/k3-am62a-thermal.dtsi

    The temperature parameter is threshold for the trip type. This critical trip temperature is set to 105°C by default. Any cooling action initiated by the framework is maintained until the temperature falls below (trip temperature – hysteresis). This potentially prevents a situation where the trip gets constantly triggered soon after the cooling action is removed.

     

    More documentation on thermal zones and parameters can be found in:

    <ti-processor-sdk-linux-sdk-path>/board-support/linux-<version> /Documentation/devicetree/bindings/thermal/thermal-zones.yaml

     

    To test cooling and shutdown, use the following steps:

    • Go to linux-<kernel-version>/arch/arm64/boot/dts/ti/k3-am62a-thermal.dtsi and change the trip temperature for main0_thermal to the desired temperature
    • Follow instructions on CPULOADGEN Github to build and install the cpuloadgen tool which is used to generate load on the CPU cores
    • Increase SoC temperature by increasing the CPU load to the desired % using cpuloadgen
      • This will raise the temperature above the trip point and will result in CPU shutdown
    • Monitor the temperature of the device using the following command:
      • cat /sys/class/thermal/thermal_zone*/temp

    The device is expected to shut down when the critical trip temperature is reached.