Beispiel #1
0
    def __init__(self, target):
        cache = Cache(True, False)
        data_path = join(save_data_path('arm-pack-manager'), "index.json")
        if not exists(data_path) or not self.check_version(data_path):
            cache.cache_descriptors()

        t = TARGET_MAP[target]
        self.core = t.core
        try:
            cpu_name = t.device_name
            target_info = cache.index[cpu_name]
        # Target does not have device name or pdsc file
        except:
            try:
                # Try to find the core as a generic CMSIS target
                cpu_name = self.cpu_cmsis()
                target_info = cache.index[cpu_name]
            except:
                raise TargetNotSupportedException("Target not in CMSIS packs")

        self.target_info = target_info

        self.url = target_info['pdsc_file']
        self.pack_url, self.pack_id = ntpath.split(self.url)
        self.dname = cpu_name
        self.dfpu = target_info['processor']['fpu']
        self.debug, self.dvendor = self.vendor_debug(target_info['vendor'])
        self.dendian = target_info['processor'].get('endianness',
                                                    'Little-endian')
        self.debug_svd = target_info.get('debug', '')
        self.compile_header = target_info['compile']['header']
Beispiel #2
0
 def __init__(self, target):
     target_info = self.check_supported(target)
     if not target_info:
         raise TargetNotSupportedException("Target not supported in CMSIS pack")
     self.pack_url = target_info['from_pack']['url']
     self.pack_id = "{}.{}.{}".format(
         target_info['from_pack']['vendor'],
         target_info['from_pack']['pack'],
         target_info['from_pack']['version']
     )
     self.dname = target_info["name"]
     self.core = target_info["_core"]
     self.dfpu = None
     try:
         self.dfpu = target_info['processor']['Symmetric']['fpu']
     except KeyError:
         # TODO: refactor this into a "base_core_for" function
         cmsis_core = self.core.replace("F", "").replace("-", "").replace("E", "")
         cmsis_core = cmsis_core.replace("NS", "")
         for core_name, proc in target_info['processor']['Asymmetric'].items():
             if proc['core'] == cmsis_core:
                 self.dfpu = proc['fpu']
                 self.dname = '{}:{}'.format(self.dname, core_name)
                 break
     self.debug, self.dvendor = self.vendor_debug(
         target_info.get('vendor') or target_info['from_pack']['vendor']
     )
     self.dendian = target_info['processor'].get(
         'endianness', 'Little-endian'
     )
     self.debug_svd = target_info.get('debug', '')
     self.target_info = target_info
Beispiel #3
0
 def __init__(self, target):
     target_info = self.check_supported(target)
     if not target_info:
         raise TargetNotSupportedException(
             "Target not supported in CMSIS pack")
     self.url = target_info['pdsc_file']
     self.pack_url, self.pack_id = ntpath.split(self.url)
     self.dname = target_info["_cpu_name"]
     self.core = target_info["_core"]
     self.dfpu = target_info['processor']['fpu']
     self.debug, self.dvendor = self.vendor_debug(target_info['vendor'])
     self.dendian = target_info['processor'].get('endianness',
                                                 'Little-endian')
     self.debug_svd = target_info.get('debug', '')
     self.compile_header = target_info['compile']['header']
     self.target_info = target_info
Beispiel #4
0
 def __init__(self, target):
     target_info = self.check_supported(target)
     if not target_info:
         raise TargetNotSupportedException(
             "Target not supported in CMSIS pack")
     self.pack_url = target_info['from_pack']['url']
     self.pack_id = "{}.{}.{}".format(target_info['from_pack']['vendor'],
                                      target_info['from_pack']['pack'],
                                      target_info['from_pack']['version'])
     self.dname = target_info["name"]
     self.core = target_info["_core"]
     try:
         self.dfpu = target_info['processor']['Symmetric']['fpu']
     except KeyError:
         self.dfpu = target_info['processor']['Asymmetric']['fpu']
     self.debug, self.dvendor = self.vendor_debug(
         target_info.get('vendor') or target_info['from_pack']['vendor'])
     self.dendian = target_info['processor'].get('endianness',
                                                 'Little-endian')
     self.debug_svd = target_info.get('debug', '')
     self.target_info = target_info