Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESP32-C3 I2C read failure results in crash (IDFGH-5558) #7281

Closed
ghost opened this issue Jul 17, 2021 · 7 comments
Closed

ESP32-C3 I2C read failure results in crash (IDFGH-5558) #7281

ghost opened this issue Jul 17, 2021 · 7 comments
Labels
Awaiting Response awaiting a response from the author Resolution: Done Issue is done internally Status: Done Issue is done internally

Comments

@ghost
Copy link

ghost commented Jul 17, 2021

On ESP32-C3, if for whatever reason I2C read fails, program crashes with following error code:

E (11861) task_wdt: Task watchdog got triggered. The following tasks did not res
et the watchdog in time:
E (11861) task_wdt: - IDLE (CPU 0)
E (11861) task_wdt: Tasks currently running:
E (11861) task_wdt: CPU 0: my_i2c_service

where my_i2c_service is a function that writes and reads to I2C interface of a sensor. It has a 1000ms delay inside the while(1) loop. It is used as follows:
xTaskCreate(my_i2c_service, "my_i2c_service", ECHO_TASK_STACK_SIZE, NULL, 5, NULL);

I am using latest ESP-IDF mater branch. 5.1k external pullup resistors. reading from BME680 sensor. The error/crash happens at a random time, and if I2C read fails, otherwise everything is ok.
Also, I used the nimble blehr example, where I modified the "blehr_tx_hrate" function to read the I2C sensor data and the transmit via BLE in this function. As this is a timed function (runs every 1000ms), I have not added any additional delay. Not sure why WDT is raised at some random time.

@espressif-bot espressif-bot added the Status: Opened Issue is new label Jul 17, 2021
@github-actions github-actions bot changed the title ESP32-C3 I2C read failure results in crash ESP32-C3 I2C read failure results in crash (IDFGH-5558) Jul 17, 2021
@ghost ghost closed this as completed Jul 17, 2021
@ghost ghost reopened this Jul 18, 2021
@ghost
Copy link
Author

ghost commented Jul 18, 2021

As stated above, I tried many combinations and have been able to isolate the issue to I2c.
when I use a xTimerCreate for calling my_i2c_service, I see the following error after a few minutes:
E (833366) task_wdt: Task watchdog got triggered. The following tasks did not re
set the watchdog in time:
E (833366) task_wdt: - IDLE (CPU 0)
E (833366) task_wdt: Tasks currently running:
E (833366) task_wdt: CPU 0: Tmr Svc

@o-marshmallow
Copy link
Collaborator

Hello @eyewy ,
Do you mean that you specified my_i2c_service as the callback for xTaskCreate?
Can you please provide me a small snippet of code to reproduce this?

@o-marshmallow
Copy link
Collaborator

@eyewy Any update?

@Alvin1Zhang Alvin1Zhang added the Awaiting Response awaiting a response from the author label Nov 22, 2021
@AxelLin
Copy link
Contributor

AxelLin commented Feb 13, 2022

@eyewy
Is this still an issue?
It has been a while since you reported, could you try recently updated esp-idf version.

BTW, it's hard to find the exactly commit of the "latest SP-IDF master" on 17 Jul 2021,
please always report esp-idf version using "git describe --tags" command.

@Sampath-Science
Copy link

I am also facing similar issue. I2C is not working with ESP32C3. I had tried with the i2c_tools example to scan i2c devices but it ended with the below message
"E (889558) task_wdt: Task watchdog got triggered. The following tasks did not reset the watchdog in time:
E (889558) task_wdt: - IDLE (CPU 0)
E (889558) task_wdt: Tasks currently running:
E (889558) task_wdt: CPU 0: console_repl
"

Version: IDF 4.4

@AxelLin
Copy link
Contributor

AxelLin commented Apr 8, 2022

@Sampath-Science
#8120

@espressif-bot espressif-bot added Resolution: NA Issue resolution is unavailable Status: Done Issue is done internally Resolution: Done Issue is done internally and removed Status: Opened Issue is new Resolution: NA Issue resolution is unavailable labels May 6, 2022
@Alvin1Zhang
Copy link
Collaborator

Thanks for reporting and sorry for slow turnaround, fix is available 0b00831, we are also back porting to release branches.

Feel free to reopen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Response awaiting a response from the author Resolution: Done Issue is done internally Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

5 participants