-
-
Notifications
You must be signed in to change notification settings - Fork 207
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
M5Stack CoreS3 I2C conflict #628
Comments
hi, does it also happen with the develop branch? |
I should try, but cannot do that right now (just left). |
Could test it. Yes, same thing. It still configures I2C port 1 with the same pins as port 0 is already configured to. btw: latest version also gives me a warning (which is an error because I use -Werror):
But let's not dwell on that too much. I can work around it. I can make a separate issue if you need it. |
editing line 76 will affect all M5 devices does changing the port at line 120 instead |
That's weird as on line 77+78, just below I2C_NUM_1, the I2C gpio pins are set to GPIO_NUM_12 and GPIO_NUM_11 while all other M5 (core) devices have their internal I2C bus on GPIO21 and GPIO22. So if this part is enabled then, those IO pins do not connect to the internal bus which has the touch controller on in. I've switched my project to the CoreS2 and these lines get greyed out. Makes sense as CONFIG_IDF_TARGET_ESP32S3 on line 55 is then not defined. Then line 283 gets enabled, setting I2C to GPIO21/22. Also on I2C_NUM_1 btw, so I suspect this problem to arise on the CoreS2 as well. Don't know about ESP32_S3_BOX version though, which this part seems to be made for as well? For now autodetection does work in the sense that touch works, but not in the sense that the other I2C devices no longer do. For others currently running into this problem: Either use Wire1 on GPIO11/12 and Wire on different pins or edit LGFX_AutoDetect_ESP32_all.hpp to use I2C_NUM_0 on line 76. Thanks btw! |
Carefully written Issues are more likely to be given priority.
丁寧に記述された報告は優先して対応される可能性が高くなります。
Environment ( 実行環境 )
Problem Description ( 問題の内容 )
M5Stack defines Wire & Wire1, Wire is is the SYS_I2C on bus nr 0, and configured on on G11/G12.
LGFX Autodetect configures bus nr 1 (Wire1) on pins G11/G12, breaking 'Wire' from that point on.
Configuring my other I2C devices on Wire1 (port 1), on pins 11/12 makes them and LGFX touch work together. But this breaks the second default configured Wire1, which was/should be configured on G19/G20.
Setting i2c_port = I2C_NUM_0 (LGFX_AutoDetect_ESP32_all.hpp:76) also fixes the problem as this makes LGFX use the same config as was already present.
Expected Behavior ( 期待される動作 )
LGFX using port nr 0 (== SYS_I2C) for the touch controller.
Actual Behavior ( 実際の動作 )
LGFX configures port nr 1 (in LGFX_AutoDetect_ESP32_all.hpp, line 76)
Steps to reproduce ( 再現のための前提条件 )
Code to reproduce this issue ( 再現させるためのコード )
Nothing special:
lgfx.init()
Use Wire for devices on G11/G12, they no longer work after configuring touch callback getTouchRaw is called.
I do not use the M5 library/classes itself. But I guess they could break after LGFX reconfigures pins.
The text was updated successfully, but these errors were encountered: