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: Two random changes that also fixed the I2C crash for me #3710

Merged
merged 2 commits into from
Nov 18, 2020

Conversation

jepler
Copy link
Member

@jepler jepler commented Nov 17, 2020

While I didn't get anything sensible out of my debugging efforts today (I'm not getting full tracebacks in gdb so it's hard to interpret where I am) I noticed that there (A) seemed to be problems with background ticks and (B) maybe something scheduled from an interrupt was taking too long. Beyond that, I don't have a good explanation, but since making these changes I have seen my test program on #3572 stop crashing on the Kaluga, and I also edited-and-reloaded a bunch of iterations of a temperature display program on a Magtag without any crashes or lockups.

Before, there were two problems:
 * Even if a pulsein was never constructed, supervisor_disable_tick
   would occur during restart.  This could cancel out a supervisor_enable_tick
   from someplace else, with unexpected results.
 * If two or more pulseins were constructed, each one would enable ticks,
   but only the last one deinited (or the reset routine) would disable,
   leaving ticks running indefinitely.

In my testing, it seemed that this led to the board sometimes stopping when
it should have auto-reloaded.
While trying to debug adafruit#3572, I noticed that I would frequently break in
the midst of gettimeofday and that the routine get_adjusted_boot_time
had to take and release locks.  Furthermore, we don't want "adjusted"
boot time, which could go forwards or backwards depending on the
adjustment (such as setting the clock used by gettimeofday() to the network
time)
@ladyada
Copy link
Member

ladyada commented Nov 18, 2020

yah i2c works fine now... weird but effective :)

Copy link
Member

@ladyada ladyada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dunno why this works but it does!

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! IDF mysteries.

@tannewt tannewt merged commit 18513de into adafruit:main Nov 18, 2020
@jepler jepler deleted the esp32-i2c-crash branch November 18, 2020 14:58
jepler pushed a commit that referenced this pull request May 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants