i2c_master: Shorted SDA/SCL lines cause a watchdog timeout (IDFGH-12586) #13587
Labels
Resolution: Done
Issue is done internally
Status: Done
Issue is done internally
Type: Bug
bugs in IDF
Answers checklist.
IDF version.
5a40bb8
Espressif SoC revision.
ESP32-C6
Operating System used.
Linux
How did you build your project?
Command line with CMake
If you are using Windows, please specify command line type.
None
Development Kit.
ESP32-WROOM-32
Power Supply used.
USB
What is the expected behavior?
Return a timeout or
ESP_ERR_INVALID_STATE
when there is a bus failure.What is the actual behavior?
The device hangs and triggers an ISR WDT
Steps to reproduce.
i2c_master_transmit_receive
Debug Logs.
(note: these backtrace lines might be off by a line or two due to debug prints I had added to i2c_master.c)
More Information.
This is caused because the i2c_mater driver busy waits in the ISR. Increasing
CONFIG_ESP_INT_WDT_TIMEOUT_MS
will delay the watchdog trigger, but of course that is not a fix.esp-idf/components/esp_driver_i2c/i2c_master.c
Lines 566 to 569 in 5a40bb8
Suggestion:
Do not spin forever. Ideally this code would:
CONFIG_ESP_INT_WDT_TIMEOUT_MS / 2
i2c_master->status
toESP_ERR_INVALID_STATE
, andI started to workup a patch for this, but I'm not sure how to check the ESP32 equivalent of a "time-step-counter" in an interrupt context.
Is there a way?
The text was updated successfully, but these errors were encountered: