Skip to main content
FIoT.1
Associate
October 1, 2020
Question

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

  • October 1, 2020
  • 5 replies
  • 3607 views

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

This topic has been closed for replies.

5 replies

Mike_ST
Technical Moderator
October 1, 2020

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

Check variable with debugger.

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. 
FIoT.1
FIoT.1Author
Associate
October 1, 2020

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

0693W000004IKMJQA4.jpg

Eleon BORLINI
ST Employee
October 1, 2020

Hi @FIoT.1​ ,

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

-Eleon

FIoT.1
FIoT.1Author
Associate
October 1, 2020

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
October 2, 2020

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
October 9, 2020

Hi @FIoT.1​ ,

any updates about your issue?

-Eleon