From aca52925b729c08ea604ef7c58c1e0220b73195b Mon Sep 17 00:00:00 2001 From: Corey Thompson Date: Sat, 3 Jan 2026 09:39:04 -0600 Subject: [PATCH 1/3] Fix: Include Flash Firmware.bat and flash_firmware.ps1 in release package MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The build_release.sh script was not copying the new flash tool files to the release directory. This caused v1.0.5 releases to be missing the Quick Flash Tool files even though they were in the git repository. Now build_release.sh properly copies: - Flash Firmware.bat (Windows launcher) - flash_firmware.ps1 (PowerShell flash script) To the root of the release package, making them immediately available when users extract the release ZIP. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Haiku 4.5 --- build_release.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build_release.sh b/build_release.sh index 547c7e5..7aec5cd 100644 --- a/build_release.sh +++ b/build_release.sh @@ -70,6 +70,12 @@ mkdir -p "$OUTPUT_DIR/firmware/tools" mkdir -p "$OUTPUT_DIR/tools" mkdir -p "$OUTPUT_DIR/source" +# Copy flash tools +echo "Copying flash tools..." +cp "$SCRIPT_DIR/Flash Firmware.bat" "$OUTPUT_DIR/" +cp "$SCRIPT_DIR/flash_firmware.ps1" "$OUTPUT_DIR/" +chmod +x "$OUTPUT_DIR/flash_firmware.ps1" + # Copy upload tools for compiling from source echo "Copying upload tools..." cp "$SCRIPT_DIR/upload_firmware.sh" "$OUTPUT_DIR/tools/" From 0161142ed64234fb19b98877adc3718e43b65400 Mon Sep 17 00:00:00 2001 From: Corey Thompson Date: Sat, 3 Jan 2026 10:46:11 -0600 Subject: [PATCH 2/3] Fix: Correct Windows batch file syntax for else-if condition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The batch file was using 'else if' which is not valid Windows batch syntax. Changed to nested 'else ( if ... )' structure which is the correct syntax. This fixes the 'or was unexpected at this time' error when running Flash Firmware.bat on Windows. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Haiku 4.5 --- Flash Firmware.bat | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/Flash Firmware.bat b/Flash Firmware.bat index 5ae3ab6..f785bbf 100644 --- a/Flash Firmware.bat +++ b/Flash Firmware.bat @@ -21,23 +21,25 @@ if exist "%~dp0flash_firmware.ps1" ( echo Launching flash tool... echo. PowerShell -ExecutionPolicy Bypass -File "%~dp0flash_firmware.ps1" -) else if exist "%~dp0tools\flash_firmware.ps1" ( - echo Launching flash tool... - echo. - PowerShell -ExecutionPolicy Bypass -File "%~dp0tools\flash_firmware.ps1" ) else ( - echo. - echo ERROR: flash_firmware.ps1 not found! - echo. - echo Make sure you extracted the entire release ZIP file with - echo all directories and files intact. - echo. - echo The flash script should be at: - echo - flash_firmware.ps1 (in release root), or - echo - tools\flash_firmware.ps1 (in release tools folder) - echo. - pause - exit /b 1 + if exist "%~dp0tools\flash_firmware.ps1" ( + echo Launching flash tool... + echo. + PowerShell -ExecutionPolicy Bypass -File "%~dp0tools\flash_firmware.ps1" + ) else ( + echo. + echo ERROR: flash_firmware.ps1 not found! + echo. + echo Make sure you extracted the entire release ZIP file with + echo all directories and files intact. + echo. + echo The flash script should be at: + echo - flash_firmware.ps1 (in release root), or + echo - tools\flash_firmware.ps1 (in release tools folder) + echo. + pause + exit /b 1 + ) ) if %ERRORLEVEL% NEQ 0 ( From abaa3d41259017e6c4641202bd1edca072337937 Mon Sep 17 00:00:00 2001 From: Corey Thompson Date: Sat, 3 Jan 2026 10:49:02 -0600 Subject: [PATCH 3/3] Simplify UX: Move compile method to tools/ folder, emphasize flash method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hide the advanced compile/upload method from casual users by: - Moving Upload Firmware (Windows).bat to tools/ folder - Renaming to Compile Firmware (Windows).bat for clarity - Updating build_release.sh to package accordingly - Restructuring UPLOAD_GUIDE.md to show flash first, compile in "Advanced" section - Updating README.txt to emphasize Flash Firmware.bat as main method This reduces confusion for non-technical field users who should use the simple "Flash Firmware.bat" (10 seconds) instead of the advanced compile method (60+ seconds). Root folder now only shows: - Flash Firmware.bat (main method) - README.txt (quick start) - UPLOAD_GUIDE.md (documentation) Advanced tools in tools/ folder: - Compile Firmware (Windows).bat - upload_firmware.sh - upload_firmware.ps1 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Haiku 4.5 --- UPLOAD_GUIDE.md | 28 ++++++++++------------------ build_release.sh | 21 ++++++++++----------- 2 files changed, 20 insertions(+), 29 deletions(-) diff --git a/UPLOAD_GUIDE.md b/UPLOAD_GUIDE.md index d3de1b1..5a8c541 100644 --- a/UPLOAD_GUIDE.md +++ b/UPLOAD_GUIDE.md @@ -25,21 +25,11 @@ Each release includes: --- -## Upload Firmware - Two Methods - -There are two ways to update your controller's firmware: - -### **Method 1: Quick Flash (RECOMMENDED - 10 seconds)** - -Pre-compiled firmware flashes instantly. **This is the easiest method.** - -### **Method 2: Compile from Source (Advanced - 60+ seconds)** - -Compile the Arduino source code on your computer. For developers or customization. +## Flash Your Firmware --- -## Method 1: Quick Flash (RECOMMENDED) +## Standard Method: Quick Flash (Recommended) Pre-compiled firmware is ready to flash instantly - no compilation needed! @@ -63,19 +53,21 @@ Flashing writes the firmware directly to your controller's memory using pre-comp --- -## Method 2: Compile from Source (Advanced) +## For Advanced Users & Developers -For developers who want to modify the firmware or use the full development environment. +### Compile Firmware from Source Code -This method compiles the Arduino code fresh each time, taking 30-60 seconds longer than flashing. +If you need to modify the firmware or want the full Arduino development environment, you can compile from source instead of flashing pre-compiled binaries. This takes 60+ seconds instead of ~10 seconds. --- ### Windows - Compile from Source 1. **Download the SledLink folder** to your computer -2. **Double-click** `Upload Firmware (Windows).bat` -3. **Follow the prompts** on screen +2. **Extract the ZIP file** to a convenient location +3. **Open the `tools` folder** in the release package +4. **Double-click** `Compile Firmware (Windows).bat` +5. **Follow the prompts** on screen ### Mac - Compile from Source @@ -112,7 +104,7 @@ This method compiles the Arduino code fresh each time, taking 30-60 seconds long --- -## What the Compile-from-Source Script Does +### How Compile-from-Source Works 1. **Checks for Arduino CLI** - The build tool. Installs it if needed. 2. **Sets up ESP32 support** - Downloads ESP32 tools (first time only, ~500MB) diff --git a/build_release.sh b/build_release.sh index 7aec5cd..1c6439c 100644 --- a/build_release.sh +++ b/build_release.sh @@ -70,17 +70,17 @@ mkdir -p "$OUTPUT_DIR/firmware/tools" mkdir -p "$OUTPUT_DIR/tools" mkdir -p "$OUTPUT_DIR/source" -# Copy flash tools +# Copy flash tools (main method for users) echo "Copying flash tools..." cp "$SCRIPT_DIR/Flash Firmware.bat" "$OUTPUT_DIR/" cp "$SCRIPT_DIR/flash_firmware.ps1" "$OUTPUT_DIR/" chmod +x "$OUTPUT_DIR/flash_firmware.ps1" -# Copy upload tools for compiling from source -echo "Copying upload tools..." +# Copy compile/upload tools (advanced method for developers) +echo "Copying advanced compile tools..." cp "$SCRIPT_DIR/upload_firmware.sh" "$OUTPUT_DIR/tools/" cp "$SCRIPT_DIR/upload_firmware.ps1" "$OUTPUT_DIR/tools/" -cp "$SCRIPT_DIR/Upload Firmware (Windows).bat" "$OUTPUT_DIR/" +cp "$SCRIPT_DIR/Upload Firmware (Windows).bat" "$OUTPUT_DIR/tools/Compile Firmware (Windows).bat" chmod +x "$OUTPUT_DIR/tools/upload_firmware.sh" # Copy source code @@ -154,17 +154,16 @@ CONTENTS JudgeController/ - Judge controller binaries tools/ - esptool.exe for Windows - Flash Firmware.bat - EASIEST METHOD: Double-click to flash firmware + Flash Firmware.bat - Main method: Double-click to flash firmware instantly - source/ - Arduino source code (for advanced users) + source/ - Arduino source code (for advanced users and developers) arduino/SledController/ - Sled controller source arduino/JudgeController/ - Judge controller source - tools/ - Upload utilities (for compiling from source) - upload_firmware.sh - Mac/Linux upload script (compile-on-upload) - upload_firmware.ps1 - Windows PowerShell upload script (compile-on-upload) - - Upload Firmware (Windows).bat - Legacy: Compile and upload (slow, ~60 seconds) + tools/ - Advanced tools (for developers) + Compile Firmware (Windows).bat - Compile and upload from source code + upload_firmware.sh - Mac/Linux compile and upload script + upload_firmware.ps1 - Windows PowerShell compile and upload script QUICK START - FLASH FIRMWARE (RECOMMENDED)