Thermal Management Unit driver
I am pleased to announce that starting with UEFI Release Version 1.4, support for CPU temperature monitoring under Windows will be included. There will be an TMU (Thermal Management Unit) driver for Windows IoT, supporting the i.MX93 in addition to the already supported i.MX8MQ and i.MX8MP. The driver allows applications and the Windows thermal stack to read the current CPU die temperature directly from the SoC’s on-chip temperature sensor.
The thermal stack on Windows IoT for i.MX consists of the following component:
- TMU Sensor Driver (
imxtmu.sys): Talks to the hardware TMU block, performs the SoC-specific initialization and exposes a device interface (GUID_DEVINTERFACE_TMU,{472D908F-D919-4821-A48E-A02A16D223EA}) that returns the current temperature in tenths of Kelvin.
Installation
The driver package contains a signed imxtmu.inf & imxtmu.sys. Install it either via Device Manager or with pnputil:
After installation, the device appears under System devices → i.MX Thermal Sensor Deivce in Device Manager.
Security note
By default the device’s ACL only permits Built-in Administrators (BA) and Local System (SY) to open the device:
Therefore any user-mode tool that wants to read the temperature must run elevated (Run as Administrator).
Reading the temperature from user mode
Applications open the device interface and issue IOCTL_THERMAL_READ_TEMPERATURE with a THERMAL_WAIT_READ input buffer. The driver returns a single ULONG containing the temperature in tenths of Kelvin:
The IOCTL code resolves to 0x00294090 (CTL_CODE(FILE_DEVICE_BATTERY, 0x24, METHOD_BUFFERED, FILE_READ_ACCESS)).
Reference application: thermalutil & thermalutilUI
To make integration as easy as possible, the release also includes a small reference application with full source code:
thermalutil.exe: minimal command-line tool (existing) that prints the current temperature once. This tool is written in C++.thermalutilUI.exe: new WinForms application that shows the temperature continuously with an adjustable polling interval. Useful for quick verification during board bring-up and as a copy-and-paste reference for your own .NET applications.
The UI application is written in C# / .NET 7 (WinForms, ARM64) and ships as a framework-dependent build. On the target board, install the Microsoft Windows Desktop Runtime 7.0 (ARM64) once (≈ 30 MB, from https://dotnet.microsoft.com/download/dotnet/7.0).
Reusable in your own application
The relevant code is encapsulated in a single C# class, ThermalDevice.cs, that you can drop into your own project. It contains:
- Lookup of the TMU device interface via
CM_Get_Device_Interface_List CreateFileon the resulting interface path (with read-only fallback)DeviceIoControlwith IOCTL_THERMAL_READ_TEMPERATURE- Conversion to °C
Typical usage:
The class has no UI dependencies and works equally well in WinForms, WPF, console or service applications, as long as the process runs elevated (or the driver’s ACL has been relaxed).
Build & deploy
Copy the resulting bin\Release\net7.0-windows\win-arm64\publish\ folder to the board, install the Desktop Runtime once, then run thermalutilUI.exe as Administrator.
I hope this driver and the sample application help you integrate temperature monitoring into your Windows IoT solutions. If you have questions or feedback, please feel free to share.