Esp32 Pmu Design
The power management unit is what lets an ESP32-class chip advertise microamp-level deep-sleep current and still drive a 2.4 GHz radio at full transmit power seconds later, and it does that by splitting the whole die into independently switchable power domains rather than running everything off one shared rail. A single global supply would force every block — CPU, RF, SRAM, peripherals — to stay powered whenever any one of them needs to run, which is exactly the design a battery-powered sensor can't afford; the PMU's real job is deciding, moment to moment, which domains actually need power and cutting the rest.
The RTC domain's tiny size is the entire reason deep sleep can hit microamp currents, because everything else on the die is genuinely powered off, not just idled. Keeping the CPU, SRAM, and RF front end powered but clock-gated — the easier engineering choice — still leaves their leakage current flowing, which on a modern process node is measured in the hundreds of microamps to milliamps, not microamps; the PMU instead cuts supply voltage entirely to every domain except a handful of RTC-domain elements (a timer, a small retention SRAM, wake-logic), which is the only way to get total chip current down to the single-digit-microamp range vendors advertise for deep sleep.
The brown-out detector exists to prevent a failure mode that's invisible until it destroys data: a supply sag mid-flash-write corrupting the very firmware the chip needs to boot. Writing to on-board or external SPI flash takes real time and real current, and if the supply voltage dips below spec during that write — a weak battery, a noisy regulator, a radio transmission drawing current at the same moment — an unprotected chip can leave flash in a half-written, corrupted state; the BOD's job is to detect that sag early enough to force a clean reset and abort the write before corruption happens, rather than let the chip continue operating on a supply that's already out of spec.
Power-mode transitions have to be sequenced, not just switched, because turning a domain on or off instantly can itself cause the exact supply glitch the BOD is there to catch. Waking the RF domain from a fully-off state means a sudden current demand that can sag the shared supply rail if it isn't ramped and sequenced properly — which is why real PMU designs stagger domain wake-up (bias circuits first, then PLL lock, then full RF power) rather than switching everything on simultaneously, trading a few extra microseconds of wake latency for a supply transient small enough that it doesn't trip the chip's own brown-out protection on its way out of sleep.
The PMU is the subsystem that turns "low power" from a marketing number into an actual deep-sleep current in the single-digit microamps: independently switchable domains that go to true zero rather than idling, a brown-out detector protecting flash integrity through every voltage dip, and a sequenced wake-up path that brings the radio back without tripping its own protection circuits on the way up.