Beispiel #1
0
 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 = []
Beispiel #2
0
    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:
Beispiel #3
0
 def initVar(self):
     self.burning = False
     self.isDetectSerialPort = False
     self.DataPath = parameters.dataPath
     self.kflash = KFlash(print_callback=self.kflash_py_printCallback)
     self.saveKfpkDir = ""