-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
ESP32S2: I2C bus object crashes or failes when used after soft reboot #4046
Comments
Just for your information: |
With latest S3, |
I've been testing this today, it appears to be the same problem as #4079, and probably #4147. Your test sketch catches the problem the most cleanly, I think. I can verify that at least for me, This makes me think it has something to do with how the internal IDF object is dealt with internally during reset. The current version of I2C on the ESP32S2 doesn't do much on reset, so from what I can tell, board.I2C() tries to re-use the same internal I2C ID during soft reboots, whereas busio.I2C makes a new one. But it's tricky to test, since I'm having trouble getting a backtrace off of the reset point. |
I have been doing some testing as well, including using IDF v4.3-beta1. Mostly to see if the problem changes or goes away with a newer IDF. |
Some notes from testing today:
I'm not sure what they key takeaways here are. It's weird that only the persistent I2C has the issues when the driver isn't deleted... maybe the IDF loses something crucial over a soft reboot, even when the Circuitpython object and driver are persistent and haven't been touched? The Wifi hang on the other hand seems like maybe an interrupt priority issue? |
Ok, in some brief testing with idf v43-beta1 it seems like the i2c is better. also when i import wifi it doesnt crash. I was having lots of issues probably related to intermittent usb cable connections, a hazard of working on a laptop on my couch. So i2c works but the wifi will crash when the application is reloaded. This is similar to a previous issue but seems a bit different. |
I'm currently testing with the 4.3 branch of the idf. I2c works with changes to i2c.c. Still crashes when wifi is used and the app reloaded. However before just doing an import wifi would crash. Now it gets farther. I'm out now so will look some more later. |
@skieast interesting. I never got a crash on the import of wifi, even on the existing branch of the IDF on Circuitpython main, and your experience is the same as my current Main branch testing. So it doesn't sound like the upgrade to 4.3 has changed much. |
I'm trying to remember what wasnt working when I did my PR back in december. At that point I think I was using the REPL,
Interrupt this code, then start entering it again. Would hang at the import wifi statement. |
I found some success with multiple probes. See this comment for more information: |
This code works fine when the MagTag boots cold.
After connecting to Putty (here with COM29)
and pressing ctrl-c to get to the CP prompt
and pressing ctrl-d to reload...
There is a core code hard crash:
And the CDC connection to Putty is disconnecting:
PS: I observe similar behaviour using a featherS2.
The text was updated successfully, but these errors were encountered: