I2C timing issue in i2c_master.h. Legacy version works correctly. (IDFGH-13191) #14129
Description
Answers checklist.
- I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
- I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
- I have searched the issue tracker for a similar issue and not found a similar issue.
IDF version.
v5.2.2
Espressif SoC revision.
ESP32-C6FH4 (QFN32) (revision v0.0)
Operating System used.
macOS
How did you build your project?
Command line with idf.py
If you are using Windows, please specify command line type.
None
Development Kit.
Own Design
Power Supply used.
USB
What is the expected behavior?
i2c_master calls should return esp_err_t ESP_ERR_TIMEOUT when line is considered busy.
What is the actual behavior?
Unhandled exception occurs. Chip reboots.
Steps to reproduce.
- Error occurs randomly when trying to read data from a ublox M10s GNSS module via i2c.
- Issue is reported on the forum. https://www.esp32.com/viewtopic.php?f=13&t=32762
...
Debug Logs.
No response
More Information.
I reverted to the i2c.h legacy driver and the problem of timeouts still existed but did not cause a crash. I was also able to raise the max time out using i2c_set_max_timeout() which resolved the issue. I have been unable to find a similar function for i2c_master and can see from the hal files that the command is to be deprectated in the future. Please advise how to address this issue in the latest driver version.
PLEASE NOTE, this issue is not related to the timeout parameter in transmit and receive functions. These have no effect on the problem.