velxio/backend/app/services
David Montero 22de488de2 feat(microsd): SD-over-SPI card storage for AVR, RP2040 and ESP32
Add a working microSD card part backed by a FAT16 image, following the
Wokwi storage model: the project's own workspace files are auto-copied
onto the card (free), and an optional "SD Card" panel uploads extra
files (gated as a paid feature by the velxio.dev overlay; OSS default
allows it).

Frontend (in-browser AVR / RP2040):
- ProtocolParts.ts: rewrite the microsd-card part from a handshake stub
  into a real SD-over-SPI device (reply-first Ncr timing, SDSC byte
  addressing, single/multi-block read+write, CSD/CID, full CMD set).
- utils/fatImage.ts: dependency-free FAT16 super-floppy builder (8.3 + LFN).
- utils/sdCardFiles.ts: assemble the card image from workspace files plus
  uploaded files; base64 helpers.
- components/simulator/SdCardPanel.tsx + ComponentPropertyDialog: upload UI.
- DynamicComponent + useSimulatorStore: build and inject the image on run.
- lib/proSdCardGate.ts: overlay-installable gate for the upload action.
- data/examples-storage-microsd.ts: Arduino Uno + ESP32 gallery examples.

Backend (ESP32 via QEMU):
- services/esp32_sd_slave.py: synchronous SD-over-SPI slave (Python port of
  the browser part) with a sparse backing store, idle-state R1 tracking and
  real CRC16 on data blocks when the host enables CRC (CMD59) -- both
  required by ESP-IDF's sdspi driver.
- esp32_worker.py: route SPI bytes to the slave (returns MISO synchronously)
  and feed write-only bulk transfers.
- esp32_lib_manager.py + routes/simulation.py: forward the FAT image
  (sd_card.image_b64) from the start config into the worker.

Tested:
- frontend: protocol-parts, fat-image, sd-card-gate and microsd-real-firmware
  (real Arduino SD.h on avr8js) -- 86 passing.
- backend: test_esp32_sd_slave (10) covering the ESP-IDF init sequence and
  CRC16; validated end to end by running a real SD.h sketch in libqemu-xtensa
  (mount, directory listing, read and write-readback).
2026-06-11 03:59:53 +02:00
..
boot_images
esp-idf-template fix(esp32): enable mbedTLS PSK so WiFiClientSecure/HTTPClient link 2026-06-10 20:50:48 +02:00
picow_net
__init__.py
arduino_cli.py feat(P2.1h): Library Manager 'Installed' list reads the cache, not the global volume 2026-06-08 06:14:17 +02:00
asm8080.py
asmz80.py
board_access.py feat: STM32 (Blue Pill / Black Pill) QEMU emulation + Pro board gating 2026-05-30 19:06:14 -03:00
c_compile.py fix(c-compile): drop --code-loc 0x100 that overwrote SDCC's crt0 init (Z80) 2026-06-03 20:11:01 +02:00
chip_compile.py
esp32_flash_image.py
esp32_i2c_slaves.py
esp32_lib_bridge.py
esp32_lib_manager.py feat(microsd): SD-over-SPI card storage for AVR, RP2040 and ESP32 2026-06-11 03:59:53 +02:00
esp32_sd_slave.py feat(microsd): SD-over-SPI card storage for AVR, RP2040 and ESP32 2026-06-11 03:59:53 +02:00
esp32_signals.py
esp32_spi_slaves.py feat(epaper): decode the UC8179/GD7965 7.5" panel + fix its BUSY polarity 2026-06-04 23:45:37 -03:00
esp32_worker.py feat(microsd): SD-over-SPI card storage for AVR, RP2040 and ESP32 2026-06-11 03:59:53 +02:00
esp_qemu_manager.py
espidf_compiler.py fix(esp32): enable mbedTLS PSK so WiFiClientSecure/HTTPClient link 2026-06-10 20:50:48 +02:00
gpio_shim.py
picow_net_bridge.py
qemu_manager.py feat: STM32 (Blue Pill / Black Pill) QEMU emulation + Pro board gating 2026-05-30 19:06:14 -03:00
rom_compile.py
signal_router.py
stm32_lib_manager.py feat(boards): add 6 STM32 boards (F4 Discovery, Olimex H405, Netduino 2/+2, Pill variants) 2026-05-31 03:19:26 -03:00
stm32_worker.py feat: STM32 (Blue Pill / Black Pill) QEMU emulation + Pro board gating 2026-05-30 19:06:14 -03:00
wasm_chip_runtime.py
wasm_chip_slave.py
wifi_status_parser.py