cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot interface SHT25 to STM32F4239I-DISC1 board BY I2C3.

Madhusudan
Associate II

Hi there,

I have made the touch project by touchgfx and initiated the I2C3 by cubemx.

I am interfacing the SHT25 with STM32F4239I-DISC1 board BY I2C3. PA8 AND PC9.

I am using the command HAL_I2C_Master_Transmit and HAL_I2C_Master_Receive. but I cannot get the values from the protocol. Any help is required.

10 REPLIES 10
S.Ma
Principal

Use a sw bitbang first to get the fundation working. Check if the sensirion device has i2c protocol limitation in the past, they even provide drivers as workaround. Use low bitrate if there is a builtin mcu to convert analog sensor into a digital one. That is the case for sht30 for example.

Madhusudan
Associate II

do you have any example for i2c3? because when i generate the code the i2c is configuring for memory interface only.

Madhusudan
Associate II

or can i go for baremetal programming?

Andrew Neil
Evangelist III

@Madhusudan​ "I cannot get the values from the protocol. "

Give more details:

  • What, exactly, did you try?
  • Do you have correct pullups?
  • What debugging have you done to find what's wrong?
  • Are you getting any error status returned?
  • Can you do anything basic - eg, does the chip have an ID you can read?
  • Are you sure you have the correct I2C address, and that you are presenting it correctly to the library?
  • Have you used an oscilloscope to check what's happening on the actual wires?
  • Have you checked that there's no conflict with other things on the Disco board?
  • Have you tried a simple project with just the sensor - without TouchGfx?

Madhusudan
Associate II

there is no frequency on SDA and SCL

Madhusudan
Associate II

Yes address is correct, both pins are pullups and there si no conflict in Disco board they are free pins

So that obviously explains why you can't get anything from the sensor!

Now you need to find out why there's no activity - most likely your STM32 configuration, or your external hardware - or both.

Are the lines stuck high or low?

Where, exactly, did you check?

Try checking directly at the processor pins with the sensor disconnected: if there's activity without the sensor connected, but that stops when it is connected - think what that tells you ...

These questions remain:

  • What, exactly, did you try?
  • Do you have correct pullups?
  • What debugging have you done to find what's wrong?
  • Are you getting any error status returned?
  • Have you tried a simple project with just the sensor - without TouchGfx?

Plus:

  • Can you get it to work on any other IC2 ?

@Madhusudan​ "both pins are pullups"

What pullups are you using, exactly?

@Madhusudan​ "address is correct"

How have you verified that?

Remember that it's not just a matter of knowing what the address is - you have to make sure that you present it to the libraries in the correct form:

https://www.avrfreaks.net/comment/1872781#comment-1872781