Skip to content

[Feature Request]: Migrating ESP32 to ESP-IDF 5.5 #8896

@phaseloop

Description

@phaseloop

Platform

ESP32

Description

Tracking issue for framework update.

Reasoning:

Due to PlatformIO politics, they support only old Arduino 2.x framework based on ESP-IDF V4 which has many bugs - including bluetooth stability and power management issues.

Example of gains from switching to version 5.5:

#8876

What we can do is to switch to pioarduino which is basically newest arduino-esp32 developed by Espressif but repacked to match Platformio metadata.

Switching to newer version will allow us to enable also FreeRTOS power saving features in the future. Initial work on this was done by @m1nl at https://github.com/m1nl/esp32-arduino-lib-builder

I have done experimental migration in my private branch and tested on Heltec V3. According to @m1nl there can be issues with different boards which will probably be solved on a case-by-case basis.

#7121 (comment)

We have this already as ESP32-C6 support variant imports pioarduino instead of default one.

Known incompatibilities and migration work needed:

  • migrate battery ADC reading to new ESP-IDF API.

This would be best done by moving battery ADC management to separate code in /platform/esp32 and call it from Power.cpp to avoid ton of #idefs

  • remove Syslog class definition from source code and rework syslog calls to new library

It seems arduino-esp32 already imports external Syslog library (which is just newer version of what we have) and there are linker conflicts. There are minor API issues to fix between old and new one. Worst case scenario just keep using the old one but rename it.

  • fix Paxcounter library as it's incompatible with new ESP-IDF API. It can be disabled and fixed last as paxcounter is not a critical feature.

Work plan (best as separate issues):

  • implement ESP32 platform ADC management and battery readings as separate API living in /platform. API should be universal enough to be implemented by other platforms as well in the future.

  • implement ESP-IDF V5 implementation of abovementioned API

  • enable pioarduino for Heltec V3 boards as base testing platform

  • work for each board one by one to figure out and fix problems

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesttriagedReviewed by the team, has enough information and ready to work on now.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions