Skip to main content
markpow
Senior
January 24, 2025
Solved

I2C HAL Size Management error - STM32WL + Si7021

  • January 24, 2025
  • 2 replies
  • 2597 views

What does this error mean for the I2C interface? I have it on the connection between the LORA E5 Mini and the SI7021 sensor.


The debugger stops here:

markpow_0-1737749096645.png

Exactly at his method call:

 

 

/* Wait until TXIS flag is set */
 if (I2C_WaitOnTXISFlagUntilTimeout(hi2c, Timeout, Tickstart) != HAL_OK)
 {
 return HAL_ERROR;
 }

 

 

 

 As you can see, the I2C is in the HAL_I2C_STATE_READY.

I have four items of the same sensor tested with this LORA device, and all behave the same, so I think a hardware error should be excluded.

Best answer by TDK

ErrorCode=32 indicates HAL_I2C_ERROR_TIMEOUT.

Devaddress=0 suggests an invalid slave address.

Ensure HAL_I2C_IsDeviceReady returns HAL_OK before using any other HAL_I2C_* command.

2 replies

TDK
TDKBest answer
Super User
January 24, 2025

ErrorCode=32 indicates HAL_I2C_ERROR_TIMEOUT.

Devaddress=0 suggests an invalid slave address.

Ensure HAL_I2C_IsDeviceReady returns HAL_OK before using any other HAL_I2C_* command.

"If you feel a post has answered your question, please click ""Accept as Solution""."
markpow
markpowAuthor
Senior
January 24, 2025

I2C doesn't see device:

markpow_0-1737754546834.png

According to the MX configuration, I2C3 has the following GPIO:

markpow_1-1737754674519.png

According to the WIO Lora E5 Mini wiki, I see that these pins are
PCO => RX1
PB14 => MISO

markpow_2-1737754848155.png

markpow_3-1737755039299.png

The Green LED on the SI7021 fires.

I checked the connections between LORA and this sensor many times, and all look good.

markpow_4-1737755134753.png

The ST-LINK V2 is attached to the LORA device too.

Karl Yamashita
Principal
January 24, 2025

That board is clearly labeled with SCL and SDA which is I2C2. So it's PA15 and PB15 that needs to be used.

By default when enabling I2C2, it chooses PA12 for SCL. So you override it and choose PB15 for SCL.

If a reply has proven helpful, click on Accept as Solution so that it'll show at top of the post.CAN Jammer an open source CAN bus hacking toolCANableV3 Open Source
TDK
Super User
January 24, 2025

Do you have external pullups on the SDA/SCL lines?

"If you feel a post has answered your question, please click ""Accept as Solution""."