diff --git a/frontend/src/lib/proBoardRegistry.ts b/frontend/src/lib/proBoardRegistry.ts index f8897411..81c63e4b 100644 --- a/frontend/src/lib/proBoardRegistry.ts +++ b/frontend/src/lib/proBoardRegistry.ts @@ -54,7 +54,7 @@ export interface ProBoardDef { /** ESP32 run-path routing: the base chip the board carries. Routes the run * through the ESP32 bridge path and picks the machine/engine type. Omit for * boards that provide createSimulator (RP2350 class) or AVR/RP2040. */ - esp32Family?: 'esp32' | 'esp32-s3' | 'esp32-c3' | 'esp32-c6'; + esp32Family?: 'esp32' | 'esp32-s3' | 'esp32-c3' | 'esp32-c6' | 'esp32-p4' | 'esp32-c5'; /** QEMU-Linux run-path routing: route this kind through the Raspberry Pi * bridge (backend qemu WebSocket, VFS panel, boot terminal). The overlay * must also register a matching backend profile for the kind. */ diff --git a/frontend/src/simulation/Esp32Bridge.ts b/frontend/src/simulation/Esp32Bridge.ts index ac95d40c..03465662 100644 --- a/frontend/src/simulation/Esp32Bridge.ts +++ b/frontend/src/simulation/Esp32Bridge.ts @@ -45,6 +45,15 @@ import { generateUUID } from '../utils/uuid'; export function toQemuBoardType(kind: BoardKind): 'esp32' | 'esp32-s3' | 'esp32-c3' | 'esp32-c6' { // Overlay-registered boards carry their base chip in the registry. const proFam = getProBoard(kind)?.esp32Family; + // Chips with NO QEMU machine anywhere (backend esp_qemu_manager knows + // esp32/s3/c3 only; c6 is at least mapped): reaching this bridge means the + // JS engine was skipped for a chip that has no other path — fail loudly + // instead of booting the wrong machine and wedging on the first register. + if (proFam === 'esp32-p4' || proFam === 'esp32-c5') { + throw new Error( + `${kind}: the ${proFam} has no QEMU machine - it runs only on its in-browser engine`, + ); + } if (proFam) return proFam; if (kind === 'esp32-s3' || kind === 'xiao-esp32-s3' || kind === 'arduino-nano-esp32') return 'esp32-s3';