-
Notifications
You must be signed in to change notification settings - Fork 7.6k
[ESP32-s2] Crash when scanning I2C #5636
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
Comments
|
Well actually no, as I'm sure I don't set the same pins. I just read through this issue, and there seem some similarities, at least the crashing is mentioned when scanning. |
Not even close, but what i know. |
Care to elaborate? |
Just updated the opening post, as the scanning seems to be the only issue here. When connecting an I2C device like an OLED display, it does seem to work just fine. |
In that case log message is stupid, but the issue you found seems to be already fixed in your code:
Maybe there is something else we didnt find yet. |
Yep, I double checked and your fix is already present in the code I compiled. |
OK, I changed my code to include the frequency at |
@TD-er - i2c is currently been refactored to be based on IDF in order to support ESP32, ESP32-S2 and ESP32-C3. |
@SuGlider Do you have an estimate on when this refactoring may be done? |
@TD-er , yes, sure! |
@SuGlider I manually replaced the 4 files in your PR but it doesn't even compile (for ESP32-s2) with lots and lots of errors (mainly not recognized types, so probably some other changes elsewhere too) Then I tried to set PlatformIO to use your branch as platform:
But that doesn't work either:
I'm always having these issues where I try to build with changes in the core libraries like this one where it just doesn't work. |
Did you update to Arduino Core 2.0.0 before replacing those 4 files? |
Check this. It may help you: |
I honestly don't know, as I am using PlatformIO, with platform_packages collected by @Jason2866 The platformio packages:
The framework "version" is a bit unclear as it states "0.0.0"
Regarding ESP32, I completely lost track of which version we're now on as it is a gathered set of toolkits just to be able to build some ESP32-S2 builds that seem to boot after a rebuild. It looks like it is based on platform-espressif32 version 3.3.1, which dates from before arduino-esp32 2.0.0 was tagged, so I guess it may not be the "2.0.0" right now. |
@TD-er the build you use is at the commit of core 2.0.0
Does compile for me without any error with the PR and Tasmota works. I2C not yet tried |
Sadly, doesn't compile for the ESP32-S2:
|
Changed the board to this:
With an error at linking:
Edit:
Now it seems to start building using the esp32-s2-soala-1 board, but still the same linker error. |
Using wrong
|
Was the rest of my PIO platform selection OK? Oh and more importantly, will this mess up builds I make using the older platforms? |
Yes, last setup is okay. I does not mess up older builds for me. I will add a package.json with a unique version number. I think the problem is caused from the |
Right now I have it running on the S2 and it seems to run fine. |
Added a version number. If you delete again you should get now |
Just a remark about the code changes, I will post them in the respective PR. : #5664 (comment) |
Hi could you please re-test with this new PR: #5683 |
@Jason2866 Can you make a new PIO platform_package ? |
Does work with Tasmota. The SuGlider version did run 4 days nonstop with Tasmota until now without issues. |
@Jason2866 Thanks, will try to build it with ESPEasy. |
Hardware:
Board: ?ESP32 Dev Module? ?node32? ?ttgo_lora?
Core Installation version: ?1.0.0? ?1.0.1-rc4? ?1.0.1? ?1.0.1-git? ?1.0.2? ?1.0.3?
IDE name: ?Arduino IDE? ?Platform.io? ?IDF component?
Flash Frequency: ?40Mhz?
PSRAM enabled: ?no? ?yes?
Upload Speed: ?115200?
Computer OS: ?Windows 10? ?Mac OSX? ?Ubuntu?
Description:
When scanning the I2C bus, the ESP32-S2 immediately crashes.
The crash suggests the pins are the same, but that's not how I set them.
The I2C pins are set via
Wire.begin
and not via thesetPins
call, since I have no explicit differences between ESP8266 and ESP32 code for I2C.It crashes on line 1855: (
i2c_master_stop
)arduino-esp32/cores/esp32/esp32-hal-i2c.c
Lines 1846 to 1859 in 92ce408
The scanning procedure is as basic as it gets:
https://github.com/letscontrolit/ESPEasy/blob/a27b6a6fc1e50861b52c70bbf361f9ccc6c9587f/src/src/WebServer/I2C_Scanner.cpp#L305-L365
N.B. It crashes when scanning with and without any I2C device connected.
When connecting an I2C device, like an OLED display, it does work fine. So it is just the scanning which causes issues.
Debug Messages:
The text was updated successfully, but these errors were encountered: