Fix firmware path initialization and upload logic in MultiDongle

- Always store firmware paths (scpu_fw_path, ncpu_fw_path) when provided, not just when upload_fw=True
- Restore firmware upload condition to only run when upload_fw=True
- Fix 'MultiDongle' object has no attribute 'scpu_fw_path' error during pipeline initialization
- Ensure firmware paths are available for both upload and non-upload scenarios

This resolves the pipeline deployment error where firmware paths were missing
even when provided to the constructor, causing initialization failures.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Masonmason 2025-07-16 22:11:42 +08:00
parent e34cdfb856
commit 049dedf2f7

View File

@ -286,11 +286,9 @@ class MultiDongle:
self.upload_fw = upload_fw
# Check if the firmware is needed
if self.upload_fw:
# Always store firmware paths when provided
self.scpu_fw_path = scpu_fw_path
self.ncpu_fw_path = ncpu_fw_path
self.model_path = model_path
self.device_group = None
@ -332,7 +330,7 @@ class MultiDongle:
# kp.core.set_timeout(device_group=self.device_group, milliseconds=5000)
# print(' - Success')
# if self.upload_fw:
if self.upload_fw:
try:
print('[Upload Firmware]')
kp.core.load_firmware_from_file(device_group=self.device_group,