From a12101b1b1fe7207836ea7bafaaa805c416e3469 Mon Sep 17 00:00:00 2001 From: Frank Loesche Date: Wed, 15 Jul 2026 15:10:15 -0400 Subject: [PATCH 1/2] format the SD instead of deleting files --- arena_console.html | 8 ++++---- arena_studio.html | 9 +++++---- js/arena-wire-g6.js | 12 +++++++----- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/arena_console.html b/arena_console.html index 2c2e4c8..7b0014f 100644 --- a/arena_console.html +++ b/arena_console.html @@ -1434,7 +1434,7 @@ > SD card + title="Format the SD card - wipes patterns, firmware image, and manifests (PURGE_MEMORY 0x8F)">xXx { if (!session.connected) return; - if (!confirm('Delete ALL patterns from SD card? This cannot be undone.')) return; + if (!confirm('Format the SD card? This wipes ALL patterns, the panel firmware image, and manifests. This cannot be undone.')) return; const resp = await run( - 'delete-all-patterns', - Wire.encodeDeleteAllPatterns(), + 'purge-memory', + Wire.encodePurgeMemory(), (r) => (r && r.ok ? 'done' : null), { timeoutMs: 30000 } ); diff --git a/arena_studio.html b/arena_studio.html index e4d407a..a11f73a 100644 --- a/arena_studio.html +++ b/arena_studio.html @@ -2661,7 +2661,7 @@

Import error

- + @@ -4770,7 +4770,7 @@

Import error

} Studio.clearConsoleAutoStop = clearAutoStop; // Run-path pre-emption (module block) - // The firmware refuses SD-write + ISP commands (0x8D/0xE0/0x8A/0xC8/0xC9) + // The firmware refuses SD-write + ISP commands (0x8D/0xE0/0x8A/0x8F/0xC8/0xC9) // unless the display is stopped (state ALL_OFF — CE_DISPLAY_ACTIVE with // "Stop display before …" otherwise). STOP_DISPLAY also BLANKS the panels // (they latch their last frame, so the controller pushes a dark frame). @@ -4898,8 +4898,9 @@

Import error

}, csdpurge: () => guardDestructive(async () => { if (!connected()) return; - if (!confirm('Delete ALL patterns from the SD card? This cannot be undone.')) return; - const r = await send(Wire.encodeDeleteAllPatterns(), 'DELETE_ALL_PATTERNS 0x8F', { timeoutMs: 30000 }); + if (!confirm('Format the SD card? This wipes ALL patterns, the panel firmware image, and manifests. This cannot be undone.')) return; + await quiesceDisplay(); // 0x8F requires the display stopped + const r = await send(Wire.encodePurgeMemory(), 'PURGE_MEMORY 0x8F', { timeoutMs: 30000 }); if (r && Wire.decodeResponse(r) && Wire.decodeResponse(r).ok) sdRefresh(); }), // panel firmware diff --git a/js/arena-wire-g6.js b/js/arena-wire-g6.js index ae8bad3..61adf46 100644 --- a/js/arena-wire-g6.js +++ b/js/arena-wire-g6.js @@ -57,7 +57,7 @@ const ArenaWireG6 = (function () { GET_PATTERN_FILE: 0x84, // [03 84 idx_lo idx_hi] 1-based; response: uint64 LE size, then raw bytes SET_PATTERN_FILE: 0x85, // [0x85, idx_lo, idx_hi, len64 LE, data…] upload file (bulk stream) DELETE_PATTERN_FILE: 0x86, // [03 86 idx_lo idx_hi] delete 1-based pattern; idx=0 deletes pattern.temp - DELETE_ALL_PATTERNS: 0x8f, // [01 8F] delete all files in /patterns + PURGE_MEMORY: 0x8f, // [01 8F] format the SD card (wipes everything, not just /patterns) GET_SD_ARCHIVE: 0x8a, // [01 8A] stream full SD as ZIP; only in ALL_OFF state STOP_DISPLAY: 0x30, STREAM_FRAME: 0x32, // host-streamed full frame ("FR"+blocks; see encodeStreamFrame) @@ -507,9 +507,11 @@ const ArenaWireG6 = (function () { return frame(OPCODES.GET_PATTERN_FILE, u16le(index, 'index')); // 03 84 lo hi } - // delete-all-patterns (0x8F) — delete every file in /patterns. - function encodeDeleteAllPatterns() { - return frame(OPCODES.DELETE_ALL_PATTERNS); // 01 8F + // purge-memory (0x8F) — format the SD card (wipes everything, not just + // /patterns: also /firmware/panel.bin and both manifests). Much slower + // than the per-file delete it replaced; give it a generous timeout. + function encodePurgeMemory() { + return frame(OPCODES.PURGE_MEMORY); // 01 8F } // delete-pattern-file (0x86) — delete the pattern at 1-based index. @@ -853,7 +855,7 @@ const ArenaWireG6 = (function () { encodeGetPatternFile, encodeSetPatternFile, encodeDeletePatternFile, - encodeDeleteAllPatterns, + encodePurgeMemory, encodeGetSdArchive, encodeSetFirmwareFile, encodeGetFirmwareInfo, From f6732aa5d5e9b5329f074d0f49fc1a01b40a261e Mon Sep 17 00:00:00 2001 From: Frank Loesche Date: Wed, 15 Jul 2026 15:27:31 -0400 Subject: [PATCH 2/2] update help --- arena_studio.html | 2 +- docs/development/arena-studio-wireframe-v6.html | 2 +- js/arena-wire-g6.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arena_studio.html b/arena_studio.html index 16de364..a7f35d7 100644 --- a/arena_studio.html +++ b/arena_studio.html @@ -14930,7 +14930,7 @@

Import error

'[data-cmd="csdlist"]': 'Re-read the memory card’s pattern list.', '[data-cmd="cpatinfo"]': 'Ask the arena again about the selected pattern (frames, size).', '[data-cmd="csdarchive"]': 'Download every pattern on the card as one ZIP file.', - '[data-cmd="csdpurge"]': 'Delete ALL patterns from the card. It will ask first.', + '[data-cmd="csdpurge"]': 'Erase everything on the memory card, patterns, panel firmware, all of it, by reformatting it. It will ask first.', '[data-cmd="cmemsd"]': 'Show the patterns on the SD memory card.', '[data-cmd="cmempsram"]': 'Show the patterns in the controller’s RAM.', '#cPatThumb': 'Preview of the selected pattern — hover to animate multi-frame patterns.', diff --git a/docs/development/arena-studio-wireframe-v6.html b/docs/development/arena-studio-wireframe-v6.html index a8915bd..8db33c8 100644 --- a/docs/development/arena-studio-wireframe-v6.html +++ b/docs/development/arena-studio-wireframe-v6.html @@ -710,7 +710,7 @@

Sequence · test any single condition ▶ - +
diff --git a/js/arena-wire-g6.js b/js/arena-wire-g6.js index 61adf46..373796c 100644 --- a/js/arena-wire-g6.js +++ b/js/arena-wire-g6.js @@ -507,7 +507,7 @@ const ArenaWireG6 = (function () { return frame(OPCODES.GET_PATTERN_FILE, u16le(index, 'index')); // 03 84 lo hi } - // purge-memory (0x8F) — format the SD card (wipes everything, not just + // purge-memory (0x8F): format the SD card (wipes everything, not just // /patterns: also /firmware/panel.bin and both manifests). Much slower // than the per-file delete it replaced; give it a generous timeout. function encodePurgeMemory() {