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

Docs and technical reference manual inconsistent for clock stretching timeout on ESP32-C3 (IDFGH-9276) #10659

Open
3 tasks done
TheButlah opened this issue Jan 30, 2023 · 3 comments
Assignees
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally

Comments

@TheButlah
Copy link

TheButlah commented Jan 30, 2023

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.

General issue report

In esp-rs/esp-hal#352 I have been working on delving into esp-idf's implementation of clock stretching.

  • i2c_set_timeout()'s docstring states that its delay is specified in APB clock cycles (not exponential).
  • It calls i2c_ll_set_tout() which states that the timeout is 2**tout APB clock cycles (exponential). This controls the I2C_TIME_OUT_VALUE parameter of the I2C_TO_REG register (0x0C).
  • The technical reference for esp32c3 states that I2C_TIME_OUT_VALUE describes the number of APB clock cycles (not exponential), in a couple of places.

Is I2C_TIME_OUT_VALUE linear or exponential? Is the technical reference correct that its linear?

If it is exponential, the docs for i2c_set_timeout() should be changed, and if its linear, the docs for i2c_ll_set_tout() should be changed.

@espressif-bot espressif-bot added the Status: Opened Issue is new label Jan 30, 2023
@github-actions github-actions bot changed the title Docs and technical reference manual inconsistent for clock stretching timeout on ESP32-C3 Docs and technical reference manual inconsistent for clock stretching timeout on ESP32-C3 (IDFGH-9276) Jan 30, 2023
@espressif-bot espressif-bot added Status: Selected for Development Issue is selected for development Resolution: Done Issue is done internally Status: Done Issue is done internally and removed Status: Opened Issue is new Status: Selected for Development Issue is selected for development labels Feb 17, 2023
@TheButlah
Copy link
Author

This issue has been marked as done - what was the resolution? @mythbuster5

@mythbuster5
Copy link
Collaborator

Yeah.. the docs of i2c_ll_set_tout should be changed. It's linear.

@TheButlah
Copy link
Author

We still have contradicting evidence. According to this experiment, i2c_ll_set_tout and I2C_TIME_OUT_VALUE is exponential, and the TRM is wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Done Issue is done internally Status: Done Issue is done internally
Projects
None yet
Development

No branches or pull requests

3 participants