skills/baremetal/low-power-embedded/SKILL.md
Low-power embedded skill for sleep modes and energy optimization. Use when configuring MCU sleep/stop/standby, peripheral clock gating, wake-up sources, or measuring firmware current draw. Activates on queries about WFI, STOP mode, STM32 PWR, nRF sleep, wake-up EXTI, or reducing embedded power consumption.
npx skillsauth add mohitmishra786/low-level-dev-skills low-power-embeddedInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Guide agents through MCU low-power modes: sleep vs deep sleep (stop/standby), peripheral and bus clock gating, wake-up source configuration, and practical current measurement — with Cortex-M WFI/WFE and vendor PWR examples (STM32-focused patterns apply broadly).
skills/baremetal/interrupts-and-exceptions-baremetal| Mode | CPU | Peripherals | RAM | Wake source | Relative current | |------|-----|-------------|-----|-------------|------------------| | Run | on | on | on | — | highest | | Sleep | off | on | on | any IRQ | medium | | Stop | off | most off | on | EXTI, RTC, UART | low | | Standby | off | off | lost* | WKUP pins, RTC | lowest |
* Standby clears most SRAM; use backup domain or external EEPROM for state.
/* Cortex-M — sleep until interrupt */
__disable_irq();
/* configure wake source (e.g. EXTI, RTC alarm) */
__enable_irq();
__WFI(); /* or __WFE() for event-based wake */
Ensure pending interrupts are cleared before WFI or wake may be immediate.
#include "stm32f4xx.h"
void enter_stop_mode(void)
{
/* Gate clocks you do not need */
RCC->AHB1ENR &= ~RCC_AHB1ENR_GPIOAEN; /* example — only if safe */
PWR->CR |= PWR_CR_CWUF; /* clear wake flags */
PWR->CR |= PWR_CR_PDDS; /* deep sleep = Stop */
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
__WFI();
/* After wake: re-enable HSE/PLL — clocks lost in Stop on many parts */
SystemInit();
}
After Stop, re-init clocks and peripherals that lost their registers.
Before sleep
├── Disable unused peripheral clocks (RCC xENR)
├── Disable ADC/DAC continuous modes
├── Stop DMA channels
├── Enter peripheral low-power (UART mute, SPI off)
└── Configure lowest viable regulator scale (Voltage Scale 2/3)
| Source | Config | |--------|--------| | EXTI GPIO | SYSCFG + EXTI IMR, edge trigger | | RTC alarm | RTC WUT/WAKEUP | | UART | Start bit detection (some MCUs) | | IWDG | Not a wake source — resets device |
FreeRTOS configUSE_TICKLESS_IDLE maps to WFI/Stop — coordinate with skills/embedded/freertos.
/low-power-embedded Configure STM32 Stop mode with EXTI0 wake and PLL restore
| Symptom | Cause | Fix |
|---------|-------|-----|
| Still mA in "sleep" | Debug interface active (SWD) | Disconnect debugger; disable DBGMCU |
| Immediate wake from WFI | Pending NVIC IRQ | Clear flags before WFI |
| Lost state after wake | Entered Standby not Stop | Use Stop if RAM must persist |
| UART dead after wake | Clock tree not restored | Call SystemInit() path |
| Higher than datasheet uA | Floating GPIO | Set unused pins analog or pull |
skills/baremetal/interrupts-and-exceptions-baremetal — EXTI wake IRQsskills/baremetal/gpio-baremetal — pin mode for leakage controlskills/baremetal/stm32-baremetal — RCC and PWR registersskills/baremetal/timers-pwm-baremetal — stop timers before sleepskills/embedded/freertos — tickless idle integrationdevelopment
QEMU/KVM skill for virtualization and kernel development. Use when running qemu-system-x86_64 with KVM, configuring virtio devices, VFIO passthrough, QMP monitor, libvirt, or booting custom kernels. Activates on queries about QEMU, KVM, virtio, VFIO, virsh, virt-install, or -kernel -append.
development
Hardware virtualization internals skill for Intel VT-x and AMD-V. Use when studying VMCS/VMCB, EPT/NPT page tables, VMEXIT handling, APIC virtualization, or building minimal hypervisors. Activates on queries about VMX, SVM, VMCS, EPT, NPT, VMEXIT, or type-1 hypervisor.
testing
Linux containers internals skill for namespaces, cgroups, and OCI. Use when understanding clone/unshare namespaces, cgroups v2 limits, overlayfs, runc, seccomp profiles, capabilities, or escape mitigations. Activates on queries about namespaces, cgroups, overlayfs, runc, seccomp-bpf, OCI spec, or container escape.
tools
Reverse engineering skill for binary analysis. Use when decompiling with Ghidra, analyzing with radare2, scripting RE tools, triaging with strings/file/xxd, or diffing binaries. Activates on queries about Ghidra, radare2, r2, decompiler, Binary Ninja, Diaphora, or stripped binary analysis.