Is this a HAL IIC bug?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-01-12 7:43 PM
Hi there,
I drove 4 SHT4x by STM32G473VE and used the HAL_I2C_Master_Transmit() and HAL_I2C_Master_Receive() to write and read the sensors.
Normally, everything is well.
However, if I
- unplug the sensor;
- replug the sensor again;(Not the sensor maybe can NOT work normally)
- reset the MCU;
the program will probably run into the following dead loop:
I don't know why this happened, and how I can recover from this error state.
Thank you!
- Labels:
-
Bug-report
-
STM32G4 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-01-13 2:36 AM
Hello @Junde
Have you tried checking the device with the HAL_I2C_IsDeviceReady() API after unplugging and replugging it?
Could you provide the data transmission trace using the logic analyzer?
Thanks
Omar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2025-01-13 3:08 AM
Previous discussion on recovering from problems on the I2C bus:
