Skip to content

Conversation

@artemy
Copy link

@artemy artemy commented Dec 9, 2025

Summary

ESP32P4 includes a 4-channel LDO controller that can be used to supply power to external hardware, e.g. screens.

Testing

I've tested this on an ESP32-P4 board that I own.

@artemy artemy force-pushed the esp32p4-ldo-driver branch 5 times, most recently from 03d2896 to be39634 Compare December 9, 2025 20:49
@codecov
Copy link

codecov bot commented Dec 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.38%. Comparing base (2bd337e) to head (be39634).
⚠️ Report is 4 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #18538   +/-   ##
=======================================
  Coverage   98.38%   98.38%           
=======================================
  Files         171      171           
  Lines       22300    22300           
=======================================
  Hits        21939    21939           
  Misses        361      361           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link

github-actions bot commented Dec 9, 2025

Code size report:

Reference:  all: Bump version to 1.27.0. [78ff170]
Comparison: esp32: Add LDO driver for ESP32-P4. [merge of be39634]
  mpy-cross:    +0 +0.000% 
   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:    +0 +0.000% PYBV10
     mimxrt:    +0 +0.000% TEENSY40
        rp2:    +0 +0.000% RPI_PICO_W
       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS
  qemu rv32:    +0 +0.000% VIRT_RV32

@artemy artemy changed the title esp32: Add LDO driver for ESP32-P4 #18552: esp32: Add LDO driver for ESP32-P4 Dec 11, 2025
@artemy artemy changed the title #18552: esp32: Add LDO driver for ESP32-P4 esp32: Add LDO driver for ESP32-P4 Dec 11, 2025
@projectgus projectgus self-requested a review December 16, 2025 22:32
Copy link
Contributor

@projectgus projectgus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for submitting this, @artemy! It looks very useful.

I have left a few pretty minor inline comments. Also, I noticed the commit of this PR is showing as authored by Damien - I think maybe you accidentally squashed your change into unrelated commit 78ff170. Should be easy enough to fix with git commit --amend --reset-author.

As noted in the linked issue there's another requirement on some boards that one or more LDO channels need to be enabled for some GPIOs to work at all. I think this can be done by specific board_init.c files calling the ESP-IDF LDO API directly though, so separate to this change.

This commit adds support for LDO driver for ESP32-P4 SOCs

Signed-off-by: Artem Makarov <gh@artemy.nl>
@artemy artemy force-pushed the esp32p4-ldo-driver branch from be39634 to ab0ed31 Compare December 17, 2025 19:18
@artemy
Copy link
Author

artemy commented Dec 17, 2025

Thank you for your comments, @projectgus. I've modified my PR accordingly.

Signed-off-by: Artem Makarov <gh@artemy.nl>
Copy link
Contributor

@projectgus projectgus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks again @artemy!

I flashed this to a DFRobot "Firebeetle 2 P4" board and by doing l = LDO(4, 3300, adjustable=True) I was able to access the SDCard slot and also set Pin 48 high (both powered from LDO 4 on this particular board).[*]

Could also use adjust_voltage() to drop the voltage on Pin 48. Nice!

[*] Long term it'd be good for both these particular things to work without extra Python code, but it was a quick way to try out the new driver.

@projectgus projectgus requested a review from dpgeorge December 18, 2025 04:55
@projectgus projectgus linked an issue Dec 18, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LDO driver for ESP32P4

3 participants