Fills two specific gaps in ESP32/Arduino firmware: ISR primitives (IRAM_ATTR, FromISR calls, portYIELD) and empirical validation. For C/C++ embedded development on ESP32.
Ships in effective-esp32. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
You already write correct, idiomatic ESP32 architecture for the easy 80%. Measured against authority (ESP-IDF, FreeRTOS, the datasheets), an unaided baseline already:
delay() band-aid),String/heap churn,PROGMEM/F() are no-ops on ESP32 -- flash is MMU-mapped, const already lands in .rodata.Do not "correct" any of that. Re-teaching it with rules of thumb makes the output worse. This skill is only about the two places the baseline reliably drops the ball:
Everything below is one of those two. If a suggestion isn't filling one of these holes, you're adding noise.
The shape is right: ISR does the minimum, real work happens in a task. The parts that get dropped:
// The ISR itself
void IRAM_ATTR gpio_isr(void *arg) { // IRAM_ATTR: runs even when flash cache is disabled
BaseType_t hpw = pdFALSE;
uint32_t evt = read_some_register(); // DRAM only, no float, no printf, no malloc
xQueueSendFromISR(evtQ, &evt, &hpw); // ...FromISR variant, never the plain call
portYIELD_FROM_ISR(hpw); // wake the task NOW, not one tick later
}
Rules that matter (authority: ESP-IDF intr_alloc + FreeRTOS):
IRAM_ATTR on any ISR that can fire during SPI-flash ops, or it crashes when cache is off.xQueueSendFromISR / xTaskNotifyFromISR + a BaseType_t hpw + portYIELD_FROM_ISR(hpw). A bare polled volatile flag adds up to one tick of latency and is the lazy-but-worse pattern.std::atomic or a portMUX_TYPE critical section (portENTER_CRITICAL_ISR/portEXIT_CRITICAL_ISR). volatile alone is not atomicity on the SMP parts.Serial, WiFi, delay(), float, or heap in the ISR. Float in an ISR needs explicit FPU handling -- just don't.i2s_read / the RMT transfer. Say so when it applies.This is where unaided output is weakest. Every non-trivial design should carry the measurement that backs it. Add whichever apply:
uxTaskGetStackHighWaterMark(NULL) logged once the task is warm; size the stack to the watermark + margin. (FFT buffers and the WiFi stack blow guessed stacks silently.)heap_caps_malloc(n, MALLOC_CAP_DMA) for DMA buffers, MALLOC_CAP_INTERNAL to stay off PSRAM, MALLOC_CAP_SPIRAM only on parts that have it (S3 can, C3 cannot). Check heap_caps_get_free_size(...) for the cap you actually use. (ESP.getHeapFragmentation() is an ESP8266 API -- no-op on ESP32; don't.)setup() before declaring it fits.
uint32_t t0 = micros();
for (int i=0;i<64;i++) computeFFT();
Serial.printf("FFT %u us/call\n", (micros()-t0)/64); // "C3 too slow for FFT" is usually false -- measure it
TEST_PATTERN mode that lights corners/diagonals to verify WS2812 mapping (serpentine vs zigzag) on the real panel. Don't write animation against an assumed map.FastLED.setMaxPowerInVoltsAndMilliamps(5,2000) is better than a flat brightness guess because it scales per frame).esp_task_wdt_add() and feed them; an unfed loop is how a field unit bricks silently.platform = [email protected] etc.) so a silent core bump doesn't change RMT/I2S behavior under you.| ESP32 | ESP32-C3 | ESP32-S3 | |
|---|---|---|---|
| cores | 2 | 1 | 2 |
| on-chip SRAM | 520KB | 400KB | 512KB |
| PSRAM | optional | none | optional (in-package/ext) |
| native USB | no | no (USB-Serial-JTAG) | yes (USB-OTG/TinyUSB) |
The baseline already names the WiFi-ISR-vs-clockless-LED-timing conflict and fixes it with RMT/DMA. Keep doing exactly that. The only addition: quantify the interrupt-off window when you bit-bang (e.g. 256·24·1.25µs ≈ 7.7ms) so the reader sees why DMA wins. Yielding (vTaskDelay) reduces but does not close a bit-bang window; DMA does.
IRAM_ATTR + ...FromISR + portYIELD_FROM_ISR; std::atomic/portMUX for shared data; nothing blocking inside.micros(), power via mA, mapping via a bring-up mode.PROGMEM/F()/pgm_read_* do nothing useful on ESP32; ESP.getHeapFragmentation() is a no-op.PROGMEM/F() "to save SRAM" — no-op on ESP32.volatile sig_atomic_t as the whole ISR-safety answer — missing IRAM_ATTR/FromISR/yield.delay(8) — use vTaskDelay(pdMS_TO_TICKS(n)) to a measured budget.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
/effective-esp32:effective-esp32from effective-esp32
npx claudepluginhub human-frontier-labs-inc/human-frontier-labs-marketplace --plugin effective-esp32