def _connectToWinIDEA(self): # sp.Popen(['/home/isystem/bin/9_17_109_0_89947/winidea.sh', self.workspaceFileName]) cmgr = ic.ConnectionMgr() cmgr.connectMRU(self.workspaceFileName) self.debugCtrl = ic.CDebugFacade(cmgr) self.ideCtrl = ic.CIDEController(cmgr) self.loaderCtrl = ic.CLoaderController(cmgr)
def __init__(self): """ Initializes debug object. Connects to winIDEA. """ self.cmgr = ic.ConnectionMgr() self.cmgr.connectMRU() self.debug = ic.CDebugFacade(self.cmgr)
def force_rtc(self): self.text.tag_config('warning', background="yellow", foreground="red") self.text.tag_config('OK', background="white", foreground="green") try: import isystem.connect as ic cmgr = ic.ConnectionMgr() cmgr.connectMRU('') debugCtrl = ic.CDebugFacade(cmgr) dataCtrl = ic.CDataController(cmgr) self.text.insert(tk.END, "Setting wakeup from tranciever value to Validated" + "\n") dataCtrl.modify(ic.IConnectDebug.fRealTime, 'BswM_EcuMWakeupState[0]', '2') # Check written value self.text.insert(tk.END, 'BswM_EcuMWakeupState[0] = ' + str(dataCtrl.evaluate(ic.IConnectDebug.fRealTime, 'BswM_EcuMWakeupState[0]').getLong()) + "\n", 'OK') self.text.insert(tk.END, "-----" + "\n") self.text.insert(tk.END, "Setting RTC wakeup value to Validated" + "\n") dataCtrl.modify(ic.IConnectDebug.fRealTime, 'BswM_EcuMWakeupState[2]', '2') self.text.insert(tk.END, 'BswM_EcuMWakeupState[2] = ' + str(dataCtrl.evaluate(ic.IConnectDebug.fRealTime, 'BswM_EcuMWakeupState[2]').getLong()) + "\n", 'OK') self.text.insert(tk.END, "-----" + "\n") self.text.insert(tk.END, "Setting EcuM_ValidatedWakeups value to 2080(both TRCV and RTC)" + "\n") dataCtrl.modify(ic.IConnectDebug.fRealTime, 'EcuM_ValidatedWakeups', '2080') self.text.insert(tk.END, 'EcuM_ValidatedWakeups = ' + str(dataCtrl.evaluate(ic.IConnectDebug.fRealTime, 'EcuM_ValidatedWakeups').getLong()) + "\n", 'OK') self.text.insert(tk.END, "-----" + "\n") # Search for line Rte_Write_my_function(my_variable);'. lineDesc = ic.CLineDescription(ic.CLineDescription.E_RESOURCE_FUNCTION, 'Rte_Write_my_function(my_variable);', 0, # start at the beginning of a function True, # perform search 0, # no limit ic.CLineDescription.E_SEARCH_ANY, ic.CLineDescription.E_MATCH_PLAIN, "}", 0, fileLocation) lineLocation = addrCtrl.getSourceLocation(lineDesc) print('file: ', lineLocation.getFileName()) print('line: ', lineLocation.getLineNumber()) self.text.insert(tk.END, 'file: ' + lineLocation.getFileName() + "\n", 'OK') self.text.insert(tk.END, 'line: ' + lineLocation.getLineNumber() + "\n", 'OK') except: self.text.insert(tk.END, "Winidea is not present on this computer!" + "\n", 'warning')
# Initialization script # Created by winIDEA import isystem.connect as ic cmgr = ic.ConnectionMgr() cmgr.connectMRU('') debug = ic.CDebugFacade(cmgr) try: debug.modify(ic.IConnectDebug.fMonitor, '@"TIM2/PSC"', '8') debug.modify(ic.IConnectDebug.fMonitor, '@"TIM2/ARR"', '8547') debug.modify(ic.IConnectDebug.fMonitor, '@"TIM21/PSC"', '9999') debug.modify(ic.IConnectDebug.fMonitor, '@"TIM21/ARR"', '6400') except Exception as ex: print(ex)
# Start QEMU on win10 print("Starting QEMU...") cmd = qemuPath + ' -M lm3s6965evb -m 256M -s -S -kernel ' + elfPath p = sp.Popen(cmd, shell=True) # Start winIDEA and connect to it cmgr = ic.ConnectionMgr() print("Starting winIDEA") cmgr.connectMRU(workspacePath) print("Connected to winIDEA") loader = ic.CLoaderController(cmgr) dlConfig = ic.CDownloadConfiguration() execCtrl = ic.CExecutionController(cmgr) debugCtrl = ic.CDebugFacade(cmgr) brkCtrl = ic.CBreakpointController(cmgr) print("Downloading to target...") # Clear winIDEAs download list loader.clearDownloadList(ic.CLoaderController.DLIST_PRIMARY) # Add to download list on win10 loader.addToDownloadList(dlConfig, ic.CLoaderController.DLIST_PRIMARY, '../cortexM3/build/exe/stm32/release/lm3s.elf', '') # Download to target success = loader.download() if success == 0: print("Download successfull.") time.sleep(1)
def _connectToWinIDEA(self): cmgr = ic.ConnectionMgr() cmgr.connectMRU(self.workspaceFileName) self.debugCtrl = ic.CDebugFacade(cmgr) self.ideCtrl = ic.CIDEController(cmgr) self.loaderCtrl = ic.CLoaderController(cmgr)