def initVar(self): self.burning = False self.isDetectSerialPort = False self.DataPath = parameters.dataPath self.kflash = KFlash(print_callback=self.kflash_py_printCallback) self.saveKfpkDir = "" self.packing = False self.zipTempFiles = [] self.fileSelectWidgets = []
print("=============== flash config =============") print("-- flash port :{}".format( config["port"] )) print("-- flash baudrate:{}".format( config["baudrate"] )) print("-- flash board:{}".format( config["Board"] )) print("-- flash open terminal:{}".format( config["terminal"] )) print("-- flash download to sram:{}".format( config["sram"] )) print("-- flash noansi:{}".format( config["noansi"] )) print("-- flash slow mode:{}".format( config["Slow"] )) print("-- flash erase mode:{}".format( config["erase"] )) print("-- flash firmware:{}".format( firmware )) print("") print("-- kflash start") # call kflash to burn firmware from kflash_py.kflash import KFlash kflash = KFlash(print_callback=kflash_py_printCallback) flash_success = True err_msg = "" try: if config["Board"]=="auto": kflash.process(terminal=False, dev=config["port"], baudrate=config["baudrate"], \ sram = config["sram"], file=firmware, callback=kflash_progress, noansi= config["noansi"], \ terminal_auto_size=True, slow_mode = config["Slow"]) else: kflash.process(terminal=False, dev=config["port"], baudrate=config["baudrate"], board=config["Board"], \ sram = config["sram"], file=firmware, callback=kflash_progress, noansi= config["noansi"], \ terminal_auto_size=True, slow_mode = config["Slow"]) except Exception as e: flash_success = False err_msg = str(e) if not flash_success:
def initVar(self): self.burning = False self.isDetectSerialPort = False self.DataPath = parameters.dataPath self.kflash = KFlash(print_callback=self.kflash_py_printCallback) self.saveKfpkDir = ""