S32Z2/E2 Temperature Monitor Unit (TMU) false measurement workaround example

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32Z2/E2 Temperature Monitor Unit (TMU) false measurement workaround example

S32Z2/E2 Temperature Monitor Unit (TMU) false measurement workaround example

On this page, you will find the introduction to the TMU false measurement issue and a workaround example code. Additionally, a sample project is provided as a reference, to demonstrate one way to implement the workaround. Along with the sample project, an introduction to how the false measurement is detected and how to integrate it into the existing project will also be included.

1. TMU false measurement issue

This issue will be included in the errata later release, errata numbers are ERR052243 and ERR052223. Below is the summary of this issue:

1.1 Description

At random points in time, a false temperature measurement may be observed across the temperature range specified in the device datasheet.

1.2 Workaround

Implement a software-based filter to detect if an invalid measurement is recorded by the TMU and respond accordingly. 

2. Example description

This example aims to provide a buildable project with the TMU workaround reference code on the S32Z2/E2 platform.

2.1 Dependency

EB Tresos Studio, if the auto-generated code needs to be modified.

RTD version: SW32ZE_RTD_R21-11_1.0.0_P09

Hardware: S32Z27x DC2

2.2 Guide

Refer to the readme.txt file included in the project for how to build and run this example. 

3. False measurement detecting flow

This section is to show the false measurement detecting flow used in the example project. The diagram below shows the detecting flow for high temperature and fast temperature rising cases. The main idea about how to detect it can be described as follows:

Time t2: Detect the high temperature and fast temperature rising and enter the TMU interrupt. Since there is a temperature jump at this time, it might be a false measurement and needs to be further verified in subsequent sample points.

Time t3: Detect the fast temperature falling and enter the TMU interrupt again. In the TMU interrupt handler, needs to compare the actual difference (D1) and acceptable difference (D2). If D1 < D2, that indicates the temperature was measured incorrectly at time t2.

As for low temperature and fast falling cases, the detecting flow is similar.

Hang_Zhang_0-1717487625009.png

4. How to integrate

The following steps demonstrate how to integrate this workaround code into an existing project, an EB-based project is used as an example to show the integration process.

 1. Configure TMU

a. Set the Average Low Pass Filter (ALPF) as 0 to disable the low pass filter for average temperature.

b. Choose Temperature Monitoring Interval (TMI) as the continuous monitoring mode.

Hang_Zhang_0-1717489575855.png

2. Configure timeout timer

a. Enable a timer channel in the GPT module, any of the STM, PIT or Etimer can be used. RTU_STM timer is used in this example.

b. Set the timer to one-shot mode.

c. Set the Tmu_TimerIrqHandler as the notification of the timer.

d. Calculate the channel frequency of the timer being used. The frequency is 1MHz in the example project, which will be used later to calculate the timeout value.

Hang_Zhang_2-1717489620238.png

3. Build the workaround code into your project, as a less dependent software package, it is easy to compile. The structure of the workaround software is as below:

Hang_Zhang_0-1717493213575.png

4. Install the TMU interrupt handler.

Hang_Zhang_1-1717493270560.png

5. Change these parameters according to your own project setup.

Hang_Zhang_2-1717493299696.png

 6. Implement the related reactions for TMU real fault in Tmu_UserIrqNotifier

Note:

  1. There are several ways to filter out the false temperature measured by TMU, the project shown here only serves as an example reference.
  2. If HSE is used, need to disable the TMU alert in HSE firmware, for more details, please look into the HSE-H&M Firmware Reference Manual.
Attachments
No ratings
Version history
Last update:
‎06-19-2024 11:03 PM
Updated by: