diff --git a/source/device/LaminaAdapter.py b/source/device/LaminaAdapter.py index 2d140ee..669499b 100644 --- a/source/device/LaminaAdapter.py +++ b/source/device/LaminaAdapter.py @@ -256,7 +256,7 @@ class LaminaAdapter(DeviceSerial): self.block['data']['step'] = step return self._transfer_data() - def frame_update(self, path_file: Path, makefile: bool = False, savefile: bool = False) -> bool: + def frame_update(self, path_file: Path, makefile: bool = False, savefile: bool = False, **kwargs) -> bool: """ 程序升级 注意: 在使用单板升级测试时, 需要关闭低电压检测功能, 否则无法启动升级流程; @@ -268,7 +268,7 @@ class LaminaAdapter(DeviceSerial): if not path_file.exists(): raise Exception("工程编译目标文件不存在.") if makefile and self.make_package is not None: - self.block['data']['file'] = self.make_package(path_file) + self.block['data']['file'] = self.make_package(path_file, **kwargs) if savefile: path_file.parent.joinpath(path_file.stem + '.dat').write_bytes(self.block['data']['file']) else: @@ -311,13 +311,15 @@ class LaminaAdapter(DeviceSerial): return False self.flag_print, self.retry, self.time_out = param_saved + time.sleep(6) + self.frame_read(0x100, 0x20) return True def GeneratePackage(type_dev: str, path_hex: Path, **kwargs) -> bytearray: """ 生成升级包 """ - if 'upgrade_backup' in kwargs.keys(): - upgrade_backup = kwargs['upgrade_backup'] + upgrade_backup = kwargs['upgrade_backup'] if 'upgrade_backup' in kwargs.keys() else None + config = { 'prod_type': [0x45, 0x00], # 产品类型 'method_compress': False, # 文件压缩