Hardware-aware diagnostics and intelligent memory analysis for embedded systems development. A VS Code extension that validates your code before compilation, catching hardware-specific errors that traditional IDEs miss. Works with any arduino-cli supported board.
Link to Open VSX: https://open-vsx.org/extension/RishiShah/sentinel-arduino
Link to VsCode Marketplace: https://marketplace.visualstudio.com/items?itemName=RishiShah.sentinel-arduino
Currently at 1.2K Downloads.
Sentinel provides real-time validation for embedded systems development through a custom Language Server Protocol implementation. Unlike traditional build-time error detection, Sentinel analyzes your code as you type, validating hardware constraints, memory usage, and protocol compliance before you ever hit compile.
Built for developers who need production-quality code without the overhead of complex toolchains. Zero configuration required - works with arduino-cli out of the box.
Sentinel performs static analysis to estimate RAM and Flash usage before compilation, providing instant feedback on memory constraints.
- Real-time estimation with ±3% accuracy compared to compiled output
- Tracks global variables, stack usage, and framework overhead
- Empirically calibrated for Arduino core libraries (Serial, Wire, SPI)
- Detects unused variables and suggests optimizations
- Framework-specific overhead calculation for WiFi and BLE on ESP32
- Visual memory bars with color-coded warnings at 70% and 90% thresholds
- Persistent memory tracking across workspace sessions
The memory analyzer uses static code analysis to calculate:
- Global variable allocation (arrays, structs, classes)
- Stack frame estimation based on function call depth
- Framework overhead (Serial: 175B, Wire: 196B, SPI: 20B)
- Dynamic allocation tracking (malloc, calloc, new)
Sentinel implements over 50 hardware-specific validation rules that catch errors before compilation.
- Address range validation (0x08-0x77 valid range)
- Reserved address detection (0x00-0x07, 0x78-0x7F)
- Device-specific address suggestions from hardware database
- 200+ known I2C devices with address autocomplete
- Conflict detection for multiple devices on same address
- Pull-up resistor warnings for I2C bus configuration
- Real-time tracking of all pin assignments (digital, analog, PWM, I2C, SPI, Serial)
- Conflict warnings for overlapping pin usage
- Intelligent comment handling - Commented-out code is automatically ignored during analysis
- ESP32 strapping pin warnings (GPIO0, GPIO2, GPIO12, GPIO15)
- Boot mode interference detection
- Arduino PWM pin validation (pins 3, 5, 6, 9, 10, 11 on Uno)
- UART/SPI protocol pin reservation tracking
- Visual indicators for pin status and conflicts
- Strapping pin usage warnings during boot
- WiFi and BLE simultaneous usage warnings (high RAM consumption)
- Deep sleep configuration validation
- Dual-core task pinning recommendations
- Core 0 WiFi stack conflict detection
- Long delay suggestions for power optimization
- SPI clock speed validation for target devices
- UART baud rate compatibility checking
- I2C clock stretching timeout warnings
- Protocol state machine validation
- Bus initialization order verification
Automatic visualization of all pin assignments with conflict detection.
- Tracks digital I/O, analog, PWM, I2C (SDA/SCL), SPI (MISO/MOSI/SCK), and Serial (RX/TX)
- Real-time conflict warnings for overlapping usage
- Color-coded status indicators (valid, warning, conflict)
- Board-specific pin mapping (Arduino Uno, Mega, ESP32)
- Automatic detection from pinMode, digitalWrite, analogRead, and library functions
- Visual pin map in sidebar with usage details
Detailed memory analysis after compilation with persistent data.
- Visual memory usage bars for Flash and RAM
- Percentage-based warnings with color coding
- Byte-level precision (used/total)
- Persistent across workspace switches
- No rebuild required to view cached data
- Historical tracking for memory optimization
Hardware-aware code completion and suggestions.
- I2C device address autocomplete (MPU6050: 0x68, BMP280: 0x76, etc.)
- Pin number suggestions based on selected board
- Protocol-specific parameter hints
- Device-specific register addresses
- Library function signatures with hardware context
- Board-aware syntax validation
Sentinel provides a dedicated sidebar panel with all diagnostic information:
- Live Memory Estimate - Real-time RAM usage with color-coded warnings
- Post-Build Memory - Flash and RAM bars after compilation
- Pin Usage Map - Visual representation of all pin assignments with conflict detection
- Top Global Variables - Lists largest memory consumers
- Build & Deploy - Quick access buttons for building and uploading
- Quick Actions - Board selection, port selection, and serial monitor
- Live RAM Display - Always-visible RAM percentage in status bar (on supported boards)
- Board Selector - Click to choose from any arduino-cli supported board
- Port Selector - Quick port selection with auto-detection
- Flash/Memory Display - Real-time memory tracking (on supported boards)
- Build Project - Compile current sketch with arduino-cli
- Flash Device - Upload compiled binary to selected board
All features accessible via Command Palette (Ctrl+Shift+P):
Sentinel: Build Project- Compile the current sketchSentinel: Flash Device- Upload to connected boardSentinel: Select Board- Choose from any arduino-cli supported boardSentinel: Select Port- Choose serial port (with auto-detection)Sentinel: Open Serial Monitor- View serial output in terminal
-
Install arduino-cli - Required for building and uploading sketches
- Windows: Download from https://arduino.github.io/arduino-cli/1.3/installation/
- macOS:
brew install arduino-cli - Linux:
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh
-
Install board cores - Required before compiling for a board
# Arduino boards (Uno, Mega, Nano, etc.) arduino-cli core install arduino:avr # ESP32 arduino-cli core install esp32:esp32 # ESP8266 arduino-cli core install esp8266:esp8266 # See all available: arduino-cli core search
-
Install libraries - Install any libraries your sketch uses
# Search for libraries arduino-cli lib search [library-name] # Install a library arduino-cli lib install "LibraryName" # Examples: arduino-cli lib install "Servo" arduino-cli lib install "Adafruit GFX Library" arduino-cli lib install "LiquidCrystal"
- VS Code Marketplace: Search for "Sentinel" or install from [marketplace link]
- Cursor IDE: Same extension works in Cursor
- From VSIX: Download
.vsixfile and runcode --install-extension sentinel-arduino-1.0.0.vsix
git clone https://github.com/RishiShah99/Sentinel.git
cd Sentinel
npm install
npm run compile
# Package: vsce packagePress F5 in VS Code to launch the Extension Development Host with Sentinel loaded.
- Install arduino-cli and ensure it's in your PATH
- Open any
.inoor.cppfile in VS Code - Select your target board from the status bar
- Sentinel automatically activates and begins analysis
- View diagnostics in the Sentinel sidebar (shield icon in activity bar)
- Use Build/Upload buttons in the editor title bar
src/
├── extension.ts # Extension host and command registration
└── sidebar-provider.ts # Webview UI and state management
embedded-lsp/
└── server/
├── main.js # Language server implementation
├── memory-analyzer.js # RAM/Flash estimation engine
├── pin-tracker.js # Pin usage detection
└── diagnostic-provider.js # Hardware-aware diagnostics
resources/
└── sentinel-icon.svg # Extension icon
snippets/
└── arduino.json # Code snippets for Arduino development
syntaxes/
└── arduino.tmLanguage.json # Syntax highlighting for .ino files
- VS Code 1.85.0 or higher
- Arduino CLI (for building and uploading)
- Node.js 16+ (for development)
Sentinel works with any board supported by arduino-cli, including:
- Arduino (Uno, Mega, Nano, Leonardo, Due, etc.)
- ESP32 (all variants: ESP32, ESP32-S2, ESP32-S3, ESP32-C3)
- ESP8266
- Raspberry Pi Pico
- STM32 boards
- SAMD boards (Arduino Zero, MKR series)
- And many more - if arduino-cli supports it, Sentinel can build and upload to it
- Arduino Uno - Complete support for all features including live memory analysis, pin usage maps, and hardware validation
- Arduino Mega - Full memory and pin tracking support
- ESP32 - Hardware validation and diagnostics (memory analysis coming soon)
Note: Advanced features like live memory analysis and pin tracking are currently optimized for Arduino AVR boards. All boards support build, upload, and basic diagnostics.
# Install dependencies
npm install
# Compile TypeScript
npm run compile
# Watch mode for development
npm run watch
# Package extension
vsce packageSentinel implements a custom LSP server that provides real-time diagnostics, code completion, and hover information. The server analyzes code as you type, maintaining an in-memory representation of your hardware configuration and validating against board-specific constraints.
The LSP architecture enables:
- Sub-100ms response time for diagnostics
- Incremental parsing for large codebases
- Cross-file symbol resolution
- Hardware state tracking across multiple files
The memory analyzer performs multi-pass static analysis to estimate RAM and Flash usage with production-level accuracy.
Analysis Pipeline:
- Global Variable Detection - Scans for all global declarations (primitives, arrays, structs, classes)
- Usage Analysis - Tracks read/write operations to eliminate unused variables
- Stack Estimation - Calculates stack frames based on function call depth and local variables
- Framework Overhead - Adds empirically measured overhead for Arduino libraries
- Dynamic Allocation - Tracks malloc, calloc, and new operations
Calibration Methodology:
- Tested against 100+ real Arduino sketches
- Empirically measured framework overhead through controlled builds
- Validated against actual memory usage from .map files
- Continuous refinement based on compiler behavior
The pin tracker maintains a real-time map of all pin assignments, detecting conflicts and validating against board specifications.
Detection Methods:
- Direct pin functions (pinMode, digitalWrite, digitalRead, analogRead, analogWrite)
- Library-specific pins (Wire.begin for I2C, SPI.begin for SPI)
- Serial port detection (Serial, Serial1, Serial2)
- Interrupt pin validation (attachInterrupt)
- PWM capability checking
Conflict Resolution:
- Tracks pin mode (INPUT, OUTPUT, INPUT_PULLUP)
- Detects multiple assignments to same pin
- Validates protocol-specific pin requirements
- Warns about hardware limitations (PWM channels, analog pins)
Sentinel includes a comprehensive hardware database with specifications for:
- 200+ I2C devices with addresses and register maps
- Arduino board pin mappings (Uno, Mega, Nano, Leonardo)
- ESP32 variants with GPIO capabilities
- Protocol specifications (I2C, SPI, UART)
- Common sensor configurations
Traditional embedded IDEs focus on compilation and uploading. Sentinel focuses on validation and intelligence. While other tools tell you what went wrong after compilation, Sentinel prevents errors before they happen.
Key Advantages:
- Instant Feedback - See errors as you type, not after compilation
- Hardware Intelligence - Understands your board's constraints and capabilities
- Zero Configuration - No complex setup or configuration files
- Native Integration - Built for VS Code
- Production Ready - Validation rules based on real-world embedded development
Sentinel is designed for developers who value code quality and want to catch hardware-specific bugs early in the development cycle. Works with any arduino-cli supported board - from Arduino Uno to ESP32, STM32 to Raspberry Pi Pico. Sentinel provides the intelligence layer that traditional toolchains lack.
Planned features for upcoming releases:
- Live memory analysis for all board types (currently optimized for Arduino AVR)
- ESP32 memory tracking (IRAM, DRAM, PSRAM)
- Pin usage maps for all board architectures
- Framework overhead calculation for WiFi and BLE libraries
- Real-time oscilloscope and logic analyzer integration
- Serial plotter for sensor data visualization
- Library dependency analyzer
- Power consumption estimation
- Custom board definition support
- Multi-board project management
Contributions are welcome. Please open an issue or pull request for bugs, features, or improvements.