Firmware & Embedded
Open with Cmd+Alt+F. Purpose-built for embedded engineers working with microcontrollers.
Source: src/vs/workbench/contrib/neuralInverseFirmware/
MCU Database
357+ MCU variants across 11 manufacturers:
| Manufacturer | Families |
|---|---|
| STMicroelectronics | STM32 F0, F1, F4, F7, L0, L4, H7, U5, C0, H5, WB, MP1 |
| Nordic Semiconductor | nRF52, nRF53 |
| Espressif | ESP32, ESP32-S3, ESP32-C3, ESP32-C6 |
| Raspberry Pi | RP2040 |
| NXP | i.MX RT, LPC, Kinetis, S32K |
| Microchip | SAM, PIC32, PIC24, PIC18, PIC16, AVR |
| Texas Instruments | C2000, MSP430, CC26xx, TM4C |
| Renesas | RA, RX, RL78 |
| Infineon | AURIX TC3xx, PSoC, XMC1, XMC4 |
| Ambiq | Apollo series |
| GigaDevice | GD32 |
Each entry includes: core type, max clock, flash/RAM sizes, FPU/MPU/DSP flags, GPIO count, peripheral list, memory map, and common dev boards.
Clock Constraint Tables
Every MCU family has a validated clock constraint table in engine/clockTree/clockTreeValidatorService.ts. Constraints include max SYSCLK, PLL input/VCO ranges, and APB divider restrictions. Families covered include TM4C, MSP430, XMC1/4, S32K, Apollo, MAX32, CC26xx, BL60x, Nuvoton, STM32C0/H5/MP1/U5/WB, PIC32, PIC24/18/16, RISC-V, and all FPGA families — no silent fallthrough to generic defaults.
Linker Script Generator
engine/memory/linkerScriptGenerator.ts produces correct .ld / .icf / .sct linker scripts for all 148 MCU families, with accurate flash/RAM origins and sizes. Notable specifics:
- AURIX: PMU cached PFlash starts at
0xA0000000(not0x80000000) - MSP430 Harvard: Flash
0xC000, RAM0x0200 - Each family uses its own verified base addresses — no STM32 defaults for other vendors
SVD Register Maps
CMSIS-SVD files are parsed on demand:
- Fetches SVD XML from CMSIS Pack Index or local cache
- Parses full peripheral trees with bit-field detail
- Handles
derivedFrominheritance at peripheral and register level - Expands clusters and dimension arrays
- Default value inheritance (size, access, resetValue)
Datasheet Intelligence
Drop a PDF datasheet and the agent extracts structured data:
- Extraction — PDF parsed page by page
- Classification — each page categorized (register map, timing, errata, pinout, electrical specs)
- LLM Reclassification — uncertain pages verified with LLM
- Caching — content-hash based, zero re-processing on re-open
- Citations — all extracted data links back to source page numbers
Hardware Instruments
The Instruments tab (firmwarePart.ts) provides four canvas-based panels for real hardware instruments. All panels use Canvas 2D or programmatic DOM (no innerHTML) to satisfy Trusted Types.
Logic Analyzer
File: engine/instruments/logicAnalyzer/logicAnalyzerService.ts
- Saleae Logic 2 — TCP automation API on port 10430
- Digilent WaveForms —
dwfpyPython subprocess - Canvas waveform renderer: dark navy (
#1a1a2e) background, one row per channel, time-grid with labels - Software protocol decoders (no dependency on Saleae's decoder API):
- UART NRZ — start bit detection, configurable baud rate, data/parity/stop
- I2C — SCL/SDA edge timing, address extraction, ACK/NACK, repeated start
- SPI — CPOL/CPHA modes, CS framing, byte assembly
- Decoded frames rendered in a grid table below the waveform
- Raw samples stored in
capture.rawSamples: Record<number, number[]>for offline re-decode
Power Analyzer
File: engine/instruments/powerAnalyzer/powerAnalyzerService.ts
- Nordic PPK2 — USB VID
1915/ PIDC00A,nrfjprog+ Python subprocess - Joulescope JS110 / JS220 —
joulescopePython subprocess - PPK2-style current graph: dark (
#0d1117) canvas, µA/mA Y-axis with auto-scale, min/max range band, avg line - 6-cell stats bar: AVG / MIN / MAX / PEAK / ENERGY / CHARGE
Oscilloscope
File: engine/instruments/oscilloscope/oscilloscopeService.ts
- Siglent SDS800X HD — SCPI over LAN, port 5025
- mDNS LXI discovery +
VOID_SCOPE_HOSTenv override for fixed IP - CRT-style canvas (
#001a00background, phosphor green waveform) - Trigger configuration (edge, level, source channel)
- Measurements bar: Pk-Pk, Mean, RMS
Combined Workflows
3-row grid with coordinated multi-instrument scenarios:
- Sleep current regression (PPK2 + GDB + Logic)
- I2C NACK hunt (Logic + GDB)
- Power-on sequence (scope trigger + logic capture)
Each workflow shows: instrument icon strip, center title/status dots/run button, right-side step list.
RTT (Real-Time Transfer)
File: engine/serial/rttService.ts
SEGGER J-Link RTT streaming via SWD/JTAG — zero-overhead printf without a UART peripheral.
- JLinkExe backend — spawns
JLinkExesubprocess with an RTT script file, streams stdout- Detects connection via
NumUpBuffers,RTT enabled,Connected to targetpatterns - Parses multiple JLink output formats for RTT terminal data
- Polls
rtterminal read 0every 100ms
- Detects connection via
- pylink backend —
pylink-squarePython subprocess, JSON-encoded frame stream, fallback if JLinkExe unavailable - Multi-channel support (up to 32 channels, up + down)
- 10,000-line ring buffer per channel
fw_rtt_start,fw_rtt_read,fw_rtt_write,fw_rtt_stopagent tools
Agent Tools
Available in sidebar chat and Power Mode when a firmware project is detected:
| Category | Tools |
|---|---|
| MCU Info | fw_get_mcu_info, fw_list_peripherals, fw_search_mcu |
| Registers | fw_get_register_map, fw_get_bit_field_info |
| Errata | fw_get_errata |
| Code Gen | fw_codegen_peripheral_init, fw_codegen_isr, fw_codegen_dma, fw_codegen_clock |
| Build | fw_build, fw_flash, fw_binary_size |
| Serial | fw_serial_monitor, fw_serial_send |
| Debug | fw_debug_break, fw_debug_step, fw_debug_memory_read, fw_debug_memory_write |
| RTT | fw_rtt_start, fw_rtt_read, fw_rtt_write, fw_rtt_stop |
| Compliance | fw_misra_check, fw_cert_c_check, fw_safety_audit |
| Pinout | fw_pinout_show, fw_pinout_check, fw_pinout_export |
Clock Codegen
fw_codegen_clock generates correct RCC/CMU/CGC init for every supported family. For unrecognized families it emits SDK-specific guidance rather than silently generating STM32 code.
GPIO Codegen
fw_codegen_gpio (inside codegenTools.ts) uses a per-architecture dispatch table. For families without an explicit handler, it generates architecture-appropriate pin config (e.g. RISC-V GPIO register writes, AVR DDR/PORT, PIC LAT/TRIS) instead of defaulting to STM32 HAL.
Serial Monitor
Built-in serial port communication:
- Web Serial API for browser-based access
- 10,000-line ring buffer
- Baud rate auto-detection
- Debug probe auto-detection (ST-Link, J-Link, CMSIS-DAP, FTDI, CH340)
- Send/receive with timestamp
Platform Knowledge Packs
Injected into every agent session when working on a supported platform:
| Platform | Context provided |
|---|---|
| STM32 | HAL/LL patterns, clock tree, DMA streams, NVIC priorities |
| ESP32 | ESP-IDF APIs, partition tables, WiFi/BLE patterns |
| nRF (Zephyr) | Zephyr device tree, BLE stack, power management |
| RP2040 | PIO state machines, DMA channels, multicore patterns |
Build System Integration
| Build System | Detection | Capabilities |
|---|---|---|
| PlatformIO | platformio.ini | Build, flash, monitor, library management |
| CMake | CMakeLists.txt | Build, flash (with probe config) |
| ESP-IDF | sdkconfig, idf.py | Build, flash, monitor, menuconfig |
| Make | Makefile | Build |
| Arduino | .ino files | Build, flash via Arduino CLI |
| Zephyr | prj.conf, west manifest | Build, flash, debug |
| Mbed | mbed_app.json | Build, flash |
Contributing
Key files:
| File | Purpose |
|---|---|
common/mcuDatabase.ts | MCU variant data (357+ entries) |
engine/clockTree/clockTreeValidatorService.ts | Per-family clock constraint tables |
engine/memory/linkerScriptGenerator.ts | Per-family linker script origins |
engine/svd/svdParserService.ts | SVD XML parser |
engine/agentTools/codegenTools.ts | Clock + GPIO codegen dispatch tables |
engine/agentTools/firmwareAgentToolService.ts | Tool definitions |
engine/instruments/logicAnalyzer/logicAnalyzerService.ts | Saleae/Digilent + software decoders |
engine/instruments/powerAnalyzer/powerAnalyzerService.ts | Nordic PPK2 / Joulescope |
engine/instruments/oscilloscope/oscilloscopeService.ts | Siglent SCPI |
engine/serial/rttService.ts | J-Link RTT (JLinkExe + pylink) |
engine/serial/serialMonitorService.ts | Serial port monitor |
engine/hardwareContext/hardwareContextProvider.ts | Context injection |
browser/ui/firmwarePart.ts | Instruments UI (canvas panels) |
To add a new MCU family: add an entry to mcuDatabase.ts, add clock constraints to clockTreeValidatorService.ts, add linker origins to linkerScriptGenerator.ts, and add a codegen case to codegenTools.ts.
Last edited