velxio/frontend/src/utils
David Montero Crespo 4e9bf09e65 feat: load precompiled firmware files (.hex, .bin, .elf) directly
Closes #1

Add the ability to upload precompiled firmware files directly into the
emulator, bypassing the built-in compilation step. This enables users
with custom toolchains (ESP-IDF, PlatformIO, ASM workflows) to use
Velxio purely as an emulation/debugging environment.

New features:
- "Upload firmware" option in the overflow menu (accepts .hex, .bin, .elf)
- Automatic format detection from file extension and magic bytes
- ELF parser extracts PT_LOAD segments and detects target architecture
  (AVR, ARM, RISC-V, Xtensa) from ELF e_machine header
- Architecture mismatch warnings logged when ELF target differs from
  current board (non-blocking — upload proceeds anyway)
- Firmware routed to the correct simulator loader via existing
  compileBoardProgram() — no simulator changes needed

Supported formats per board:
- AVR (Uno/Nano/Mega/ATtiny85): .hex (direct), .elf (parsed → HEX)
- RP2040 (Pico): .bin (direct), .elf (parsed → binary)
- ESP32-C3: .bin (direct), .hex, .elf (parsed → binary)
- ESP32/S3 (QEMU): .bin (direct), .elf (parsed → binary)

New file: frontend/src/utils/firmwareLoader.ts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-29 02:08:11 -03:00
..
analytics.ts feat: add zoom support for touch interactions and enhance pin hit targets 2026-03-28 00:31:00 -03:00
boardPinMapping.ts feat: enhance simulator interfaces and add ESP32 bridge shim for improved component interaction 2026-03-22 02:25:58 -03:00
captureCanvasPreview.ts feat: Enhance simulator with new components and event handling 2026-03-04 13:36:33 -03:00
compilationLogger.ts Refactor simulator store to unify serial data handling and add board pin mapping utility 2026-03-05 21:07:03 -03:00
esp32ImageParser.ts Add bare-metal ESP32-C3 blink example with simulator support 2026-03-15 18:40:08 -03:00
firmwareLoader.ts feat: load precompiled firmware files (.hex, .bin, .elf) directly 2026-03-29 02:08:11 -03:00
generateExamplePreview.tsx feat: Enhance simulator with new components and event handling 2026-03-04 13:36:33 -03:00
hexParser.ts feat: Implement Arduino Simulator with component management and simulation features 2026-03-03 00:20:49 -03:00
pinPositionCalculator.ts feat: update pin mappings and descriptions for Raspberry Pi Pico examples 2026-03-21 14:02:46 -03:00
reservedUsernames.ts feat: implement user authentication and project management features 2026-03-06 10:14:50 -03:00
useSEO.ts feat: update SEO handling across various pages, enhance mobile tab navigation, and improve .gitignore for sensitive files 2026-03-23 17:15:29 -03:00
wireColors.ts Add backend and frontend test suites for Arduino compilation and simulation 2026-03-03 16:44:07 -03:00
wireHitDetection.ts feat: implement segment dragging functionality in simulator canvas 2026-03-14 23:09:32 -03:00
wireOffsetCalculator.ts feat: enhance wire offset calculation to maintain pin connections with L-shaped stubs 2026-03-05 21:33:02 -03:00
wirePathGenerator.ts feat: Implement interactive wire rendering with segment-based dragging and snapping capabilities. 2026-03-07 13:34:25 -03:00
wireSegments.ts feat: Implement interactive wire rendering with segment-based dragging and selection using new `WireRenderer` component and `wireSegments` utilities. 2026-03-07 13:34:42 -03:00
wireUtils.ts Refactor wire management and rendering logic 2026-03-14 22:55:13 -03:00
wokwiZip.ts Refactor wire management and rendering logic 2026-03-14 22:55:13 -03:00