Skip to content

Fix Upload Firmware batch file path to tools subdirectory#2

Merged
thompcd merged 4 commits intomainfrom
fix/batch-file-path
Jan 2, 2026
Merged

Fix Upload Firmware batch file path to tools subdirectory#2
thompcd merged 4 commits intomainfrom
fix/batch-file-path

Conversation

@thompcd
Copy link
Owner

@thompcd thompcd commented Jan 2, 2026

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.

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.
Copilot AI review requested due to automatic review settings January 2, 2026 06:23
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.ps1 in tools\ 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.
@thompcd
Copy link
Owner Author

thompcd commented Jan 2, 2026

Updated with additional fix:

Also included in this PR:

  • Fixed empty device display in PowerShell upload script (shows COM port when device name is unavailable)

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
Copilot AI review requested due to automatic review settings January 2, 2026 06:28
@thompcd
Copy link
Owner Author

thompcd commented Jan 2, 2026

Another fix added:

  • Fixed firmware path lookup - script now correctly looks in source/arduino instead of tools/arduino

This addresses the 'Firmware folder not found' error users were experiencing.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"
Copy link

Copilot AI Jan 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"
Suggested change
$ArduinoDir = Join-Path $ReleaseRoot "source" "arduino"
$ArduinoDir = Join-Path (Join-Path $ReleaseRoot "source") "arduino"

Copilot uses AI. Check for mistakes.
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
@thompcd
Copy link
Owner Author

thompcd commented Jan 2, 2026

Final update:

  • Removed untested flash firmware support
  • Build process now only includes source code and upload tools
  • Simplified documentation to show Arduino compile-from-source only

Release packages will now be lighter and focused on the proven upload method.

@thompcd thompcd merged commit a49fa5a into main Jan 2, 2026
1 check passed
@thompcd thompcd deleted the fix/batch-file-path branch January 2, 2026 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant