Hi,
I think there are two different timing concepts here that are easy to mix up: the INA3221 conversion/update rate and the tegrastats reporting interval.
For the units, according to the NVIDIA tegrastats documentation:
the power rails are reported as:
VDD_X current_mW/average_mW
So both values are in mW. The first one is the current power value and the second one is the average power value.
Regarding the INA3221 sampling time, the Linux driver documentation explains that the effective update interval depends on the number of enabled channels, averaging samples, bus conversion time and shunt conversion time:
The formula used there is basically:
update_interval = channels * samples * (bus_conversion_time + shunt_conversion_time)
The upstream Linux driver supports conversion times from 140 us up to 8244 us and averaging from 1 to 1024 samples:
The default config in the upstream driver is 0x7127, which corresponds to 1.1 ms for bus voltage and 1.1 ms for shunt voltage, with no averaging.
If all 3 channels are enabled, that would give around:
3 * (1.1 ms + 1.1 ms) = 6.6 ms
for one full measurement cycle.
That said, I would not assume Jetson is always using exactly that configuration. It would be better to check the actual runtime settings under /sys/class/hwmon/.
For example:
for h in /sys/class/hwmon/hwmon*; do
if [ "$(cat "$h/name" 2>/dev/null)" = "ina3221" ]; then
echo "$h"
cat "$h/update_interval" 2>/dev/null
cat "$h/samples" 2>/dev/null
fi
done
One important thing is that tegrastats --interval 1000 does not mean the INA3221 is sampling every 1000 ms. That option only changes how often tegrastats prints/reports the values.
For example:
sudo tegrastats --interval 1000
means one report every 1000 ms, while the INA3221 can still be doing conversions much faster in the background.
Also, the INA3221 itself measures bus voltage and shunt voltage. Current is calculated from the shunt voltage and shunt resistance, and power is calculated from voltage and current in software. This is also described in the Linux INA3221 driver documentation:
The only part I am not completely sure about is how the second average value from tegrastats is implemented internally on the current Jetson Linux release.
NVIDIA has mentioned in previous forum threads that the average corresponds to measurements over the tegrastats interval, but I don’t think it is clearly documented whether tegrastats accumulates every INA3221 conversion or polls the hwmon interface at some other internal rate.
So if the question is specifically about the exact number of hardware samples included in something like a 1000 ms tegrastats average, I think NVIDIA would need to confirm the internal implementation.
David Badilla
Embedded SW Engineer at RidgeRun
Contact us: support@ridgerun.com
Developers wiki: https://developer.ridgerun.com
Website: www.ridgerun.com