Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Low Power Embedded

ASecurity

Use when configuring MCU sleep/stop/standby, WFI, STM32 PWR, nRF sleep, clock gating, wake-up EXTI sources, or measuring current draw. Not for the wake ISR: use interrupts-and-exceptions-baremetal.

54 stars
0 votes
0 copies
0 views
Added 9/20/2026
ai-agentsaws

Security Analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned 9/20/2026

$npx -y skills add OutlineDriven/outline-driven-development --skill low-power-embedded --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Low Power Embedded?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Low Power Embedded
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/outlinedriven-low-power-embedded-outline-driven-development/badge)](https://www.skillsdirectory.com/skills/outlinedriven-low-power-embedded-outline-driven-development)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: low-power-embedded
description: 'Use when configuring MCU sleep/stop/standby, WFI, STM32 PWR, nRF sleep, clock gating, wake-up EXTI sources, or measuring current draw. Not for the wake ISR: use interrupts-and-exceptions-baremetal.'
disable-model-invocation: true
---

# Low-power embedded

## Contract

| Field | Bound contract |
|---|---|
| Trigger | Battery firmware misses its power budget, a device will not wake or wakes at once, sleep current stays in the milliamp range, or a main loop or RTOS idle hook must sleep between events. |
| Authority | Read-only: emits mode selection, entry and exit sequences, gating checklists, and measurement steps to chat; the user places them in the firmware. Rollback is not needed because no file is written. No remote mutation. |
| Side effect | Chat output only. |
| Done | The chosen mode is justified against wake latency and state retention, the entry sequence sets the mode bits the reference manual names, the wake source is configured, the clock tree restore after wake is stated, and current is measured with the measurement conditions recorded. |

## Inputs

- Target part and its power chapter (STM32 `PWR`, nRF `POWER`, or equivalent).
- Wake sources needed: pin edge, RTC alarm or wake-up timer, UART start bit, other.
- Allowed wake latency and whether RAM contents must survive.
- Current budget and the meter available (range and burden voltage).
- Whether an RTOS runs and owns the idle path.

## Procedure

1. Pick the mode from the retention and wake-latency needs. Done when: the row chosen is the lowest-power row that keeps the state the design needs and wakes within the latency budget.

   | Mode (STM32 naming) | CPU | Peripherals | SRAM | Wake source | Current |
   |---|---|---|---|---|---|
   | Run | on | on | kept | none needed | highest |
   | Sleep | halted | on | kept | any enabled interrupt | medium |
   | Stop | halted | most clocks off | kept | EXTI, RTC, some UARTs | low |
   | Standby | off | off | lost except backup domain | wake-up pins, RTC | lowest |

2. Enter Sleep with `__WFI()` after arming the wake source. Clear every pending interrupt first, because a pending interrupt makes `WFI` return at once. `__WFE()` wakes on events as well as interrupts. Done when: `WFI` returns only when the intended source fires.

   ```c
   __disable_irq();
   /* arm the wake source: EXTI line, RTC alarm, ... */
   __enable_irq();
   __WFI();
   ```

3. Enter Stop on STM32F4 by clearing `PDDS` (deep sleep selects Stop, not Standby), optionally setting `LPDS` for the low-power regulator, clearing the wake-up flag, setting `SLEEPDEEP`, and executing `WFI`. Setting `PDDS` selects Standby and loses SRAM. After wake the core runs from HSI; re-run the clock configuration that enabled HSE and the PLL, then re-init peripherals whose clocks were stopped. Done when: the device wakes into Stop-exit code with SRAM intact and the system clock restored.

   ```c
   #include "stm32f4xx.h"

   void enter_stop_mode(void)
   {
       PWR->CR  |= PWR_CR_CWUF;                /* clear the wake-up flag */
       PWR->CR  &= ~PWR_CR_PDDS;               /* deep sleep = Stop */
       PWR->CR  |= PWR_CR_LPDS;                /* regulator in low-power mode during Stop */
       SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
       __WFI();
       SCB->SCR &= ~SCB_SCR_SLEEPDEEP_Msk;
       clock_config();                         /* the routine that turns HSE and PLL back on */
   }
   ```

4. Gate what stays on. Before sleeping: disable unused peripheral clocks in the RCC enable registers, stop ADC and DAC continuous modes, stop DMA streams, put UART and SPI in their idle or disabled state, and select the lowest regulator voltage scale the target clock allows (`PWR_CR_VOS` on STM32F4). Set unused pins to analog mode so no input buffer draws current. Done when: each item has been applied or recorded as needed for the wake path.
5. Configure the wake source for the mode. Done when: the source below is armed and its flag is clear.

   | Source | Configuration |
   |---|---|
   | Pin edge | EXTI line routed through `SYSCFG->EXTICR`, unmasked in `IMR`, edge in `RTSR` or `FTSR`, NVIC entry enabled |
   | RTC | Alarm or wake-up timer with its EXTI line and interrupt enabled |
   | UART | Start-bit or address-match wake from Stop on families whose USART lists it (STM32L4 for example); not available on every part |
   | Watchdog | Not a wake source; an expired IWDG resets the device |

6. Coordinate with the RTOS when one runs. FreeRTOS tickless idle (`configUSE_TICKLESS_IDLE`) calls a port hook that executes `WFI` or a Stop entry; put the mode logic in that hook and nowhere else, so two owners never fight over the sleep decision. Done when: exactly one code path enters a low-power mode.
7. Measure, do not estimate. Put the meter in series with the MCU supply, disconnect the debugger (the debug port and `DBGMCU` low-power debug bits keep clocks alive), and record run current and sleep current with the same clock tree and firmware build. Use the DWT cycle counter to time the wake path. Done when: the two current figures and the wake latency are written down with meter range, supply voltage, and debugger state.

## Failure and recovery

| Symptom | Cause | Fix |
|---|---|---|
| Milliamps in "sleep" | Debugger attached, or `DBGMCU` keeps clocks in Stop | Disconnect the probe; clear the `DBG_SLEEP`, `DBG_STOP`, `DBG_STANDBY` bits. |
| `WFI` returns at once | An interrupt was pending | Clear pending flags and `CWUF` before `WFI`. |
| RAM lost after wake | Entered Standby because `PDDS` was set | Clear `PDDS` for Stop. |
| UART dead after wake | Clock tree left on HSI | Re-run the HSE and PLL configuration after `WFI`. |
| Current above the datasheet figure | Floating inputs or a peripheral left clocked | Set unused pins to analog; audit the RCC enable registers. |

## Output

A mode selection with its justification, the entry and exit sequence with the reference-manual bit names, the gating checklist, the wake-source configuration, the RTOS ownership rule when an RTOS runs, and the measured run and sleep currents with their conditions.

Attribution

OutlineDrivenOutlineDriven
View sourceSee grades on GitHubMore from OutlineDriven →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Terse caveman voice: answer first, fluff gone, every technical fact kept. Use for /caveman, "caveman mode", "talk like caveman", "be brief", "less tokens". Stays on until "stop caveman" or "normal mode".

1100021 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

698621 votes

Writing Skills

Create and manage Claude Code skills in HASH repository following Anthropic best practices. Use when creating new skills, modifying skill-rules.json, understanding trigger patterns, working with hooks, debugging skill activation, or implementing progressive disclosure. Covers skill structure, YAML frontmatter, trigger types (keywords, intent patterns), UserPromptSubmit hook, and the 500-line rule. Includes validation and debugging with SKILL_DEBUG. Examples include rust-error-stack, cargo-dep...

3931 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3421 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Amp, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Grok Build, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

741 votes
View all in ai-agents →