예제 #1
0
 def __init__(self):
     super(CWCRev2_Loader, self).__init__()
     self.driver = Ztex1v1()
     self._fwFLoc = self.read_setting(
         'firmware-location',
         os.path.join(
             util.getRootDir(),
             os.path.normpath(
                 "../hardware/capture/chipwhisperer-rev2/ezusb-firmware/ztex-sdk/examples/usb-fpga-1.11/1.11c/openadc/OpenADC.ihx"
             )))
     self._bsZipLoc = self.read_setting(
         'zipbitstream-location',
         os.path.join(
             util.getRootDir(),
             os.path.normpath(
                 "../hardware/capture/chipwhisperer-rev2/cwrev2_firmware.zip"
             )))
     self._bsZipLoc_filename = "interface.bit"
     self._bsLoc = self.read_setting(
         'debugbitstream-location',
         os.path.join(
             util.getRootDir(),
             os.path.normpath(
                 "../hardware/capture/chipwhisperer-rev2/hdl/ztex_rev2_1.11c_ise/interface.bit"
             )))
     self._bsBuiltinData = cwcr2_getsome("cwrev2_firmware.zip",
                                         filelike=True)
     self._fwBuiltinData = cwcr2_getsome("OpenADC.ihx", filelike=True)
예제 #2
0
 def __init__(self):
     super(CWCRev2_Loader, self).__init__()
     self.driver = Ztex1v1()
     self._fwFLoc = self.read_setting('firmware-location', os.path.join(util.getRootDir(), os.path.normpath("../hardware/capture/chipwhisperer-rev2/ezusb-firmware/ztex-sdk/examples/usb-fpga-1.11/1.11c/openadc/OpenADC.ihx")))
     self._bsZipLoc = self.read_setting('zipbitstream-location',os.path.join(util.getRootDir(), os.path.normpath("../hardware/capture/chipwhisperer-rev2/cwrev2_firmware.zip")))
     self._bsZipLoc_filename = "interface.bit"
     self._bsLoc = self.read_setting('debugbitstream-location',os.path.join(util.getRootDir(), os.path.normpath("../hardware/capture/chipwhisperer-rev2/hdl/ztex_rev2_1.11c_ise/interface.bit")))
     self._bsBuiltinData = cwcr2_getsome("cwrev2_firmware.zip", filelike=True)
     self._fwBuiltinData = cwcr2_getsome("OpenADC.ihx", filelike=True)
예제 #3
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)
예제 #4
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)
예제 #5
0
    def __init__(self):
        super(CW1200_Loader, self).__init__()
        self.driver = None

        def_bsZipLoc = os.path.join(util.getRootDir(), os.path.normpath("../hardware/capture/chipwhisperer-cw1200/cw1200_firmware.zip"))
        def_bsLoc = os.path.join(util.getRootDir(), os.path.normpath("../hardware/capture/chipwhisperer-cw1200/hdl/cw1200_ise/cw1200_interface.bit"))

        self._bsZipLoc = self._bsZipLoc = self.read_setting('zipbitstream-location', def_bsZipLoc)
        self._bsZipLoc_filename = "cw1200_interface.bit"
        self._bsLoc = self.read_setting('debugbitstream-location', def_bsLoc)
        self._fwFLoc = ""
        # TODO: add final CW1200 release bitstream
        #self._bsBuiltinData = cw1200_getsome("cw1200_firmware.zip", filelike=True)
        self._bsBuiltinData = None
        if self._release_mode == 'builtin':
            logging.info("Setting CW1200 firmware to use zip file by default...")
            self.setFPGAMode("zipfile")
