Fix Upload Firmware batch file path to tools subdirectory#2
Conversation
The build_release.sh script places upload_firmware.ps1 in the tools/ subdirectory, but the batch file was looking for it in the root directory. Updated batch file to reference tools\upload_firmware.ps1.
There was a problem hiding this comment.
Pull request overview
This PR fixes the path in Upload Firmware (Windows).bat to correctly reference upload_firmware.ps1 in the tools/ subdirectory instead of the root directory. This aligns with how the build_release.sh script organizes the release package structure (line 103), where PowerShell and shell scripts are placed in tools/ while batch files remain in the root.
Key Changes
- Updated the batch file to look for
upload_firmware.ps1intools\subdirectory, fixing the immediate "file not found" error when running the batch file from a release package
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
When multiple USB devices are detected, the device names were not displaying properly, showing empty entries. Now displays the COM port number at minimum, and includes the full device name if available. This fixes the issue where users see empty device listings when connecting multiple USB devices to their computer.
|
Updated with additional fix: Also included in this PR:
This fix addresses the issue where users see empty device listings instead of port numbers when connecting USB devices. |
The script was looking for firmware in tools/arduino instead of source/arduino. Updated to find the source folder relative to the release package root directory. Path now correctly resolves to: release_root/source/arduino/JudgeController
|
Another fix added:
This addresses the 'Firmware folder not found' error users were experiencing. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # The Arduino source is in the source/ folder at the release root | ||
| # Script is in tools/, so go up one level and into source/ | ||
| $ReleaseRoot = Split-Path -Parent $ScriptDir | ||
| $ArduinoDir = Join-Path $ReleaseRoot "source" "arduino" |
There was a problem hiding this comment.
The Join-Path cmdlet with three arguments requires PowerShell 6.0 or later (PowerShell Core). However, Windows PowerShell 5.1 is the default on Windows 10 and earlier, and it only supports two arguments for Join-Path. This will cause the script to fail with an error on systems using Windows PowerShell 5.1.
To fix this for compatibility with Windows PowerShell 5.1, nest the Join-Path calls or use Join-Path twice in sequence. For example:
- Option 1: Join-Path (Join-Path $ReleaseRoot "source") "arduino"
- Option 2: Join-Path $ReleaseRoot "source\arduino"
| $ArduinoDir = Join-Path $ReleaseRoot "source" "arduino" | |
| $ArduinoDir = Join-Path (Join-Path $ReleaseRoot "source") "arduino" |
The pre-compiled firmware and flash scripts are untested and unused. Only support the Arduino CLI compile-from-source upload method. Changes: - Remove firmware compilation from build_release.sh - Remove flash_firmware.sh and flash_firmware.ps1 - Remove Flash Firmware (Windows).bat from release package - Update build_release.sh to only include source code and upload tools - Simplify UPLOAD_GUIDE.md to show only Arduino upload method - Update README.txt template to reflect source-only approach
|
Final update:
Release packages will now be lighter and focused on the proven upload method. |
The build_release.sh script places upload_firmware.ps1 in the tools/ subdirectory, but the batch file was looking for it in the root directory.
This fixes the issue where running 'Upload Firmware (Windows).bat' from a release package would fail with a file not found error.
Tested with release v1.0.1 - batch file now correctly finds the PowerShell script.