cancel
Showing results for 
Search instead for 
Did you mean: 

Why am I getting "nan" from my temperature sensor HTS221 from STM32CubeIDE console?

FIoT.1
Associate II

Hi,

I am exploring two newly purchased units of B-L475E-IOT01A boards with STM32L475VG MCU interfaces used by each sensors. Currently using STM32CubeIDE software for my beginner's coding mini assignment.

The first unit of B-L475E-IOT01A board is returning the temperature reading well to the STM32CubeIDE console panel. However, on the other board with the same code, the temperature sensor reading on the console is "nan". (both console reading captures below)

Is my other B-L475E-IOT01A board temperature sensor HTS221 faulty?

I have checked both B-L475E-IOT01A boards jumpers are identical.

Please advice what could be wrong for the board sensor and alternate methods to verify its temp sensor functionality for Board No.1 ? :sad_but_relieved_face:

Board No.1 - console panel capture

0693W000004IKMTQA4.jpg

Board No.2 - console panel capture

0693W000004IKMJQA4.jpg

6 REPLIES 6
Mike_ST
ST Employee

Probably means "not a number", a value that printf can't display.

Check variable with debugger.

FIoT.1
Associate II

Hi, the same code work well and return number on the other board.

0693W000004IKMJQA4.jpg

Hi @FIoT.1​ ,

Is the HTS221 sensor the only component that looks not working on your Board n.1?

-Eleon

FIoT.1
Associate II

Hi @Eleon BORLINI​ ,

Just tested both boards on the additional accelerometer sensor component. On Board no. 1, it is returning only 0 for x , y , z acceleration values (after orientation changes) to the STM32CubeIDE console panel. However, on my other Board no. 2 with the same code, the accelerometer sensor reading on the console is reading well for the acceleration values. (both console reading captures below). Please advice. :hushed_face:

Board No.1 - console panel capture

0693W000004IPT5QAO.jpg

Board No.2 - console panel capture

0693W000004IPWiQAO.jpg

Eleon BORLINI
ST Employee

Hi @FIoT.1​ ,

since both accelerometer and HTS221 sensors are failing, I don't think this is an issue related to the sensors... from the schematic, I see they share the INTERNAL-I2C2_SDA and the INTERNAL-I2C2_SCL I2C lines... can you please check if the MP34DT01-M microphones are working well?

Thanks,

-Eleon

Eleon BORLINI
ST Employee

Hi @FIoT.1​ ,

any updates about your issue?

-Eleon