def gen_cproject(self, ksdkProj): """ Generate the cproject file for KDS project :param ksdkProj: Instance of a KSDK project """ kdsPath = self.parent + ('' if self.parent[-1:] == '/' else '/') + self.name + '/atl' relPath = '' if self.isLinked: tempStr = kT.get_rel_path(kdsPath, ksdkProj.sdkPath) + '/../' if ksdkProj.osType == 'Windows': relPath = kT.string_replace(tempStr, '\\', '/') else: relPath = tempStr[:] else: relPath = '../../' self.projRelPath = relPath # Populate ksdkProj specifics to dictionaries ## Configure linker option self.linkLd['listOptionValue'].append(self.projRelPath + 'platform/devices/' +\ ksdkProj.device[1] + '/linker/gcc/' +\ ksdkProj.device[0] + '_flash.ld') ## Set a define for the device self.cDefines['listOptionValue'].append('CPU_' + ksdkProj.device[2]) ## Added to fix K80 application build issues ## #if (ksdkProj.device[1] == 'MK80F25615') or (ksdkProj.device[1] == 'MK82F25615'): # self.cDefines['listOptionValue'].append('USING_DIRECT_INTERFACE=1') ## Added to fix UART smartcard application build issues ## if ksdkProj.libList[0] != 'hal': for d in ksdkProj.drvList: if d[0] == 'smartcard': if kT.get_smartcard_type(ksdkProj.sdkPath, ksdkProj.device[1]) == (1 << 8): self.cDefines['listOptionValue'].append('USING_DIRECT_INTERFACE=1') elif kT.get_smartcard_type(ksdkProj.sdkPath, ksdkProj.device[1]) == 1: self.cDefines['listOptionValue'].append('USING_NCN8025_INTERFACE=1') ################################################################################ if ksdkProj.useBSP: boardType = ksdkProj.board[0][:ksdkProj.board[0].find('_')] self.cDefines['listOptionValue'].append(ksdkProj.board[0]) if boardType == 'FRDM': self.cDefines['listOptionValue'].append('FREEDOM') elif boardType == 'TWR': self.cDefines['listOptionValue'].append('TOWER') elif boardType == 'USB': self.cDefines['listOptionValue'].append('BOARD_USE_VIRTUALCOM') self.cDefines['listOptionValue'].append('DONGLE') elif boardType == 'MRB': self.cDefines['listOptionValue'].append('MRB_KW01') if ksdkProj.rtos != 'bm': if ksdkProj.rtos == 'freertos': self.cDefines['listOptionValue'].append('FSL_RTOS_FREE_RTOS') elif ksdkProj.rtos == 'mqx': self.cDefines['listOptionValue'].append('FSL_RTOS_MQX') elif ksdkProj.rtos == 'ucosii': self.cDefines['listOptionValue'].append('FSL_RTOS_UCOSII') elif ksdkProj.rtos == 'ucosiii': self.cDefines['listOptionValue'].append('FSL_RTOS_UCOSIII') ## Add C include paths necessary for project if ksdkProj.libList[0] != 'hal': self.cIncludes['listOptionValue'].append(self.projRelPath + 'platform/osa/inc') self.cIncludes['listOptionValue'].append(self.projRelPath + 'platform/utilities/inc') self.cIncludes['listOptionValue'].append(self.projRelPath + 'platform/CMSIS/Include') self.cIncludes['listOptionValue'].append(self.projRelPath + 'platform/devices') self.cIncludes['listOptionValue'].append(self.projRelPath + 'platform/devices/' +\ ksdkProj.device[1] + '/include') self.cIncludes['listOptionValue'].append(self.projRelPath + 'platform/devices/' +\ ksdkProj.device[1] + '/startup') self.cIncludes['listOptionValue'].append(self.projRelPath + 'platform/hal/inc') if ksdkProj.libList[0] != 'hal': self.cIncludes['listOptionValue'].append(self.projRelPath + 'platform/drivers/inc') self.cIncludes['listOptionValue'].append(self.projRelPath + 'platform/system/inc') self.cIncludes['listOptionValue'].append("../../") if ksdkProj.useBSP: self.cIncludes['listOptionValue'].append("../../board") ## Add device specific driver include paths if ksdkProj.libList[0] != 'hal': for d in ksdkProj.drvList: for p in d[1]: if not self.projRelPath + p in self.cIncludes['listOptionValue']: self.cIncludes['listOptionValue'].append(self.projRelPath + p) else: for d in ksdkProj.halList: for p in d[1]: if not self.projRelPath + p in self.cIncludes['listOptionValue']: self.cIncludes['listOptionValue'].append(self.projRelPath + p) # Add rtos paths if ksdkProj.rtos != 'bm': if ksdkProj.rtos == 'freertos': self.cIncludes['listOptionValue'].append(self.projRelPath + 'rtos/FreeRTOS/config/' + self.device[1][1:] + '/gcc') self.cIncludes['listOptionValue'].append(self.projRelPath + 'rtos/FreeRTOS/port/gcc') self.cIncludes['listOptionValue'].append(self.projRelPath + 'rtos/FreeRTOS/include') self.cIncludes['listOptionValue'].append(self.projRelPath + 'rtos/FreeRTOS/src') self.asmIncludes['listOptionValue'].append(self.projRelPath + 'rtos/FreeRTOS/config/' + self.device[1][1:] + '/gcc') #print self.asmIncludes #print self.asmIncludes['listOptionValue'] #print self.asmIncludes['listOptionValue'][0] elif ksdkProj.rtos == 'mqx': archType = 'M4' if (self.device[4] == 'cm4') else 'M0' self.cIncludes['listOptionValue'].append(self.projRelPath + 'rtos/mqx/lib/' + ksdkProj.board[1] + '.atl/debug') self.cIncludes['listOptionValue'].append(self.projRelPath + 'rtos/mqx/lib/' + ksdkProj.board[1] + '.atl/debug/config') self.cIncludes['listOptionValue'].append(self.projRelPath + 'rtos/mqx/lib/' + ksdkProj.board[1] + '.atl/debug/mqx') self.cIncludes['listOptionValue'].append(self.projRelPath + 'rtos/mqx/lib/' + ksdkProj.board[1] + '.atl/debug/mqx_stdlib') self.cIncludes['listOptionValue'].append(self.projRelPath + 'rtos/mqx/config/mcu/' + self.device[1]) self.cIncludes['listOptionValue'].append(self.projRelPath + 'rtos/mqx/config/board/' + ksdkProj.board[1]) self.cIncludes['listOptionValue'].append(self.projRelPath + 'rtos/mqx/mqx/source/bsp') self.cIncludes['listOptionValue'].append(self.projRelPath + 'rtos/mqx/mqx/source/psp/cortex_m') self.cIncludes['listOptionValue'].append(self.projRelPath + 'rtos/mqx/mqx/source/psp/cortex_m/compiler/gcc_arm') self.cIncludes['listOptionValue'].append(self.projRelPath + 'rtos/mqx/mqx/source/psp/cortex_m/core/' + archType) self.cIncludes['listOptionValue'].append(self.projRelPath + 'rtos/mqx/mqx/source/psp/cortex_m/cpu') self.cIncludes['listOptionValue'].append(self.projRelPath + 'rtos/mqx/mqx/source/include') self.cIncludes['listOptionValue'].append(self.projRelPath + 'rtos/mqx/config/common') self.cIncludes['listOptionValue'].append(self.projRelPath + 'rtos/mqx/mqx/source/nio') self.cIncludes['listOptionValue'].append(self.projRelPath + 'rtos/mqx/mqx/source/nio/drivers/nio_dummy') self.cIncludes['listOptionValue'].append(self.projRelPath + 'rtos/mqx/mqx/source/nio/drivers/nio_mem') self.cIncludes['listOptionValue'].append(self.projRelPath + 'rtos/mqx/mqx/source/nio/drivers/nio_null') self.cIncludes['listOptionValue'].append(self.projRelPath + 'rtos/mqx/mqx/source/nio/drivers/nio_pipe') self.cIncludes['listOptionValue'].append(self.projRelPath + 'rtos/mqx/mqx/source/nio/drivers/nio_serial') self.cIncludes['listOptionValue'].append(self.projRelPath + 'rtos/mqx/mqx/source/nio/drivers/nio_tfs') self.cIncludes['listOptionValue'].append(self.projRelPath + 'rtos/mqx/mqx/source/nio/drivers/nio_tty') elif ksdkProj.rtos == 'ucosii': archType = 'ARM-Cortex-M4' if (self.device[4] == 'cm4') else 'ARM-Cortex-M0' self.cIncludes['listOptionValue'].append(self.projRelPath + 'rtos/uCOSII/src/uCOS-II/Ports/' + archType + '/Generic/GNU') self.cIncludes['listOptionValue'].append(self.projRelPath + 'rtos/uCOSII/src/uC-CPU/' + archType + '/GNU') self.cIncludes['listOptionValue'].append(self.projRelPath + 'rtos/uCOSII/src/config') self.cIncludes['listOptionValue'].append(self.projRelPath + 'rtos/uCOSII/src/uCOS-II/Source') self.cIncludes['listOptionValue'].append(self.projRelPath + 'rtos/uCOSII/src/uC-CPU') self.cIncludes['listOptionValue'].append(self.projRelPath + 'rtos/uCOSII/src/uC-LIB') elif ksdkProj.rtos == 'ucosiii': archType = 'ARM-Cortex-M4' if (self.device[4] == 'cm4') else 'ARM-Cortex-M0' self.cIncludes['listOptionValue'].append(self.projRelPath + 'rtos/uCOSIII/src/uCOS-III/Ports/' + archType + '/Generic/GNU') self.cIncludes['listOptionValue'].append(self.projRelPath + 'rtos/uCOSIII/src/uC-CPU/' + archType + '/GNU') self.cIncludes['listOptionValue'].append(self.projRelPath + 'rtos/uCOSIII/src/config') self.cIncludes['listOptionValue'].append(self.projRelPath + 'rtos/uCOSIII/src/uCOS-III/Source') self.cIncludes['listOptionValue'].append(self.projRelPath + 'rtos/uCOSIII/src/uC-CPU') self.cIncludes['listOptionValue'].append(self.projRelPath + 'rtos/uCOSIII/src/uC-LIB') if ksdkProj.rtos == 'bm': self.linkLibs['libName'][0] = kT.string_replace(self.linkLibs['libName'][0],\ 'xxx', ksdkProj.libList[0]) else: self.linkLibs['libName'][0] = 'ksdk_platform_' + ksdkProj.libList[0] self.linkLibs['libName'].append('m') self.linkLibs['libPath'][0] = self.projRelPath + self.linkLibs['libPath'][0] self.linkLibs['libPath'][0] = kT.string_replace(self.linkLibs['libPath'][0],\ 'xxx', ksdkProj.libList[0]) if ksdkProj.rtos != 'bm': self.linkLibs['libPath'][0] = kT.string_replace(self.linkLibs['libPath'][0], \ 'libksdk_' + ksdkProj.libList[0] + '.a', \ 'libksdk_platform_' + ksdkProj.libList[0] + '.a') self.linkLibs['libPath'][0] = kT.string_replace(self.linkLibs['libPath'][0], \ 'ddd', ksdkProj.device[1][1:]) if ksdkProj.rtos == 'mqx': mqxLib = '_mqx' self.linkLibs['libName'].append(mqxLib) mqxPath = self.projRelPath + 'rtos/mqx/lib/' + ksdkProj.board[1] + '.atl/debug/mqx' self.linkLibs['libPath'].append(mqxPath) mqxStdLib = '_mqx_stdlib' self.linkLibs['libName'].append(mqxStdLib) mqxStdPath = self.projRelPath + 'rtos/mqx/lib/' + ksdkProj.board[1] + '.atl/debug/mqx_stdlib' self.linkLibs['libPath'].append(mqxStdPath) # l = kT.string_replace(l, 'zzz', ksdkProj.rtos) # kT.debug_log(l) # if self.projType == 'usb': # l = kT.string_replace(l, 'yyy', ksdkProj.board[1]) # b = l kT.debug_log(self.linkLibs['libName']) kT.debug_log(self.linkLibs['libPath']) # Configure linker stack and heap if self.projType == 'usb': if ksdkProj.rtos == 'bm': if 'kl' in ksdkProj.board[1]: self.linkDefines['listOptionValue'][1] = '__stack_size__=0x400' else: self.linkDefines['listOptionValue'][1] = '__stack_size__=0x1000' else: if 'kl' in ksdkProj.board[1]: self.linkDefines['listOptionValue'][1] = '__stack_size__=0x400' else: self.linkDefines['listOptionValue'][1] = '__stack_size__=0x1000' tree = ET.ElementTree(ET.fromstring(aF.formatted_cproject)) root = tree.getroot() for child in root.findall('storageModule'): for config in child.findall('cconfiguration'): for module in config.findall('storageModule'): if module.get('moduleId') == "cdtBuildSystem": for configure in module.findall('configuration'): buildVer = configure.get('name') for folder in configure.findall('folderInfo'): for toolC in folder.findall('toolChain'): #for option in toolC.findall('option'): # if option.get('superClass') == "com.atollic.truestudio.as.general.otherflags": # option.set('value', " -mcpu=cortex-" + ksdkProj.device[4][1:]) # if option.get('superClass') == "com.atollic.truestudio.gcc.misc.otherflags": # option.set('value', " -mcpu=cortex-" + ksdkProj.device[4][1:]) # if option.get('superClass') == "com.atollic.truestudio.common_options.target.fpu": # optionVal = "hard" if ksdkProj.device[3] else "soft" # print optionVal # option.set('value', "com.atollic.truestudio.common_options.target.fpu." + optionVal) for tool in toolC.findall('tool'): #Add assembler options if tool.get('name') == "Assembler": for label in tool.findall('option'): if label.get('superClass') == "com.atollic.truestudio.common_options.target.fpu": optionVal = "hard" if ksdkProj.device[3] else "soft" #print optionVal label.set('value', "com.atollic.truestudio.common_options.target.fpu." + optionVal) if label.get('superClass') == "com.atollic.truestudio.as.general.otherflags": label.set('value', " -mcpu=cortex-" + ksdkProj.device[4][1:]) if label.get('superClass') == "com.atollic.truestudio.as.general.incpath": if ksdkProj.rtos == 'freertos': for a in self.asmIncludes['listOptionValue']: path = ET.Element('listOptionValue', {'builtIn': 'false', 'value': a}) label.append(path) #Add compiler options if tool.get('name') == "C Compiler": for label in tool.findall('option'): #Add include paths if label.get('superClass') == "com.atollic.truestudio.gcc.directories.select": #Add New Include paths for i in self.cIncludes['listOptionValue']: path = ET.Element('listOptionValue', {'builtIn': 'false', 'value': i}) label.append(path) #Add compiler defines if label.get('superClass') == "com.atollic.truestudio.gcc.symbols.defined": # Add new project defines for d in self.cDefines['listOptionValue']: define = ET.Element('listOptionValue', {'builtIn': 'false', 'value': d}) label.append(define) if label.get('superClass') == "com.atollic.truestudio.common_options.target.fpu": optionVal = "hard" if ksdkProj.device[3] else "soft" #print optionVal label.set('value', "com.atollic.truestudio.common_options.target.fpu." + optionVal) if label.get('superClass') == "com.atollic.truestudio.gcc.misc.otherflags": label.set('value', " -mcpu=cortex-" + ksdkProj.device[4][1:]) #Add linker options if tool.get('name') == "C Linker": for label in tool.findall('option'): #Add linker script if label.get('superClass') == "com.atollic.truestudio.ld.general.scriptfile": for l in self.linkLd['listOptionValue']: label.set('value', l) #Add other objects (.a files such as libksdk_platform.a) if label.get('superClass') == "com.atollic.truestudio.ld.libraries.list": for l in self.linkLibs['libName']: lib = ET.Element('listOptionValue', {'builtIn': 'false', 'value': l}) label.append(lib) if label.get('superClass') == "com.atollic.truestudio.ld.libraries.searchpath": #Add necessary linker objects if buildVer == 'debug': for l in self.linkLibs['libPath']: lib = ET.Element('listOptionValue', {'builtIn': 'false', 'value': l}) label.append(lib) else: for l in self.linkLibs['libPath']: temp = kT.string_replace(l, 'debug', 'release') lib = ET.Element('listOptionValue', {'builtIn': 'false', 'value': temp}) label.append(lib) if label.get('superClass') == "com.atollic.truestudio.ld.misc.linkerflags": temp = label.get('value') if ksdkProj.device[4][1:] != 'm4': temp = kT.string_replace(temp, 'm4', ksdkProj.device[4][1:]) if ksdkProj.rtos != 'bm': temp += ' -Xlinker --defsym=__ram_vector_table__=1' if ksdkProj.rtos == 'mqx': temp += ' -Xlinker --undefined=__isr_vector' label.set('value', temp) prettyRoot = kT.pretty_xml(root, "UTF-8") # Write data to file if not os.path.isdir(kdsPath): os.makedirs(kdsPath) tree = ET.ElementTree(ET.fromstring(prettyRoot)) tree.write(kdsPath + '/.cproject', "UTF-8") kT.cdt_fix_post_xml(kdsPath) return
def gen_cproject(self, ksdkProj): """ Generate the cproject file for KDS project :param ksdkProj: Instance of a KSDK project """ kdsPath = self.parent + ('' if self.parent[-1:] == '/' else '/') + self.name + '/atl' relPath = '' if self.isLinked: tempStr = kT.get_rel_path(kdsPath, ksdkProj.sdkPath) + '/../' if ksdkProj.osType == 'Windows': relPath = kT.string_replace(tempStr, '\\', '/') else: relPath = tempStr[:] else: relPath = '../../' self.projRelPath = relPath # Populate ksdkProj specifics to dictionaries ## Configure linker option ## Configure linker option self.linkLd['listOptionValue'].append(self.projRelPath + self.parentProject.parent.getDirectoryStructureHelper().getLinkerPath(ksdkProj.device, 'gcc', False)) ## Set a define for the device self.cDefines['listOptionValue'].append('CPU_' + ksdkProj.device[2]) if ksdkProj.rtos != 'bm': param = self.parentProject.parent.getSmartcardParam(ksdkProj.device[1]) if param is not None: self.cDefines['listOptionValue'].append(param) if ksdkProj.rtos == 'freertos': self.cDefines['listOptionValue'].append('FSL_RTOS_FREE_RTOS') elif ksdkProj.rtos == 'ucosii': self.cDefines['listOptionValue'].append('FSL_RTOS_UCOSII') elif ksdkProj.rtos == 'ucosiii': self.cDefines['listOptionValue'].append('FSL_RTOS_UCOSIII') ## Add C include paths necessary for project self.cIncludes['listOptionValue'].append(self.projRelPath + self.parentProject.parent.getDirectoryStructureHelper().getCMSISIncludeDirectory(False)) self.cIncludes['listOptionValue'].append(self.projRelPath + self.parentProject.parent.getDirectoryStructureHelper().getDevicesDirectory()) self.cIncludes['listOptionValue'].append(self.projRelPath + self.parentProject.parent.getDirectoryStructureHelper().getDevicesDirectory() + os.sep + ksdkProj.device[1]) self.cIncludes['listOptionValue'].append(self.projRelPath + self.parentProject.parent.getDirectoryStructureHelper().getDevicesDirectory() + os.sep + ksdkProj.device[1] + os.sep + Constants.DRIVERS_FOLDER) self.cIncludes['listOptionValue'].append(self.projRelPath + self.parentProject.parent.getDirectoryStructureHelper().getDevicesDirectory() + os.sep + ksdkProj.device[1] + os.sep + Constants.UTILITIES_FOLDER) self.cIncludes['listOptionValue'].append("../../") # Add rtos paths if ksdkProj.rtos != 'bm': if ksdkProj.rtos == 'freertos': self.cIncludes['listOptionValue'].extend(self.projRelPath + directoryPath for directoryPath in self.parentProject.parent.getFreertosDirectoriesPaths(self.archType, ToolchainType.KinetisDesignStudio, self.parentProject.board[1])) elif ksdkProj.rtos == 'ucosii': self.cIncludes['listOptionValue'].extend(self.projRelPath + directoryPath for directoryPath in self.parentProject.parent.getuCOSIIDirectoriesPaths(self.archType, ToolchainType.KinetisDesignStudio, self.parentProject.board[1])) elif ksdkProj.rtos == 'ucosiii': self.cIncludes['listOptionValue'].extend(self.projRelPath + directoryPath for directoryPath in self.parentProject.parent.getuCOSIIIDirectoriesPaths(self.archType, ToolchainType.KinetisDesignStudio, self.parentProject.board[1])) # l = kT.string_replace(l, 'zzz', ksdkProj.rtos) # kT.debug_log(l) # if self.projType == 'usb': # l = kT.string_replace(l, 'yyy', ksdkProj.board[1]) # b = l # Configure linker stack and heap if self.projType == 'usb': if ksdkProj.rtos == 'bm': if 'kl' in ksdkProj.board[1]: self.linkDefines['listOptionValue'][1] = '__stack_size__=0x400' else: self.linkDefines['listOptionValue'][1] = '__stack_size__=0x1000' else: if 'kl' in ksdkProj.board[1]: self.linkDefines['listOptionValue'][1] = '__stack_size__=0x400' else: self.linkDefines['listOptionValue'][1] = '__stack_size__=0x1000' tree = ET.ElementTree(ET.fromstring(aF.formatted_cproject)) root = tree.getroot() #exclude drivers from build excludedDriversText = '' driverPaths = [(Constants.DRIVERS_FOLDER if d[ksdkObj.LOCATION_URI_KEY].find(Constants.DRIVERS_FOLDER) != -1 else Constants.UTILITIES_FOLDER) + '/' + d[ksdkObj.NAME_KEY] for d in self.parentProject.parent.getDriversExcludedFromBuild(ksdkProj.device[1])] for f in driverPaths: if f.endswith('.c'): excludedDriversText += f if not driverPaths.index(f) == len(driverPaths): excludedDriversText += '|' for excludeEntry in root.findall('.//sourceEntries'): elem = ET.Element('entry', {'excluding': excludedDriversText, 'flags':'VALUE_WORKSPACE_PATH', 'kind':'sourcePath', 'name':''}) excludeEntry.insert(0, elem) for child in root.findall('storageModule'): for config in child.findall('cconfiguration'): for module in config.findall('storageModule'): if module.get('moduleId') == "cdtBuildSystem": for configure in module.findall('configuration'): buildVer = configure.get('name') for folder in configure.findall('folderInfo'): for toolC in folder.findall('toolChain'): for tool in toolC.findall('tool'): #Add assembler options if tool.get('name') == "Assembler": for label in tool.findall('option'): if label.get('superClass') == "com.atollic.truestudio.common_options.target.fpu": optionVal = "hard" if ksdkProj.device[3] else "soft" #print optionVal label.set('value', "com.atollic.truestudio.common_options.target.fpu." + optionVal) if label.get('superClass') == "com.atollic.truestudio.as.general.otherflags": label.set('value', " -mcpu=cortex-" + ksdkProj.device[4][1:]) if label.get('superClass') == "com.atollic.truestudio.as.general.incpath": if ksdkProj.rtos == 'freertos': for a in self.asmIncludes['listOptionValue']: path = ET.Element('listOptionValue', {'builtIn': 'false', 'value': a}) label.append(path) #Add compiler options if tool.get('name') == "C Compiler": for label in tool.findall('option'): #Add include paths if label.get('superClass') == "com.atollic.truestudio.gcc.directories.select": #Add New Include paths for i in self.cIncludes['listOptionValue']: path = ET.Element('listOptionValue', {'builtIn': 'false', 'value': i}) label.append(path) #Add compiler defines if label.get('superClass') == "com.atollic.truestudio.gcc.symbols.defined": # Add new project defines for d in self.cDefines['listOptionValue']: define = ET.Element('listOptionValue', {'builtIn': 'false', 'value': d}) label.append(define) if label.get('superClass') == "com.atollic.truestudio.common_options.target.fpu": optionVal = "hard" if ksdkProj.device[3] else "soft" #print optionVal label.set('value', "com.atollic.truestudio.common_options.target.fpu." + optionVal) if label.get('superClass') == "com.atollic.truestudio.gcc.misc.otherflags": label.set('value', " -mcpu=cortex-" + ksdkProj.device[4][1:]) #Add linker options if tool.get('name') == "C Linker": for label in tool.findall('option'): #Add linker script if label.get('superClass') == "com.atollic.truestudio.ld.general.scriptfile": for l in self.linkLd['listOptionValue']: label.set('value', l) if label.get('superClass') == "com.atollic.truestudio.ld.misc.linkerflags": temp = label.get('value') if ksdkProj.device[4][1:] != 'm4': temp = kT.string_replace(temp, 'm4', ksdkProj.device[4][1:]) if ksdkProj.rtos != 'bm': temp += ' -Xlinker --defsym=__ram_vector_table__=1' if ksdkProj.rtos == 'mqx': temp += ' -Xlinker --undefined=__isr_vector' label.set('value', temp) prettyRoot = kT.pretty_xml(root, "UTF-8") # Write data to file if not os.path.isdir(kdsPath): os.makedirs(kdsPath) tree = ET.ElementTree(ET.fromstring(prettyRoot)) tree.write(kdsPath + '/.cproject', "UTF-8") kT.cdt_fix_post_xml(kdsPath) return