본문으로 건너뛰기
cccskills
무료GitHub에 공개

low-power-embedded

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.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

설치 방법 보기

포함된 파일(2)

  • SKILL.md6.0 KB
  • agents/openai.yaml206 B

SKILL.md(원문)

설치하기 전에 에이전트에게 전달되는 지시 내용을 확인할 수 있습니다.

Low-power embedded

Contract

FieldBound contract
TriggerBattery 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.
AuthorityRead-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 effectChat output only.
DoneThe 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)CPUPeripheralsSRAMWake sourceCurrent
    Runononkeptnone neededhighest
    Sleephaltedonkeptany enabled interruptmedium
    Stophaltedmost clocks offkeptEXTI, RTC, some UARTslow
    Standbyoffofflost except backup domainwake-up pins, RTClowest
  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.

    __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.

    #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.

    SourceConfiguration
    Pin edgeEXTI line routed through SYSCFG->EXTICR, unmasked in IMR, edge in RTSR or FTSR, NVIC entry enabled
    RTCAlarm or wake-up timer with its EXTI line and interrupt enabled
    UARTStart-bit or address-match wake from Stop on families whose USART lists it (STM32L4 for example); not available on every part
    WatchdogNot 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

SymptomCauseFix
Milliamps in "sleep"Debugger attached, or DBGMCU keeps clocks in StopDisconnect the probe; clear the DBG_SLEEP, DBG_STOP, DBG_STANDBY bits.
WFI returns at onceAn interrupt was pendingClear pending flags and CWUF before WFI.
RAM lost after wakeEntered Standby because PDDS was setClear PDDS for Stop.
UART dead after wakeClock tree left on HSIRe-run the HSE and PLL configuration after WFI.
Current above the datasheet figureFloating inputs or a peripheral left clockedSet 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.

리뷰

아직 리뷰가 없습니다. 사용해 본 소감을 남겨 주세요.

댓글

로그인 없이 쓸 수 있습니다. 사용 후기, 질문, 작동하지 않은 환경 등을 편하게 남겨 주세요.

아직 댓글이 없습니다. 첫 댓글을 남겨 보세요.

보내면 바로 공개됩니다. 이메일 주소나 전화번호 같은 개인 정보는 쓰지 마세요. URL은 2개까지입니다.

0 / 1,000자

이 양식은 reCAPTCHA로 보호되며 Google 개인정보처리방침 및 서비스 약관이 적용됩니다.

같은 저장소의 스킬

Use when explaining System V AMD64, ARM AAPCS, RISC-V psABI, stack frames, variadic calls, or FFI register rules. Not for the Rust FFI binding layer: use rust-ffi.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

OutlineDriven/odin-claude-plugin372026년 9월 29일 업데이트

Use when configuring ADC sampling time, DMA-driven ADC, calibration, or DAC channel setup on bare-metal MCUs. Not for the DMA stream itself: use dma-baremetal.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

OutlineDriven/odin-claude-plugin372026년 9월 29일 업데이트

af-xdp

무료

Use when creating AF_XDP sockets, configuring UMEM and XSK rings, writing an XDP redirect program, or choosing copy versus zero-copy mode. Not for full kernel bypass: use dpdk.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

OutlineDriven/odin-claude-plugin372026년 9월 29일 업데이트

Use when a completed session needs an agent-environment retrospective. Not for an engineering retrospective from telemetry: use engineering-retrospective.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

OutlineDriven/odin-claude-plugin372026년 9월 29일 업데이트

Use when a redacted, trimmed agent transcript must be appended to a GitHub PR or issue body, with human approval and preview. Not for automated or model-initiated insertion.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

OutlineDriven/odin-claude-plugin372026년 9월 29일 업데이트

agents-md

무료

Use when a repo needs agent setup, AGENTS.md added or made lean, CLAUDE.md audited, or agent instructions scored or pruned. Not for remote, credential, publish, deploy, or irreversible changes.

한국어 요약은 준비 중입니다. 원문 설명을 표시하고 있습니다.

OutlineDriven/odin-claude-plugin372026년 9월 29일 업데이트

OutlineDriven의 스킬 모두 보기

이 스킬의 문제 신고