Пример #1
0
    def __init__(self):
        super(CWLite_Loader, self).__init__()
        self.driver = None

        def_bsZipLoc = os.path.join(util.getRootDir(), os.path.normpath("../hardware/capture/chipwhisperer-lite/cwlite_firmware.zip"))
        def_bsLoc = os.path.join(util.getRootDir(), os.path.normpath("../hardware/capture/chipwhisperer-lite/hdl/cwlite_ise/cwlite_interface.bit"))

        self._bsZipLoc = self._bsZipLoc = self.read_setting('zipbitstream-location', def_bsZipLoc)
        self._bsZipLoc_filename = "cwlite_interface.bit"
        self._bsLoc = self.read_setting('debugbitstream-location', def_bsLoc)
        self._fwFLoc = ""
        self._bsBuiltinData = cwlite_getsome("cwlite_firmware.zip", filelike=True)
Пример #2
0
    def __init__(self):
        super(CWLite_Loader, self).__init__()
        self.driver = None

        def_bsZipLoc = os.path.join(
            util.getRootDir(),
            os.path.normpath(
                "../hardware/capture/chipwhisperer-lite/cwlite_firmware.zip"))
        def_bsLoc = os.path.join(
            util.getRootDir(),
            os.path.normpath(
                "../hardware/capture/chipwhisperer-lite/hdl/cwlite_interface.bit"
            ))

        self._bsZipLoc = self._bsZipLoc = self.read_setting(
            'zipbitstream-location', def_bsZipLoc)
        self._bsZipLoc_filename = "cwlite_interface.bit"
        self._bsLoc = self.read_setting('debugbitstream-location', def_bsLoc)
        self._fwFLoc = ""
        self._bsBuiltinData = cwlite_getsome("cwlite_firmware.zip",
                                             filelike=True)
    def runSamba(self):
        sam = Samba()

        if self.rbExternal.isChecked():
            fw_data = open(self.firmwareLocation.text(), 'rb').read()
        else:
            fw_data = cwlite_getsome("SAM3U_CW1173.bin", filelike=False)

        self.programStatus.setText("Attempting to connect to %s\n"%self.serlist.currentText())
        sam.con(self.serlist.currentText())
        self.programStatus.append("Erasing...\n")
        sam.erase()
        if self.rbExternal.isChecked():
            self.programStatus.append("Programming %s\n"%(self.firmwareLocation.text()))
        else:
            self.programStatus.append("Using built-in firmware file")
        sam.write(fw_data)
        if sam.verify(fw_data):
            self.programStatus.append("Program OK (Verify Passed!)\n")
            sam.flash.setBootFlash(True)
        else:
            self.programStatus.append("Verify FAILED\n")
        sam.ser.close()