Skip to content

ESP32 Arduino SDK 3.x fixes#2265

Open
petrkr wants to merge 4 commits intomeshcore-dev:devfrom
petrkr:sdk3fixes
Open

ESP32 Arduino SDK 3.x fixes#2265
petrkr wants to merge 4 commits intomeshcore-dev:devfrom
petrkr:sdk3fixes

Conversation

@petrkr
Copy link
Copy Markdown

@petrkr petrkr commented Apr 6, 2026

Here I will fix incompatible things with SDK 3.x IDF 5

TODO for SDK 3 full support:

  • Something reinitialize I2C, my guess was XPowerLibs on Tbeam, but if I will comment it out, it still does not works well (OLED for example)
  • also PMU seem to works during board initialization, but later in app is missing bat voltage/percent
DEBUG: Warning: Failed to find AXP2101 power management
DEBUG: AXP192 PMU init succeeded, using AXU...
        Found AXP192/AXP2101 PMU
        Found SSD1306/SH1106 display
Scan for devices is complete.

GPS RX pin: 12 GPS TX pin: 34

isCharging:YES
isDischarge:NO
isVbusIn:YES
getBattVoltage:4193mV
getVbusVoltage:5049mV
getSystemVoltage:4949mV
getBatteryPercent:100%

/// and since this one... So something deinitalized I2C or using different instance

[   792][E][esp32-hal-i2c.c:307] i2cSetClock(): bus is not initialized
[   798][E][esp32-hal-i2c.c:193] i2cWrite(): bus is not initialized

@petrkr
Copy link
Copy Markdown
Author

petrkr commented Apr 6, 2026

Found what causing I2C issues.
Here
https://github.com/meshcore-dev/MeshCore/blob/dev/src/helpers/ui/SSD1306Display.h#L10-L12

id hard-coded PIN 21 if pin is not passed by board.

But on TBeam (and almost all others ESP32 boards) is PIN 21 used for I2C_SDA signal.

I suggest change it to -1 (same as for example here https://github.com/meshcore-dev/MeshCore/blob/dev/src/helpers/ui/SH1106Display.h#L10 )

Because now there are just two solutions (which I know)

1st is change it to -1 and OLED which will need it will pass it by -D compilation parameter (my guess there will be nothings like that, never saw OLED wit I2C and RST pin)

2nd keep it 21, but change every OLED board platformio.ini to -D PIN_OLED_RESET to -1

@petrkr petrkr changed the title WIP: ESP32 Arduino SDK 3.x fixes ESP32 Arduino SDK 3.x fixes Apr 6, 2026
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.

1 participant