brainstorming
brainstorming
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).
embedded-firmwareEmbedded firmware and device drivers — BSP development, peripheral driver implementation (UART, SPI, I2C, GPIO, DMA, Timer), RTOS integration (FreeRTOS, Zephyr), and system validation. Use when writing chip bring-up firmware, implementing HAL drivers, porting an RTOS, or validating firmware on hardware.
Independent GitHub snapshot · Automated classification · Original documentation governs
When this skill is loaded and a user presents a firmware or BSP task, do not
execute stages directly. Immediately spawn the
digital-chip-design-agents:firmware-orchestrator agent and pass the full user
request and any available context to it. The orchestrator enforces the stage
sequence, loop-back rules, and sign-off criteria defined below.
Use the domain rules in this file only when the orchestrator reads this skill mid-flow for stage-specific guidance, or when the user asks a targeted reference question rather than requesting a full flow execution.
Before executing or advising on any stage, read the following files if they exist:
memory/firmware/knowledge.md — known failure patterns, successful tool flags, PDK/tool quirks.
Incorporate its guidance into every stage decision. If absent, proceed without it.memory/firmware/run_state.md — current run identity (run_id, design_name, tool,
last_stage). Use this to resume correctly after interruption. If absent, a new run
is starting; the orchestrator will create this file before the first stage.This pre-run read applies whether this skill is loaded by a user or called by the orchestrator mid-flow. It ensures the fix database is consulted before any diagnosis step.
Guide BSP creation, peripheral driver development, RTOS integration, and system-level firmware validation. The firmware layer is the first software to run on real silicon — correctness here enables all subsequent SW development.
arm-none-eabi-gcc, riscv64-unknown-elf-gcc) — bare-metal firmware compilationopenocd) — open-source on-chip debugger; supports JTAG/SWD for bring-uparm-none-eabi-gdb) — source-level debugging over OpenOCDqemu-system-arm, qemu-system-riscv64) — firmware validation before hardware is availableJLinkGDBServer, dialect segger) — high-speed JTAG/SWD probe from SEGGERt32marm, dialect lauterbach) — hardware trace and debug for bring-uparmds, dialect arm) — Eclipse-based IDE with Arm compiler and debuggercrt0.S/startup.c) must in order:
__stack_top (from linker script).data LMA → VMA.bssSystemInit()main()SystemInit() order: power stable → PLLs → clock mux → peripheralsmemory_map.h: ALL peripheral base addresses and register offsets — no magic numbersvolatile pointer dereferencemain() within expected startup time.data initialised; .bss zeroed (verify with memory read)| Issue | Fix |
|---|---|
| PLL not locking | Check reference clock source; verify input frequency range |
Hang before main() | Toggle debug LED at each init step to isolate |
| Stack overflow at boot | Increase STACK_SIZE in linker script |
.data not initialised | Verify crt0 LMA→VMA copy range; check AT clause |
startup.S and system_init.cmemory_map.h (complete register definitions)status_t PERIPH_Init(PERIPH_Type *base, const periph_config_t *config);
status_t PERIPH_WriteBlocking(PERIPH_Type *base, const uint8_t *data, size_t len);
status_t PERIPH_TransferNonBlocking(PERIPH_Type *base, periph_handle_t *h, periph_xfer_t *x);
void PERIPH_HandleIRQ(PERIPH_Type *base, periph_handle_t *handle);
memory_map.h — no inline hex addressesstatus_t — never void for operationssuspend()/resume() hooks for low-power modes| Peripheral | Key Tests |
|---|---|
| UART | Baud rate, parity, TX/RX loopback, DMA |
| SPI | All 4 modes, master/slave loopback, DMA |
| I2C | 7/10-bit addressing, repeated start, DMA |
| GPIO | Input/output, pull resistors, edge interrupt |
| Timer | Periodic, one-shot, PWM, input capture |
| DMA | Channel config, completion callback, scatter-gather |
| Watchdog | Init, refresh (kick), triggered reset |
portmacro.h for target architectureheap_4.c (best-fit with coalescence)uxTaskGetStackHighWaterMark(); add 20% marginconfigCHECK_FOR_STACK_OVERFLOW: set to 2 during developmentFromISR FreeRTOS API from within ISRFreeRTOSConfig.h configured for target| Level | Tests | Environment |
|---|---|---|
| Unit | Peripheral loopback | Bare-metal on HW |
| Integration | Multi-peripheral DMA chains | RTOS on HW |
| System | Full application scenario | RTOS on HW |
| Stress | 24-hour high-throughput | Overnight on HW |
After each stage completes (regardless of whether an orchestrator session is active),
write or overwrite one JSON record in memory/firmware/experiences.jsonl keyed by
run_id. This ensures data is persisted even if the flow is interrupted or called
without full orchestrator context.
Use run_id = firmware_<YYYYMMDD>_<HHMMSS> (set once at flow start; reuse on each
stage update). Set signoff_achieved: false until the final sign-off stage completes.
Write memory/firmware/run_state.md as the first action before launching any tool:
run_id: firmware_<YYYYMMDD>_<HHMMSS>
design_name: <design>
tool: <primary tool>
start_time: <ISO-8601>
last_stage: <first stage name>
Update last_stage after each stage completes. This file lets wakeup-loop prompts
and resumed sessions identify the correct run without relying on in-memory state.
Create the file and parent directories if they do not exist.
If mcp__plugin_ecc_memory__add_observations is available in this session, emit each
applied fix as an observation to entity chip-design-firmware-fixes after writing to
experiences.jsonl. Skip silently if the tool is absent — JSONL is the canonical record.