Skip to content

ESP32-P4 LDO

The ESP32-P4 has 4 Low-Dropout linear regulators that can be used to power on- and off-chip peripherals. This component allows those regulators to be configured and enabled.

Channels 3 and 4 are available for general use. Channels 1 and 2 are normally reserved by the chip for powering internal flash and PSRAM — they can only be configured with an explicit acknowledgement option (see below).

# Example configuration entry
esp_ldo:
- channel: 3
voltage: 2.5V
- channel: 4
voltage: passthrough
  • channel (Required, int): The channel number of the LDO regulator to configure. Valid values are 1–4. Channels 3 and 4 are available for general use. Channels 1 and 2 are reserved for internal chip use (flash/PSRAM) and require allow_internal_channel: true to be set.
  • voltage (Required, voltage): The desired output voltage. Must be in the range 0.5V to 2.7V, or passthrough to enable pass-through mode (output follows the supply voltage). Note: the actual output voltage may deviate by approximately 50–100 mV from the configured value.
  • adjustable (Optional, bool): If true, the output voltage can be adjusted at runtime using the esp_ldo.voltage.adjust action. Defaults to false. Cannot be set to true when voltage is passthrough, as pass-through mode does not support runtime voltage adjustment.
  • allow_internal_channel (Optional, bool): Must be set to true to use channels 1 or 2. These channels are normally reserved by the chip for flash and PSRAM power. Incorrect use can cause system instability, data corruption, or a permanently bricked device. Only set this if you have verified via your board’s datasheet and schematics that the channel is unused. Setting this option on channels 3 or 4 is an error. Defaults to false.

If the LDO is configured with adjustable: true, the voltage can be updated at runtime:

on_...:
then:
- esp_ldo.voltage.adjust:
id: ldo_id
voltage: !lambda return 2.5;
  • id (Required, ID): The ID of the LDO to adjust.
  • voltage (Required, voltage): The desired output voltage. Must be in the range 0.5V to 2.7V.
  • The LDO output voltage may deviate by approximately 50–100 mV from the configured value.
  • Channels 1 and 2 are connected to the chip’s internal flash and PSRAM power domains on most ESP32-P4 modules. Only use these channels if your specific board schematic confirms they are routed to an external pad and are not powering internal components.
  • passthrough mode passes the supply voltage directly to the output and does not support runtime voltage adjustment. Setting adjustable: true together with voltage: passthrough is a configuration error and will be rejected during validation.