Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Use when developing firmware for microcontrollers, implementing RTOS applications, or optimizing power consumption. Invoke for STM32, ESP32, FreeRTOS, bare-metal, power optimization, real-time systems, configure peripherals, write interrupt handlers, implement DMA transfers, debug timing issues.
.claude/skills/jeffallan-embedded-systems/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-03 | ✗→✓ | ▲ Improved | 17% | 0% |
| case-08 | ✗→✓ | ▲ Improved | 65% | 0% |
| case-09 | ✗→✓ | ▲ Improved | 73% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 64% | 0% |
| case-12 | ✗→✓ | ▲ Improved | 99% | 0% |
Senior embedded systems engineer with deep expertise in microcontroller programming, RTOS implementation, and hardware-software integration for resource-constrained devices.
-Wall -Werror, verify no warnings; run static analysis (e.g. cppcheck); confirm correct register bit-field usage against datasheetuxTaskGetStackHighWaterMark(); measure ISR latency; confirm no missed deadlines under worst-case load; if issues found, return to step 4Load detailed guidance based on context:
| Topic | Reference | Load When | |-------|-----------|-----------| | RTOS Patterns | references/rtos-patterns.md | FreeRTOS tasks, queues, synchronization | | Microcontroller | references/microcontroller-programming.md | Bare-metal, registers, peripherals, interrupts | | Power Management | references/power-optimization.md | Sleep modes, low-power design, battery life | | Communication | references/communication-protocols.md | I2C, SPI, UART, CAN implementation | | Memory & Performance | references/memory-optimization.md | Code size, RAM usage, flash management |
volatile for hardware registers and ISR-shared variablesc/* Flag shared between ISR and task — must be volatile */ static volatile uint8_t g_uart_rx_flag = 0; static volatile uint8_t g_uart_rx_byte = 0; /* Keep ISR short: read hardware, set flag, exit */ void USART2_IRQHandler(void) { if (USART2->SR & USART_SR_RXNE) { g_uart_rx_byte = (uint8_t)(USART2->DR & 0xFF); /* clears RXNE */ g_uart_rx_flag = 1; } } /* Main loop or RTOS task processes the flag */ void process_uart(void) { if (g_uart_rx_flag) { __disable_irq(); /* enter critical section */ uint8_t byte = g_uart_rx_byte; g_uart_rx_flag = 0; __enable_irq(); /* exit critical section */ handle_byte(byte); } }
c#include "FreeRTOS.h" #include "task.h" #include "queue.h" #define SENSOR_TASK_STACK 256 /* words */ #define SENSOR_TASK_PRIO 2 static QueueHandle_t xSensorQueue; static void vSensorTask(void *pvParameters) { TickType_t xLastWakeTime = xTaskGetTickCount(); const TickType_t xPeriod = pdMS_TO_TICKS(10); /* 10 ms period */ for (;;) { /* Periodic, deadline-driven read */ uint16_t raw = adc_read_channel(ADC_CH0); xQueueSend(xSensorQueue, &raw, 0); /* non-blocking send */ /* Check stack headroom in debug builds */ configASSERT(uxTaskGetStackHighWaterMark(NULL) > 32); vTaskDelayUntil(&xLastWakeTime, xPeriod); } } void app_init(void) { xSensorQueue = xQueueCreate(8, sizeof(uint16_t)); configASSERT(xSensorQueue != NULL); xTaskCreate(vSensorTask, "Sensor", SENSOR_TASK_STACK, NULL, SENSOR_TASK_PRIO, NULL); vTaskStartScheduler(); }
c/* Demonstrates: clock enable, register-level GPIO, TIM2 interrupt */ #include "stm32f4xx.h" void TIM2_IRQHandler(void) { if (TIM2->SR & TIM_SR_UIF) { TIM2->SR &= ~TIM_SR_UIF; /* clear update flag */ GPIOA->ODR ^= GPIO_ODR_OD5; /* toggle LED on PA5 */ } } void blink_init(void) { /* GPIO */ RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN; GPIOA->MODER |= GPIO_MODER_MODER5_0; /* PA5 output */ /* TIM2 @ ~1 Hz (84 MHz APB1 × 2 = 84 MHz timer clock) */ RCC->APB1ENR |= RCC_APB1ENR_TIM2EN; TIM2->PSC = 8399; /* /8400 → 10 kHz */ TIM2->ARR = 9999; /* /10000 → 1 Hz */ TIM2->DIER |= TIM_DIER_UIE; TIM2->CR1 |= TIM_CR1_CEN; NVIC_SetPriority(TIM2_IRQn, 6); NVIC_EnableIRQ(TIM2_IRQn); }
When implementing embedded features, provide:
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-06 | pass→pass | 15,880 | 21,037 | +32% | 1 | 1 | 0% | 3,044 | 5,010 | +65% | 0 | 0 | — |
case-03 | fail→pass | 24,266 | 22,026 | -9% | 1 | 1 | 0% | 4,502 | 5,289 | +17% | 0 | 0 | — |
case-04 | pass→pass | 15,730 | 17,932 | +14% | 1 | 1 | 0% | 2,606 | 4,496 | +73% | 0 | 0 | — |
case-05 | pass→pass | 40,322 | 28,437 | -29% | 1 | 1 | 0% | 4,556 | 7,546 | +66% | 0 | 0 | — |
case-01 | fail→fail | 27,818 | 16,807 | -40% | 1 | 1 | 0% | 4,988 | 4,848 | -3% | 0 | 0 | — |
case-02 | fail→fail | 32,860 | 33,410 | +2% | 1 | 1 | 0% | 6,078 | 7,243 | +19% | 0 | 0 | — |
case-07 | fail→fail | 21,070 | 30,552 | +45% | 1 | 1 | 0% | 3,840 | 6,977 | +82% | 0 | 0 | — |
case-08 | fail→pass | 17,812 | 20,988 | +18% | 1 | 1 | 0% | 3,099 | 5,107 | +65% | 0 | 0 | — |
case-09 | fail→pass | 18,449 | 20,978 | +14% | 1 | 1 | 0% | 3,195 | 5,542 | +73% | 0 | 0 | — |
case-10 | fail→pass | 17,812 | 22,162 | +24% | 1 | 1 | 0% | 3,548 | 5,823 | +64% | 0 | 0 | — |
case-11 | fail→fail | 8,040 | 13,448 | +67% | 1 | 1 | 0% | 1,397 | 3,738 | +168% | 0 | 0 | — |
case-12 | fail→pass | 15,903 | 22,506 | +42% | 1 | 1 | 0% | 3,120 | 6,221 | +99% | 0 | 0 | — |
case-13 | fail→fail | 15,081 | 16,778 | +11% | 1 | 1 | 0% | 2,683 | 4,395 | +64% | 0 | 0 | — |
case-14 | pass→pass | 12,466 | 16,241 | +30% | 1 | 1 | 0% | 2,114 | 4,565 | +116% | 0 | 0 | — |
case-15 | fail→pass | 6,777 | 15,766 | +133% | 1 | 1 | 0% | 1,167 | 4,426 | +279% | 0 | 0 | — |
case-16 | pass→pass | 29,860 | 26,456 | -11% | 1 | 1 | 0% | 3,446 | 5,938 | +72% | 0 | 0 | — |
case-17 | fail→fail | 19,620 | 18,324 | -7% | 1 | 1 | 0% | 3,966 | 5,077 | +28% | 0 | 0 | — |
case-18 | pass→pass | 11,052 | 14,080 | +27% | 1 | 1 | 0% | 2,163 | 4,458 | +106% | 0 | 0 | — |
case-19 | fail→pass | 16,293 | 18,079 | +11% | 1 | 1 | 0% | 2,914 | 5,047 | +73% | 0 | 0 | — |
case-20 | fail→fail | 43,691 | 23,959 | -45% | 1 | 1 | 0% | 4,490 | 6,367 | +42% | 0 | 0 | — |
case-21 | fail→pass | 14,981 | 20,935 | +40% | 1 | 1 | 0% | 2,670 | 5,208 | +95% | 0 | 0 | — |
case-22 | pass→pass | 19,999 | 23,605 | +18% | 1 | 1 | 0% | 3,430 | 6,114 | +78% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +36 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.