def __init__(self): ScopeTemplate.__init__(self) self._is_connected = False self.params.init() self._cwusb = NAEUSB() self.ser = self._cwusb self.scopetype = self self.dev = self self.xmega = XMEGAPDI(self._cwusb) self.avr = AVRISP(self._cwusb) self.usart = USART(self._cwusb) self.serialstm32f = STM32FSerial(cwserial=self.usart) self.serialstm32f.scope = self self.io = GPIOSettings(self._cwusb) self.adc = ADCSettings(self._cwusb) self.glitch = GlitchSettings(self._cwusb) self._timeout = 2 self._lasttrace = None self.getParams().addChildren([ {'name':"CW-Lite XMEGA Programmer", 'tip':"Open XMEGA Programmer (ChipWhisperer-Lite Only)", 'type':"menu", "action":lambda _:self.getCwliteXMEGA().show()}, {'name':"CW-Lite AVR Programmer", 'tip':"Open AVR Programmer (ChipWhisperer-Lite Only)", 'type':"menu", "action":lambda _:self.getCwliteAVR().show()}, {'name':'Serial STM32F Programmer', 'tip':"Open STM32F Programmer (Serial/ChipWhisperer)", 'type':"menu", "action":lambda _:self.getSerialSTM32F().show()} ]) self.disable_newattr()
def __init__(self): self._cwusb = NAEUSB() # Connect required modules up here self.fpga = FPGA(self._cwusb) self.xmega = XMEGAPDI(self._cwusb) self.avr = AVRISP(self._cwusb) self.usart = USART(self._cwusb) self.getParams().addChildren([{ 'name': "CW-Lite XMEGA Programmer", 'tip': "Open XMEGA Programmer (ChipWhisperer-Lite Only)", 'type': "menu", "action": lambda _: self.getCwliteXMEGA().show() }, { 'name': "CW-Lite AVR Programmer", 'tip': "Open AVR Programmer (ChipWhisperer-Lite Only)", 'type': "menu", "action": lambda _: self.getCwliteAVR().show() }])
def __init__(self): self._cwusb = NAEUSB() # Connect required modules up here self.fpga = FPGA(self._cwusb) self.xmega = XMEGAPDI(self._cwusb) self.avr = AVRISP(self._cwusb) self.usart = USART(self._cwusb) self.serialstm32f = STM32FSerial(cwserial=self.usart, cwapi=None)
def __init__(self): ScopeTemplate.__init__(self) self._is_connected = False self._cwusb = NAEUSB() self.ser = self._cwusb self.scopetype = self self.dev = self self.xmega = XMEGAPDI(self._cwusb) self.avr = AVRISP(self._cwusb) self.usart = USART(self._cwusb) self.serialstm32f = STM32FSerial(cwserial=self.usart) self.serialstm32f.scope = self self.io = GPIOSettings(self._cwusb) self.adc = ADCSettings(self._cwusb) self.glitch = GlitchSettings(self._cwusb) self._timeout = 2 self._lasttrace = None self.disable_newattr()
def __init__(self): self._cwusb = NAEUSB() # Connect required modules up here self.fpga = FPGA(self._cwusb) self.xmega = XMEGAPDI(self._cwusb) self.avr = AVRISP(self._cwusb) self.usart = USART(self._cwusb) self.serialstm32f = STM32FSerial(cwserial=self.usart, cwapi=CWCoreAPI.getInstance()) self.getParams().addChildren([{ 'name': "CW-Lite XMEGA Programmer", 'tip': "Open XMEGA Programmer (ChipWhisperer-Lite Only)", 'type': "menu", "action": lambda _: self.getCwliteXMEGA().show() }, { 'name': "CW-Lite AVR Programmer", 'tip': "Open AVR Programmer (ChipWhisperer-Lite Only)", 'type': "menu", "action": lambda _: self.getCwliteAVR().show() }, { 'name': 'Serial STM32F Programmer', 'tip': "Open STM32F Programmer (Serial/ChipWhisperer)", 'type': "menu", "action": lambda _: self.getSerialSTM32F().show() }])
logging.debug("Streaming: Received %d bytes in time %.20f)" % (self.drx, diff)) if __name__ == '__main__': from chipwhisperer.hardware.naeusb.fpga import FPGA from chipwhisperer.hardware.naeusb.programmer_avr import AVRISP from chipwhisperer.hardware.naeusb.programmer_xmega import XMEGAPDI, supported_xmega from chipwhisperer.hardware.naeusb.serial import USART cwtestusb = NAEUSB() cwtestusb.con() #Connect required modules up here fpga = FPGA(cwtestusb) xmega = XMEGAPDI(cwtestusb) avr = AVRISP(cwtestusb) usart = USART(cwtestusb) force = True if fpga.isFPGAProgrammed() == False or force: from datetime import datetime starttime = datetime.now() fpga.FPGAProgram( open( r"C:\E\Documents\academic\sidechannel\chipwhisperer\hardware\capture\chipwhisperer-lite\hdl\cwlite_ise\cwlite_interface.bit", "rb")) # fpga.FPGAProgram(open(r"C:\Users\colin\dropbox\engineering\git_repos\CW305_ArtixTarget\temp\artix7test\artix7test.runs\impl_1\cw305_top.bit", "rb")) # fpga.FPGAProgram(open(r"C:\E\Documents\academic\sidechannel\chipwhisperer\hardware\api\chipwhisperer-lite\hdl\cwlite_ise_spifake\cwlite_interface.bit", "rb")) stoptime = datetime.now() print("FPGA Config time: %s" % str(stoptime - starttime))
api = CWCoreAPI() # Instantiate the API if useGUI: app = cwc.makeApplication("Capture") # Change the name if you want a different settings scope gui = cwc.CWCaptureGUI(api) # Comment this line if you don't want to use the GUI api.runScriptClass(UserScript) # Run the User Script (executes "run()" by default) #System should now be setup (assuming CW-Lite found). Do programming if hex-file specified, otherwise open GUI if useGUI: from PySide.QtGui import * for act in gui._ToolMenuItems: if act.text() == "CW-Lite XMEGA Programmer": act.activate(QAction.Trigger) else: usb = api.getScope().scopetype.dev._cwusb _xmega = XMEGAPDI(usb) xmega = XMEGAProgrammer() xmega.setUSBInterface(_xmega) xmega.find() fname = sys.argv[1] print("Attempting to program %s to XMEGA"%fname) if os.path.isfile(fname): xmega.erase() xmega.program(fname) else: print("***** SPECIFIED FILE NOT FOUND ********") xmega.close()