예제 #6
0
    def __init__(self, parent=None, cwliteUSB=None):
        super(SAM3LoaderConfig, self).__init__(parent)

        if cwliteUSB:
            self.cwLiteUSB = cwliteUSB._usb
        else:
            self.cwLiteUSB = None

        self.setWindowTitle("SAM3U Firmware Loader")
        layout = QVBoxLayout()

        gbSAMMode = QGroupBox("Step 1. Enable Bootloader")
        layoutGB = QVBoxLayout()

        if self.cwLiteUSB:
            pbBootmode = QPushButton("Enable Bootloader Mode")
            pbBootmode.clicked.connect(self.enableBootloader)
            layoutGB.addWidget(pbBootmode)
        else:
            labelUnconnected = QLabel(
                "USB not connected. If you have not yet enabled bootload mode: close this dialog, "
                +
                "connect to the scope/target, and open it again. If you have already enabled bootload "
                + "mode skip to Step 2.")
            labelUnconnected.setWordWrap(True)
            layoutGB.addWidget(labelUnconnected)

        labelWarnBoot1 = QLabel(
            "WARNING: Bootload mode will stay enabled until new firmware is loaded."
        )
        labelWarnBoot2 = QLabel(
            "NOTE: This only works on firmware 0.11 or later. Short 'ERASE' jumper to enable bootloader mode on earlier firmwares."
        )
        labelWarnBoot1.setWordWrap(True)
        labelWarnBoot2.setWordWrap(True)
        layoutGB.addWidget(labelWarnBoot1)
        layoutGB.addWidget(labelWarnBoot2)
        gbSAMMode.setLayout(layoutGB)
        layout.addWidget(gbSAMMode)

        gbSAMProgram = QGroupBox("Step 2. Program Binary")

        layoutSAMGB = QVBoxLayout()

        layoutFW = QHBoxLayout()
        self.firmwareLocation = QtFixes.QLineEdit()
        self.firmwareButton = QPushButton("Find")
        self.firmwareButton.clicked.connect(self.findFirmware)
        layoutFW.addWidget(QLabel("SAM3U Firmware"))
        layoutFW.addWidget(self.firmwareLocation)
        layoutFW.addWidget(self.firmwareButton)

        self.firmwareButton.setEnabled(False)
        self.firmwareLocation.setEnabled(False)

        self.serlist = QComboBox()
        serrefresh = QPushButton("Update List")
        serrefresh.clicked.connect(self.serialRefresh)

        layoutSerList = QHBoxLayout()
        layoutSerList.addWidget(self.serlist)
        layoutSerList.addWidget(serrefresh)

        pbProgram = QPushButton("Run Program")
        pbProgram.clicked.connect(self.runSamba)

        self.programStatus = QTextEdit(
            "You will have to wait for device to attach as a serial port. Once this "
            +
            "happens, press the 'Update List' button and select the proper serial port."
            + " Then hit 'Run Program' to update your device.")
        self.programStatus.setReadOnly(True)

        self.rbBuiltin = QRadioButton("Built-in")
        self.rbExternal = QRadioButton("External File")
        self.rbBuiltin.setChecked(True)
        FWModeRBLayout = QHBoxLayout()
        FWModeRBLayout.addWidget(self.rbBuiltin)
        FWModeRBLayout.addWidget(self.rbExternal)

        self.rbExternal.clicked.connect(self.rbbuiltinchange)
        self.rbBuiltin.clicked.connect(self.rbbuiltinchange)

        layoutSAMGB.addLayout(FWModeRBLayout)
        layoutSAMGB.addLayout(layoutFW)
        layoutSAMGB.addLayout(layoutSerList)
        layoutSAMGB.addWidget(pbProgram)
        layoutSAMGB.addWidget(self.programStatus)
        gbSAMProgram.setLayout(layoutSAMGB)
        layout.addWidget(gbSAMProgram)

        sam3uFWLoc = QSettings().value("cwlite-sam3u-firmware-location")

        rootprefix = util.getRootDir() + "/"

        if not sam3uFWLoc:
            defLocfwF = rootprefix + "../../../hardware/capture/chipwhisperer-lite/sam3u_fw/SAM3U_VendorExample/Debug/SAM3U_CW1173.bin"
            if os.path.isfile(defLocfwF):
                sam3uFWLoc = str(defLocfwF)
                QSettings().setValue("cwlite-sam3u-firmware-location",
                                     sam3uFWLoc)

        self.firmwareLocation.setText(sam3uFWLoc)

        gbDone = QGroupBox("Step 3. Reset")
        gbDoneLayout = QHBoxLayout()
        gbDone.setLayout(gbDoneLayout)
        gbDoneLabel = QLabel(
            "If the above succeeds, you need to power-cycle the target. Unplug & replug target. You may also "
            + "need to close and re-open ChipWhisperer-Capture.")
        gbDoneLabel.setWordWrap(True)
        gbDoneLayout.addWidget(gbDoneLabel)
        layout.addWidget(gbDone)

        self.setLayout(layout)
    def __init__(self, parent=None, cwliteUSB=None):
        super(SAM3LoaderConfig, self).__init__(parent)

        if cwliteUSB:
            self.cwLiteUSB = cwliteUSB._usb
        else:
            self.cwLiteUSB = None

        self.setWindowTitle("SAM3U Firmware Loader")
        layout = QVBoxLayout()

        gbSAMMode = QGroupBox("Step 1. Enable Bootloader")
        layoutGB = QVBoxLayout()

        if self.cwLiteUSB:
            pbBootmode = QPushButton("Enable Bootloader Mode")
            pbBootmode.clicked.connect(self.enableBootloader)
            layoutGB.addWidget(pbBootmode)
        else:
            labelUnconnected = QLabel("USB not connected. If you have not yet enabled bootload mode: close this dialog, " +
                                      "connect to the scope/target, and open it again. If you have already enabled bootload " +
                                      "mode skip to Step 2.")
            labelUnconnected.setWordWrap(True)
            layoutGB.addWidget(labelUnconnected)

        labelWarnBoot1 = QLabel("WARNING: Bootload mode will stay enabled until new firmware is loaded.")
        labelWarnBoot2 = QLabel("NOTE: This only works on firmware 0.11 or later. Short 'ERASE' jumper to enable bootloader mode on earlier firmwares.")
        labelWarnBoot1.setWordWrap(True)
        labelWarnBoot2.setWordWrap(True)
        layoutGB.addWidget(labelWarnBoot1)
        layoutGB.addWidget(labelWarnBoot2)
        gbSAMMode.setLayout(layoutGB)
        layout.addWidget(gbSAMMode)

        gbSAMProgram = QGroupBox("Step 2. Program Binary")

        layoutSAMGB = QVBoxLayout()

        layoutFW = QHBoxLayout()
        self.firmwareLocation = QtFixes.QLineEdit()
        firmwareButton = QPushButton("Find")
        firmwareButton.clicked.connect(self.findFirmware)
        layoutFW.addWidget(QLabel("SAM3U Firmware"))
        layoutFW.addWidget(self.firmwareLocation)
        layoutFW.addWidget(firmwareButton)

        self.serlist = QComboBox()
        serrefresh = QPushButton("Update List")
        serrefresh.clicked.connect(self.serialRefresh)

        layoutSerList = QHBoxLayout()
        layoutSerList.addWidget(self.serlist)
        layoutSerList.addWidget(serrefresh)

        pbProgram = QPushButton("Run Program")
        pbProgram.clicked.connect(self.runSamba)

        self.programStatus = QTextEdit("You will have to wait for device to attach as a serial port. Once this " +
                                       "happens, press the 'Update List' button and select the proper serial port." +
                                       " Then hit 'Run Program' to update your device.")
        self.programStatus.setReadOnly(True)

        layoutSAMGB.addLayout(layoutFW)
        layoutSAMGB.addLayout(layoutSerList)
        layoutSAMGB.addWidget(pbProgram)
        layoutSAMGB.addWidget(self.programStatus)
        #layoutSAMGB.addWidget(self.bossaOut)
        gbSAMProgram.setLayout(layoutSAMGB)
        layout.addWidget(gbSAMProgram)

        sam3uFWLoc = QSettings().value("cwlite-sam3u-firmware-location")

        rootprefix = util.getRootDir() + "/"

        if not sam3uFWLoc:
            defLocfwF = rootprefix + "../../../hardware/api/chipwhisperer-lite/sam3u_fw/SAM3U_VendorExample/Debug/SAM3U_CW1173.bin"
            if os.path.isfile(defLocfwF):
                sam3uFWLoc = str(defLocfwF)
                QSettings().setValue("cwlite-sam3u-firmware-location", sam3uFWLoc)

        self.firmwareLocation.setText(sam3uFWLoc)

        gbDone = QGroupBox("Step 3. Reset")
        gbDoneLayout = QHBoxLayout()
        gbDone.setLayout(gbDoneLayout)
        gbDoneLabel = QLabel("If the above succeeds, you need to power-cycle the target. Unplug & replug target. You may also " +
                             "need to close and re-open ChipWhisperer-Capture.")
        gbDoneLabel.setWordWrap(True)
        gbDoneLayout.addWidget(gbDoneLabel)
        layout.addWidget(gbDone)

        self.setLayout(layout)