fix: Remove espressif/i2c_bus dependency for M5GFX/M5Unified coexistence #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
M5PM1 depends on
espressif/i2c_buswhich uses the legacy I2C driver (i2c_bus.h).M5GFX and M5Unified use the native ESP-IDF I2C driver (
driver/i2c_master.h).ESP-IDF 5.x does not allow both drivers to coexist on the same I2C port, causing:
Solution
Remove the
espressif/i2c_busdependency completely. M5PM1 now only uses the nativedriver/i2c_master.hdriver.Commits
espressif/i2c_busfromidf_component.yml, rewriteM5PM1_i2c_compat.h, removebegin(i2c_bus_handle_t)APIespressif__i2c_busfromCMakeLists.txtREQUIRESChanges Summary
idf_component.ymlespressif/i2c_busdependencyCMakeLists.txtespressif__i2c_busfrom REQUIRESM5PM1_i2c_compat.h#include "i2c_bus.h"and all i2c_bus macrosM5PM1.hbegin(i2c_bus_handle_t)declaration and_i2c_bus/_i2c_devicemembersM5PM1.cppbegin(i2c_bus_handle_t)implementation and allM5PM1_I2C_DRIVER_BUScasesAPI Changes
pm1.begin(i2c_bus_handle_t bus, ...)pm1.begin(i2c_master_bus_handle_t bus, ...)(ESP-IDF native)pm1.begin(TwoWire* wire, ...)(Arduino)Tested
✅ M5StickS3 with M5PM1 + M5Unified + M5GFX working correctly.
✅ Display shows normally, no I2C conflicts.
✅ This enables M5PM1, M5Unified, and M5GFX to coexist without I2C driver conflicts on ESP-IDF 5.x.
@ricker-go This PR resolves the I2C driver conflict issue that prevents M5PM1, M5Unified, and M5GFX from working together. The legacy
i2c_busdriver has been completely removed in favor of the nativei2c_masterdriver.