Merge pull request #2708 from sarahmarshy/uvision-and-iar

[Exporters] Refactor Uvision and IAR and initial support of CMSIS projects
pull/2958/head
Sam Grove 2016-10-06 15:54:00 -05:00 committed by GitHub
commit 76fb1f8c3f
26 changed files with 4280 additions and 2310 deletions

View File

@ -14,7 +14,7 @@ mbed uses JSON as a description language for its build targets. The JSON descrip
"function": "TEENSY3_1Code.binary_hook",
"toolchains": ["ARM_STD", "ARM_MICRO", "GCC_ARM"]
},
"progen": {"target": "teensy-31"},
"device_name": "MK20DX256xxx7",
"detect_code": ["0230"]
```
@ -160,17 +160,10 @@ In this case, it converts the output file (`binf`) from binary format to Intel H
The hook code can look quite different between different targets. Take a look at the other classes in *targets.py* for more examples of hook code.
## progen
## device_name
This property is used to pass additional data to the project generator (used to export the mbed code to various 3rd party tools and IDEs). A definition for `progen` looks like this:
This property is used to pass necessary data for exporting the mbed code to various 3rd party tools and IDEs.
```
"progen": {
"target": "lpc11u35_401",
"uvision": {
"template": ["uvision_microlib.uvproj.tmpl"]
}
```
This is possible because the device name corresponds to a field in publicly hosted CMSIS packs. These packs hold target properties. [This](http://www.keil.com/pack/Keil.Kinetis_K20_DFP.pdsc) is the pdsc that contains TEENSY_31 device (MK20DX256xxx7). The device information begins on line 156. The dname (device name) field on line 156 directly corresponds to that in the Uvision5 IDE target selection window. Beginning on line 15 of `tools/export/uvision/uvision.tmpl`, target information from these packs is used to generate valid Uvision5 projects. If the device name is not found, we use a generic ARM CPU target in Uvision5.
`tools/export/iar/iar_definitions.json` utilizes this device name to store information necessary to set the target in an IAR project.
The `target` property of `progen` specifies the target name that must be used for the exporter (if different than the mbed target name).
For each exporter, a template for exporting can also be specified. In this example, the template used for generating a uVision project file is in a file called `uvision_microlib.uvproj.tmpl`. It is assumed that all the templates are located in `tools/export`.

View File

@ -3,11 +3,13 @@ PySerial>=2.7
PrettyTable>=0.7.2
Jinja2>=2.7.3
IntelHex>=1.3
project-generator==0.9.10
project_generator_definitions>=0.2.26,<0.3.0
junit-xml
pyYAML
requests
mbed-ls>=0.2.13
mbed-host-tests>=1.1.2
mbed-greentea>=0.2.24
pyxdg>=0.25
pycurl>=4
beautifulsoup4>=4
fuzzywuzzy>=0.11

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,459 @@
from xdg.BaseDirectory import save_data_path
from pycurl import Curl
from bs4 import BeautifulSoup
from os.path import join, dirname, basename
from os import makedirs
from errno import EEXIST
from threading import Thread
from Queue import Queue
from re import compile, sub
from sys import stderr, stdout
from fuzzywuzzy import process
from itertools import takewhile
import argparse
from json import dump, load
from zipfile import ZipFile
RootPackURL = "http://www.keil.com/pack/index.idx"
protocol_matcher = compile("\w*://")
def strip_protocol(url) :
return protocol_matcher.sub("", str(url))
def largest_version(content) :
return sorted([t['version'] for t in content.package.releases('release')], reverse=True)[0]
def do_queue(Class, function, interable) :
q = Queue()
threads = [Class(q, function) for each in range(20)]
for each in threads :
each.setDaemon(True)
each.start()
for thing in interable :
q.put(thing)
q.join()
class Reader (Thread) :
def __init__(self, queue, func) :
Thread.__init__(self)
self.queue = queue
self.func = func
def run(self) :
while True :
url = self.queue.get()
self.func(url)
self.queue.task_done()
class Cacher (Thread) :
def __init__(self, queue, func) :
Thread.__init__(self)
self.queue = queue
self.curl = Curl()
self.curl.setopt(self.curl.FOLLOWLOCATION, True)
self.func = func
def run(self) :
while True :
url = self.queue.get()
self.func(self.curl, url)
self.queue.task_done()
class Cache () :
""" The Cache object is the only relevant API object at the moment
Constructing the Cache object does not imply any caching.
A user of the API must explicitly call caching functions.
:param silent: A boolean that, when True, significantly reduces the printing of this Object
:type silent: bool
:param no_timeouts: A boolean that, when True, disables the default connection timeout and low speed timeout for downloading things.
:type no_timeouts: bool
"""
def __init__ (self, silent, no_timeouts) :
self.silent = silent
self.counter = 0
self.total = 1
self._index = {}
self._aliases = {}
self.urls = None
self.no_timeouts = no_timeouts
def display_counter (self, message) :
stdout.write("{} {}/{}\r".format(message, self.counter, self.total))
stdout.flush()
def cache_file (self, curl, url) :
"""Low level interface to caching a single file.
:param curl: The user is responsible for providing a curl.Curl object as the curl parameter.
:type curl: curl.Curl
:param url: The URL to cache.
:type url: str
:rtype: None
"""
if not self.silent : print("Caching {}...".format(url))
dest = join(save_data_path('arm-pack-manager'), strip_protocol(url))
try :
makedirs(dirname(dest))
except OSError as exc :
if exc.errno == EEXIST : pass
else : raise
with open(dest, "wb+") as fd :
curl.setopt(curl.URL, url)
curl.setopt(curl.FOLLOWLOCATION, True)
curl.setopt(curl.WRITEDATA, fd)
if not self.no_timeouts :
curl.setopt(curl.CONNECTTIMEOUT, 2)
curl.setopt(curl.LOW_SPEED_LIMIT, 50 * 1024)
curl.setopt(curl.LOW_SPEED_TIME, 2)
try :
curl.perform()
except Exception as e :
stderr.write("[ ERROR ] file {} did not download {}\n".format(url, str(e)))
self.counter += 1
self.display_counter("Caching Files")
def pdsc_to_pack (self, url) :
"""Find the URL of the specified pack file described by a PDSC.
The PDSC is assumed to be cached and is looked up in the cache by its URL.
:param url: The url used to look up the PDSC.
:type url: str
:return: The url of the PACK file.
:rtype: str
"""
content = self.pdsc_from_cache(url)
new_url = content.package.url.get_text()
if not new_url.endswith("/") :
new_url = new_url + "/"
return (new_url + content.package.vendor.get_text() + "." +
content.package.find('name').get_text() + "." +
largest_version(content) + ".pack")
def cache_pdsc_and_pack (self, curl, url) :
self.cache_file(curl, url)
try :
self.cache_file(curl, self.pdsc_to_pack(url))
except AttributeError :
stderr.write("[ ERROR ] {} does not appear to be a conforming .pdsc file\n".format(url))
self.counter += 1
def get_urls(self):
"""Extract the URLs of all know PDSC files.
Will pull the index from the internet if it is not cached.
:return: A list of all PDSC URLs
:rtype: [str]
"""
if not self.urls :
try : root_data = self.pdsc_from_cache(RootPackURL)
except IOError : root_data = self.cache_and_parse(RootPackURL)
self.urls = ["/".join([pdsc.get('url').strip("/"),
pdsc.get('name').strip("/")])
for pdsc in root_data.find_all("pdsc")]
return self.urls
def _extract_dict(self, device, filename, pack) :
to_ret = dict(pdsc_file=filename, pack_file=pack)
try : to_ret["memory"] = dict([(m["id"], dict(start=m["start"],
size=m["size"]))
for m in device("memory")])
except (KeyError, TypeError, IndexError) as e : pass
try: algorithms = device("algorithm")
except:
try: algorithms = device.parent("algorithm")
except: pass
else:
if not algorithms:
try: algorithms = device.parent("algorithm")
except: pass
try : to_ret["algorithm"] = dict([(algo.get("name").replace('\\','/'),
dict(start=algo["start"],
size=algo["size"],
ramstart=algo.get("ramstart",None),
ramsize=algo.get("ramsize",None),
default=algo.get("default",1)))
for algo in algorithms])
except (KeyError, TypeError, IndexError) as e: pass
try: to_ret["debug"] = device.parent.parent.debug["svd"]
except (KeyError, TypeError, IndexError) as e : pass
try: to_ret["debug"] = device.parent.debug["svd"]
except (KeyError, TypeError, IndexError) as e : pass
try: to_ret["debug"] = device.debug["svd"]
except (KeyError, TypeError, IndexError) as e : pass
to_ret["compile"] = {}
try: compile_l1 = device.parent("compile")
except (KeyError, TypeError, IndexError) as e : compile_l1 = []
try: compile_l2 = device.parent.parent("compile")
except (KeyError, TypeError, IndexError) as e : compile_l2 = []
compile = compile_l2 + compile_l1
for c in compile:
try: to_ret["compile"]["header"] = c["header"]
except (KeyError, TypeError, IndexError) as e : pass
try: to_ret["compile"]["define"] = c["define"]
except (KeyError, TypeError, IndexError) as e : pass
try: to_ret["core"] = device.parent.processor['dcore']
except (KeyError, TypeError, IndexError) as e : pass
try: to_ret["core"] = device.parent.parent.processor['dcore']
except (KeyError, TypeError, IndexError) as e : pass
to_ret["processor"] = {}
try: proc_l1 = device("processor")
except (KeyError, TypeError, IndexError) as e: proc_l1 = []
try: proc_l2 = device.parent("processor")
except (KeyError, TypeError, IndexError) as e: proc_l2 = []
try: proc_l3 = device.parent.parent("processor")
except (KeyError, TypeError, IndexError) as e: proc_l3 = []
proc = proc_l3 + proc_l2 + proc_l1
for p in proc:
try: to_ret["processor"]["fpu"] = p['dfpu']
except (KeyError, TypeError, IndexError) as e: pass
try: to_ret["processor"]["endianness"] = p['dendian']
except (KeyError, TypeError, IndexError) as e: pass
try: to_ret["processor"]["clock"] = p['dclock']
except (KeyError, TypeError, IndexError) as e: pass
try: to_ret["vendor"] = device.parent['dvendor']
except (KeyError, TypeError, IndexError) as e: pass
try: to_ret["vendor"] = device.parent.parent['dvendor']
except (KeyError, TypeError, IndexError) as e: pass
if not to_ret["processor"]:
del to_ret["processor"]
if not to_ret["compile"]:
del to_ret["compile"]
to_ret['debug-interface'] = []
return to_ret
def _generate_index_helper(self, d) :
try :
pack = self.pdsc_to_pack(d)
self._index.update(dict([(dev['dname'], self._extract_dict(dev, d, pack)) for dev in
(self.pdsc_from_cache(d)("device"))]))
except AttributeError as e :
stderr.write("[ ERROR ] file {}\n".format(d))
print(e)
self.counter += 1
self.display_counter("Generating Index")
def _generate_aliases_helper(self, d) :
try :
mydict = []
for dev in self.pdsc_from_cache(d)("board"):
try :
mydict.append((dev['name'], dev.mounteddevice['dname']))
except (KeyError, TypeError, IndexError) as e:
pass
self._aliases.update(dict(mydict))
except (AttributeError, TypeError) as e :
pass
self.counter += 1
self.display_counter("Scanning for Aliases")
def get_flash_algorthim_binary(self, device_name) :
"""Retrieve the flash algorithm file for a particular part.
Assumes that both the PDSC and the PACK file associated with that part are in the cache.
:param device_name: The exact name of a device
:type device_name: str
:return: A file-like object that, when read, is the ELF file that describes the flashing algorithm
:rtype: ZipExtFile
"""
pack = self.pack_from_cache(self.index[device_name])
return pack.open(device['algorithm']['file'])
def get_svd_file(self, device_name) :
"""Retrieve the flash algorithm file for a particular part.
Assumes that both the PDSC and the PACK file associated with that part are in the cache.
:param device_name: The exact name of a device
:type device_name: str
:return: A file-like object that, when read, is the ELF file that describes the flashing algorithm
:rtype: ZipExtFile
"""
pack = self.pack_from_cache(self.index[device_name])
return pack.open(device['debug'])
def generate_index(self) :
self._index = {}
self.counter = 0
do_queue(Reader, self._generate_index_helper, self.get_urls())
with open(join(save_data_path('arm-pack-manager'), "index.json"), "wb+") as out:
self._index["version"] = "0.1.0"
dump(self._index, out)
stdout.write("\n")
def generate_aliases(self) :
self._aliases = {}
self.counter = 0
do_queue(Reader, self._generate_aliases_helper, self.get_urls())
with open(join(save_data_path('arm-pack-manager'), "aliases.json"), "wb+") as out:
dump(self._aliases, out)
stdout.write("\n")
def find_device(self, match) :
choices = process.extract(match, self.index.keys(), limit=len(self.index))
choices = sorted([(v, k) for k, v in choices], reverse=True)
if choices : choices = list(takewhile(lambda t: t[0] == choices[0][0], choices))
return [(v, self.index[v]) for k,v in choices]
def dump_index_to_file(self, file) :
with open(file, "wb+") as out:
dump(self.index, out)
@property
def index(self) :
"""An index of most of the important data in all cached PDSC files.
:Example:
>>> from ArmPackManager import Cache
>>> a = Cache()
>>> a.index["LPC1768"]
{u'algorithm': {u'RAMsize': u'0x0FE0',
u'RAMstart': u'0x10000000',
u'name': u'Flash/LPC_IAP_512.FLM',
u'size': u'0x80000',
u'start': u'0x00000000'},
u'compile': [u'Device/Include/LPC17xx.h', u'LPC175x_6x'],
u'debug': u'SVD/LPC176x5x.svd',
u'pdsc_file': u'http://www.keil.com/pack/Keil.LPC1700_DFP.pdsc',
u'memory': {u'IRAM1': {u'size': u'0x8000', u'start': u'0x10000000'},
u'IRAM2': {u'size': u'0x8000', u'start': u'0x2007C000'},
u'IROM1': {u'size': u'0x80000', u'start': u'0x00000000'}}}
"""
if not self._index :
try :
with open(join(save_data_path('arm-pack-manager'), "index.json")) as i :
self._index = load(i)
except IOError :
self.generate_index()
return self._index
@property
def aliases(self) :
"""An index of most of the important data in all cached PDSC files.
:Example:
>>> from ArmPackManager import Cache
>>> a = Cache()
>>> a.index["LPC1768"]
{u'algorithm': {u'RAMsize': u'0x0FE0',
u'RAMstart': u'0x10000000',
u'name': u'Flash/LPC_IAP_512.FLM',
u'size': u'0x80000',
u'start': u'0x00000000'},
u'compile': [u'Device/Include/LPC17xx.h', u'LPC175x_6x'],
u'debug': u'SVD/LPC176x5x.svd',
u'pdsc_file': u'http://www.keil.com/pack/Keil.LPC1700_DFP.pdsc',
u'memory': {u'IRAM1': {u'size': u'0x8000', u'start': u'0x10000000'},
u'IRAM2': {u'size': u'0x8000', u'start': u'0x2007C000'},
u'IROM1': {u'size': u'0x80000', u'start': u'0x00000000'}}}
"""
if not self._aliases :
try :
with open(join(save_data_path('arm-pack-manager'), "aliases.json")) as i :
self._aliases = load(i)
except IOError :
self.generate_aliases()
return self._aliases
def cache_everything(self) :
"""Cache every PACK and PDSC file known.
Generates an index afterwards.
.. note:: This process may use 4GB of drive space and take upwards of 10 minutes to complete.
"""
self.cache_pack_list(self.get_urls())
self.generate_index()
self.generate_aliases()
def cache_descriptors(self) :
"""Cache every PDSC file known.
Generates an index afterwards.
.. note:: This process may use 11MB of drive space and take upwards of 1 minute.
"""
self.cache_descriptor_list(self.get_urls())
self.generate_index()
self.generate_aliases()
def cache_descriptor_list(self, list) :
"""Cache a list of PDSC files.
:param list: URLs of PDSC files to cache.
:type list: [str]
"""
self.total = len(list)
self.display_counter("Caching Files")
do_queue(Cacher, self.cache_file, list)
stdout.write("\n")
def cache_pack_list(self, list) :
"""Cache a list of PACK files, referenced by their PDSC URL
:param list: URLs of PDSC files to cache.
:type list: [str]
"""
self.total = len(list) * 2
self.display_counter("Caching Files")
do_queue(Cacher, self.cache_pdsc_and_pack, list)
stdout.write("\n")
def pdsc_from_cache(self, url) :
"""Low level inteface for extracting a PDSC file from the cache.
Assumes that the file specified is a PDSC file and is in the cache.
:param url: The URL of a PDSC file.
:type url: str
:return: A parsed representation of the PDSC file.
:rtype: BeautifulSoup
"""
dest = join(save_data_path('arm-pack-manager'), strip_protocol(url))
with open(dest, "r") as fd :
return BeautifulSoup(fd, "html.parser")
def pack_from_cache(self, url) :
"""Low level inteface for extracting a PACK file from the cache.
Assumes that the file specified is a PACK file and is in the cache.
:param url: The URL of a PACK file.
:type url: str
:return: A parsed representation of the PACK file.
:rtype: ZipFile
"""
return ZipFile(join(save_data_path('arm-pack-manager'),
strip_protocol(device['pack_file'])))
def gen_dict_from_cache() :
pdsc_files = pdsc_from_cache(RootPackUrl)
def cache_and_parse(self, url) :
"""A low level shortcut that Caches and Parses a PDSC file.
:param url: The URL of the PDSC file.
:type url: str
:return: A parsed representation of the PDSC file.
:rtype: BeautifulSoup
"""
self.cache_file(Curl(), url)
return self.pdsc_from_cache(url)

View File

@ -0,0 +1,191 @@
import argparse
from os.path import basename
from tools.arm_pack_manager import Cache
from os.path import basename, join, dirname, exists
from os import makedirs
from itertools import takewhile
from fuzzywuzzy import process
from tools.arm_pack_manager import Cache
parser = argparse.ArgumentParser(description='A Handy little utility for keeping your cache of pack files up to date.')
subparsers = parser.add_subparsers(title="Commands")
def subcommand(name, *args, **kwargs):
def subcommand(command):
subparser = subparsers.add_parser(name, **kwargs)
for arg in args:
arg = dict(arg)
opt = arg['name']
del arg['name']
if isinstance(opt, basestring):
subparser.add_argument(opt, **arg)
else:
subparser.add_argument(*opt, **arg)
subparser.add_argument("-v", "--verbose", action="store_true", dest="verbose", help="Verbose diagnostic output")
subparser.add_argument("-vv", "--very_verbose", action="store_true", dest="very_verbose", help="Very verbose diagnostic output")
subparser.add_argument("--no-timeouts", action="store_true", help="Remove all timeouts and try to download unconditionally")
subparser.add_argument("--and", action="store_true", dest="intersection", help="combine search terms as if with an and")
subparser.add_argument("--or", action="store_false", dest="intersection", help="combine search terms as if with an or")
subparser.add_argument("--union", action="store_false", dest="intersection", help="combine search terms as if with a set union")
subparser.add_argument("--intersection", action="store_true", dest="intersection", help="combine search terms as if with a set intersection")
def thunk(parsed_args):
cache = Cache(not parsed_args.verbose, parsed_args.no_timeouts)
argv = [arg['dest'] if 'dest' in arg else arg['name'] for arg in args]
argv = [(arg if isinstance(arg, basestring) else arg[-1]).strip('-')
for arg in argv]
argv = {arg: vars(parsed_args)[arg] for arg in argv
if vars(parsed_args)[arg] is not None}
return command(cache, **argv)
subparser.set_defaults(command=thunk)
return command
return subcommand
def user_selection (message, options) :
print(message)
for choice, index in zip(options, range(len(options))) :
print("({}) {}".format(index, choice))
pick = None
while pick is None :
stdout.write("please select an integer from 0 to {} or \"all\"".format(len(options)-1))
input = raw_input()
try :
if input == "all" :
pick = options
else :
pick = [options[int(input)]]
except ValueError :
print("I did not understand your input")
return pick
def fuzzy_find(matches, urls) :
choices = {}
for match in matches :
for key, value in process.extract(match, urls, limit=None) :
choices.setdefault(key, 0)
choices[key] += value
choices = sorted([(v, k) for k, v in choices.iteritems()], reverse=True)
if not choices : return []
elif len(choices) == 1 : return [choices[0][1]]
elif choices[0][0] > choices[1][0] : choices = choices[:1]
else : choices = list(takewhile(lambda t: t[0] == choices[0][0], choices))
return [v for k,v in choices]
@subcommand('cache',
dict(name='matches', nargs="*",
help="a bunch of things to search for in part names"),
dict(name=['-e','--everything'], action="store_true",
help="download everything possible"),
dict(name=['-d','--descriptors'], action="store_true",
help="download all descriptors"),
dict(name=["-b","--batch"], action="store_true",
help="don't ask for user input and assume download all"),
help="Cache a group of PACK or PDSC files")
def command_cache (cache, matches, everything=False, descriptors=False, batch=False, verbose= False, intersection=True) :
if everything :
cache.cache_everything()
return True
if descriptors :
cache.cache_descriptors()
return True
if not matches :
print("No action specified nothing to do")
else :
urls = cache.get_urls()
if intersection :
choices = fuzzy_find(matches, map(basename, urls))
else :
choices = sum([fuzzy_find([m], map(basename, urls)) for m in matches], [])
if not batch and len(choices) > 1 :
choices = user_selection("Please select a file to cache", choices)
to_download = []
for choice in choices :
for url in urls :
if choice in url :
to_download.append(url)
cache.cache_pack_list(to_download)
return True
@subcommand('find-part',
dict(name='matches', nargs="+", help="words to match to processors"),
dict(name=['-l',"--long"], action="store_true",
help="print out part details with part"),
dict(name=['-p', '--parts-only'], action="store_false", dest="print_aliases"),
dict(name=['-a', '--aliases-only'], action="store_false", dest="print_parts"),
help="Find a Part and it's description within the cache")
def command_find_part (cache, matches, long=False, intersection=True,
print_aliases=True, print_parts=True) :
if long :
import pprint
pp = pprint.PrettyPrinter()
parts = cache.index
if intersection :
choices = fuzzy_find(matches, parts.keys())
aliases = fuzzy_find(matches, cache.aliases.keys())
else :
choices = sum([fuzzy_find([m], parts.keys()) for m in matches], [])
aliases = sum([fuzzy_find([m], cache.aliases.keys()) for m in matches], [])
if print_parts:
for part in choices :
print part
if long :
pp.pprint(cache.index[part])
if print_aliases:
for alias in aliases :
print alias
if long :
pp.pprint(cache.index[cache.aliases[alias]])
@subcommand('dump-parts',
dict(name='out', help='directory to dump to'),
dict(name='parts', nargs='+', help='parts to dump'),
help='Create a directory with an index.json describing the part and all of their associated flashing algorithms.'
)
def command_dump_parts (cache, out, parts, intersection=False) :
index = {}
if intersection :
for part in fuzzy_find(parts, cache.index):
index.update(cache.index[part])
else :
for part in parts :
index.update(dict(cache.find_device(part)))
for n, p in index.iteritems() :
try :
if not exists(join(out, dirname(p['algorithm']['file']))) :
makedirs(join(out, dirname(p['algorithm']['file'])))
with open(join(out, p['algorithm']['file']), "wb+") as fd :
fd.write(cache.get_flash_algorthim_binary(n).read())
except KeyError:
print("[Warning] {} does not have an associated flashing algorithm".format(n))
with open(join(out, "index.json"), "wb+") as fd :
dump(index,fd)
@subcommand('cache-part',
dict(name='matches', nargs="+", help="words to match to devices"),
help='Cache PACK files associated with the parts matching the provided words')
def command_cache_part (cache, matches, intersection=True) :
index = cache.index
if intersection :
choices = fuzzy_find(matches, index.keys())
aliases = fuzzy_find(matches, cache.aliases.keys())
else :
choices = sum([fuzzy_find([m], index.keys()) for m in matches], [])
aliases = sum([fuzzy_find([m], cache.aliases.keys()) for m in matches], [])
urls = set([index[c]['pdsc_file'] for c in choices])
urls += set([index[cache.aliasse[a]] for a in aliases])
cache.cache_pack_list(list(urls))
def get_argparse() :
return parser
def main() :
args = parser.parse_args()
args.command(args)

View File

@ -14,30 +14,23 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os, tempfile
from os.path import join, exists, basename
from shutil import copytree, rmtree, copy
import yaml
from tools.export import uvision4, uvision5, codered, makefile, ds5_5, iar
from tools.export import codered, ds5_5, iar, makefile
from tools.export import emblocks, coide, kds, simplicityv3, atmelstudio
from tools.export import sw4stm32, e2studio, zip, cdt
from tools.export import sw4stm32, e2studio, zip, cmsis, uvision, cdt
from tools.export.exporters import OldLibrariesException, FailedBuildException
from tools.targets import TARGET_NAMES, EXPORT_MAP, TARGET_MAP
from project_generator_definitions.definitions import ProGenDef
from tools.targets import TARGET_NAMES
EXPORTERS = {
'uvision': uvision5.Uvision5,
'uvision4': uvision4.Uvision4, # deprecated - to be removed in future version
'uvision5': uvision5.Uvision5,
'uvision5': uvision.Uvision,
'uvision': uvision.Uvision,
'lpcxpresso': codered.CodeRed,
'gcc_arm': makefile.GccArm,
'make_gcc_arm': makefile.GccArm,
'make_armc5': makefile.Armc5,
'make_iar': makefile.IAR,
'ds5_5': ds5_5.DS5_5,
'iar': iar.IAREmbeddedWorkbench,
'iar': iar.IAR,
'emblocks' : emblocks.IntermediateFile,
'coide' : coide.CoIDE,
'kds' : kds.KDS,
@ -48,7 +41,8 @@ EXPORTERS = {
'eclipse_gcc_arm' : cdt.EclipseGcc,
'eclipse_iar' : cdt.EclipseIAR,
'eclipse_armc5' : cdt.EclipseArmc5,
'zip' : zip.ZIP
'zip' : zip.ZIP,
'cmsis' : cmsis.CMSIS
}
ERROR_MESSAGE_UNSUPPORTED_TOOLCHAIN = """

View File

@ -0,0 +1,144 @@
import os
from os.path import sep, join, exists
from itertools import groupby
from xml.etree.ElementTree import Element, tostring
import ntpath
import re
import json
from xdg.BaseDirectory import save_data_path
from tools.arm_pack_manager import Cache
from tools.targets import TARGET_MAP
from tools.export.exporters import Exporter, TargetNotSupportedException
class fileCMSIS():
"""CMSIS file class.
Encapsulates information necessary for files in cpdsc project file"""
file_types = {'.cpp': 'sourceCpp', '.c': 'sourceC', '.s': 'sourceAsm',
'.obj': 'object', '.o': 'object', '.lib': 'library',
'.ar': 'linkerScript', '.h': 'header', '.sct': 'linkerScript'}
def __init__(self, loc, name):
#print loc
_, ext = os.path.splitext(loc)
self.type = self.file_types[ext.lower()]
self.loc = loc
self.name = name
class DeviceCMSIS():
"""CMSIS Device class
Encapsulates target information retrieved by arm-pack-manager"""
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']
def check_version(self, filename):
with open(filename) as data_file:
data = json.load(data_file)
return data.get("version", "0") == "0.1.0"
def vendor_debug(self, vendor):
reg = "([\w\s]+):?\d*?"
m = re.search(reg, vendor)
vendor_match = m.group(1) if m else None
debug_map ={
'STMicroelectronics':'ST-Link',
'Silicon Labs':'J-LINK',
'Nuvoton':'NULink'
}
return debug_map.get(vendor_match, "CMSIS-DAP"), vendor_match
def cpu_cmsis(self):
#Cortex-M4F => ARMCM4_FP, Cortex-M0+ => ARMCM0P
cpu = self.core
cpu = cpu.replace("Cortex-","ARMC")
cpu = cpu.replace("+","P")
cpu = cpu.replace("F","_FP")
return cpu
class CMSIS(Exporter):
NAME = 'cmsis'
TOOLCHAIN = 'ARM'
TARGETS = [target for target, obj in TARGET_MAP.iteritems()
if "ARM" in obj.supported_toolchains]
def make_key(self, src):
"""turn a source file into its group name"""
key = src.name.split(sep)[0]
if key == ".":
key = os.path.basename(os.path.realpath(self.export_dir))
return key
def group_project_files(self, sources, root_element):
"""Recursively group the source files by their encompassing directory"""
data = sorted(sources, key=self.make_key)
for group, files in groupby(data, self.make_key):
new_srcs = []
for f in list(files):
spl = f.name.split(sep)
if len(spl)==2:
file_element = Element('file',
attrib={
'category':f.type,
'name': f.loc})
root_element.append(file_element)
else:
f.name = os.path.join(*spl[1:])
new_srcs.append(f)
if new_srcs:
group_element = Element('group',attrib={'name':group})
root_element.append(self.group_project_files(new_srcs,
group_element))
return root_element
def generate(self):
srcs = self.resources.headers + self.resources.s_sources + \
self.resources.c_sources + self.resources.cpp_sources + \
self.resources.objects + self.resources.libraries + \
[self.resources.linker_script]
srcs = [fileCMSIS(src, src) for src in srcs if src]
ctx = {
'name': self.project_name,
'project_files': tostring(self.group_project_files(srcs, Element('files'))),
'device': DeviceCMSIS(self.target),
'date': ''
}
# TODO: find how to keep prettyxml from adding xml version to this blob
#dom = parseString(ctx['project_files'])
#ctx['project_files'] = dom.toprettyxml(indent="\t")
self.gen_file('cmsis/cpdsc.tmpl', ctx, 'project.cpdsc')

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<package xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="PACK.xsd">
<vendor>Keil</vendor>
<name>{{name}}</name>
<description>Exported mbed project.</description>
<url>{{device.url}}</url>
<releases>
<release version="5.20.0.2">Generated</release>
</releases>
<create>
<project name="{{name}}" documentation="">
<target Dendian="{{device.dendian}}" Dfpu="{{device.dfpu}}" Dname="{{device.dname}}" Dvendor="{{device.dvendor}}">
<output debug="1" name="{{name}}" type="exe"/>
<debugProbe name="{{device.debug_interface}}" protocol="jtag"/>
</target>
{{project_files}}
</project>
</create>
</package>

View File

@ -2,16 +2,13 @@
import os
import sys
import logging
from os.path import join, dirname, relpath
from os.path import join, dirname, relpath, basename, realpath
from itertools import groupby
from jinja2 import FileSystemLoader
from jinja2.environment import Environment
import copy
from tools.targets import TARGET_MAP
from project_generator.tools import tool
from project_generator.tools_supported import ToolsSupported
from project_generator.settings import ProjectSettings
from project_generator_definitions.definitions import ProGenDef
class OldLibrariesException(Exception):
@ -73,11 +70,20 @@ class Exporter(object):
self.resources = resources
self.generated_files = [join(self.TEMPLATE_DIR,"GettingStarted.html")]
self.builder_files_dict = {}
self.add_config()
def get_toolchain(self):
"""A helper getter function that we should probably eliminate"""
return self.TOOLCHAIN
def add_config(self):
"""Add the containgin directory of mbed_config.h to include dirs"""
config = self.toolchain.get_config_header()
if config:
self.resources.inc_dirs.append(
dirname(relpath(config,
self.resources.file_basepath[config])))
@property
def flags(self):
"""Returns a dictionary of toolchain flags.
@ -89,7 +95,7 @@ class Exporter(object):
common_flags - common options
"""
config_header = self.toolchain.get_config_header()
flags = {key + "_flags": value for key, value
flags = {key + "_flags": copy.deepcopy(value) for key, value
in self.toolchain.flags.iteritems()}
asm_defines = ["-D" + symbol for symbol in self.toolchain.get_symbols(True)]
c_defines = ["-D" + symbol for symbol in self.toolchain.get_symbols()]
@ -113,95 +119,11 @@ class Exporter(object):
source_files.extend(getattr(self.resources, key))
return list(set([os.path.dirname(src) for src in source_files]))
def progen_get_project_data(self):
""" Get ProGen project data """
# provide default data, some tools don't require any additional
# tool specific settings
if not self.check_supported(self.NAME):
raise TargetNotSupportedException("Target not supported")
def make_key(src):
"""turn a source file into it's group name"""
key = os.path.basename(os.path.dirname(src))
if not key or relpath(key, self.export_dir) == '.':
key = self.project_name
return key
def grouped(sources):
"""Group the source files by their encompassing directory"""
data = sorted(sources, key=make_key)
return {k: list(g) for k, g in groupby(data, make_key)}
if self.toolchain.get_config_header():
config_header = self.toolchain.get_config_header()
config_header = relpath(config_header,
self.resources.file_basepath[config_header])
else:
config_header = None
# we want to add this to our include dirs
config_dir = os.path.dirname(config_header) if config_header else []
project_data = tool.get_tool_template()
project_data['target'] = TARGET_MAP[self.target].progen['target']
project_data['source_paths'] = self.get_source_paths()
project_data['include_paths'] = self.resources.inc_dirs + [config_dir]
project_data['include_files'] = grouped(self.resources.headers)
project_data['source_files_s'] = grouped(self.resources.s_sources)
project_data['source_files_c'] = grouped(self.resources.c_sources)
project_data['source_files_cpp'] = grouped(self.resources.cpp_sources)
project_data['source_files_obj'] = grouped(self.resources.objects)
project_data['source_files_lib'] = grouped(self.resources.libraries)
project_data['output_dir']['path'] = self.export_dir
project_data['linker_file'] = self.resources.linker_script
project_data['macros'] = []
project_data['build_dir'] = 'build'
project_data['template'] = None
project_data['name'] = self.project_name
project_data['output_type'] = 'exe'
project_data['debugger'] = None
return project_data
def progen_gen_file(self, project_data):
""" Generate project using ProGen Project API
Positional arguments:
tool_name - the tool for which to generate project files
project_data - a dict whose base key, values are specified in
progen_get_project_data, the items will have been
modified by Exporter subclasses
Keyword arguments:
progen_build - A boolean that determines if the tool will build the
project
"""
if not self.check_supported(self.NAME):
raise TargetNotSupportedException("Target not supported")
settings = ProjectSettings()
exporter = ToolsSupported().get_tool(self.NAME)
self.builder_files_dict = {self.NAME:exporter(project_data, settings).export_project()}
for middle in self.builder_files_dict.values():
for field, thing in middle.iteritems():
if field == "files":
for filename in thing.values():
self.generated_files.append(filename)
def progen_build(self):
"""Build a project that was already generated by progen"""
builder = ToolsSupported().get_tool(self.NAME)
result = builder(self.builder_files_dict[self.NAME], ProjectSettings()).build_project()
if result == -1:
raise FailedBuildException("Build Failed")
def check_supported(self, ide):
def check_supported(self):
"""Indicated if this combination of IDE and MCU is supported"""
if self.target not in self.TARGETS or \
self.TOOLCHAIN not in TARGET_MAP[self.target].supported_toolchains:
return False
if not ProGenDef(ide).is_supported(
TARGET_MAP[self.target].progen['target']):
return False
raise TargetNotSupportedException()
return True
def gen_file(self, template_file, data, target_file):
@ -217,3 +139,23 @@ class Exporter(object):
logging.debug("Generating: %s", target_path)
open(target_path, "w").write(target_text)
self.generated_files += [target_path]
def make_key(self, src):
"""From a source file, extract group name
Positional Arguments:
src - the src's location
"""
key = basename(dirname(src))
if key == ".":
key = basename(realpath(self.export_dir))
return key
def group_project_files(self, sources):
"""Group the source files by their encompassing directory
Positional Arguments:
sources - array of sourc locations
Returns a dictionary of {group name: list of source locations}
"""
data = sorted(sources, key=self.make_key)
return {k: list(g) for k,g in groupby(data, self.make_key)}

View File

@ -1,154 +0,0 @@
"""
mbed SDK
Copyright (c) 2011-2016 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
import re
import os
from project_generator_definitions.definitions import ProGenDef
from tools.export.exporters import Exporter, ExporterTargetsProperty
from tools.targets import TARGET_MAP, TARGET_NAMES
# If you wish to add a new target, add it to project_generator_definitions, and then
# define progen_target name in the target class (`` self.progen_target = 'my_target_name' ``)
class IAREmbeddedWorkbench(Exporter):
"""
Exporter class for IAR Systems. This class uses project generator.
"""
# These 2 are currently for exporters backward compatiblity
NAME = 'iar_arm'
TOOLCHAIN = 'IAR'
# PROGEN_ACTIVE contains information for exporter scripts that this is using progen
PROGEN_ACTIVE = True
MBED_CONFIG_HEADER_SUPPORTED = True
@ExporterTargetsProperty
def TARGETS(cls):
if not hasattr(cls, "_targets_supported"):
cls._targets_supported = []
progendef = ProGenDef('iar')
for target in TARGET_NAMES:
try:
if (progendef.is_supported(str(TARGET_MAP[target])) or
progendef.is_supported(TARGET_MAP[target].progen['target'])):
cls._targets_supported.append(target)
except AttributeError:
# target is not supported yet
continue
return cls._targets_supported
def generate(self):
""" Generates the project files """
project_data = self.progen_get_project_data()
try:
if TARGET_MAP[self.target].progen['iar']['template']:
project_data['template']=TARGET_MAP[self.target].progen['iar']['template']
except KeyError:
# use default template
# by the mbed projects
project_data['template']=[os.path.join(os.path.dirname(__file__), 'iar_template.ewp.tmpl')]
project_data['misc'] = self.flags
# VLA is enabled via template IccAllowVLA
if "--vla" in project_data['misc']['c_flags']:
project_data['misc']['c_flags'].remove("--vla")
# Static destruction enabled via template
if "--no_static_destruction" in project_data['misc']['cxx_flags']:
project_data['misc']['cxx_flags'].remove("--no_static_destruction")
project_data['misc']['asm_flags'] = list(set(project_data['misc']['asm_flags']))
project_data['build_dir'] = os.path.join(project_data['build_dir'], 'iar_arm')
self.progen_gen_file(project_data)
# Currently not used, we should reuse folder_name to create virtual folders
class IarFolder():
"""
This is a recursive folder object.
To present the folder structure in the IDE as it is presented on the disk.
This can be used for uvision as well if you replace the __str__ method.
Example:
files: ./main.cpp, ./apis/I2C.h, ./mbed/common/I2C.cpp
in the project this would look like:
main.cpp
common/I2C.cpp
input:
folder_level : folder path to current folder
folder_name : name of current folder
source_files : list of source_files (all must be in same directory)
"""
def __init__(self, folder_level, folder_name, source_files):
self.folder_level = folder_level
self.folder_name = folder_name
self.source_files = source_files
self.sub_folders = {}
def __str__(self):
"""
converts the folder structue to IAR project format.
"""
group_start = ""
group_end = ""
if self.folder_name != "":
group_start = "<group>\n<name>%s</name>\n" %(self.folder_name)
group_end = "</group>\n"
str_content = group_start
#Add files in current folder
if self.source_files:
for src in self.source_files:
str_content += "<file>\n<name>$PROJ_DIR$/%s</name>\n</file>\n" % src
#Add sub folders
if self.sub_folders:
for folder_name in self.sub_folders.iterkeys():
str_content += self.sub_folders[folder_name].__str__()
str_content += group_end
return str_content
def insert_file(self, source_input):
"""
Inserts a source file into the folder tree
"""
if self.source_files:
#All source_files in a IarFolder must be in same directory.
dir_sources = IarFolder.get_directory(self.source_files[0])
#Check if sources are already at their deepest level.
if not self.folder_level == dir_sources:
_reg_exp = r"^" + re.escape(self.folder_level) + r"[/\\]?([^/\\]+)"
folder_name = re.match(_reg_exp, dir_sources).group(1)
self.sub_folders[folder_name] = IarFolder(os.path.join(self.folder_level, folder_name), folder_name, self.source_files)
self.source_files = []
dir_input = IarFolder.get_directory(source_input)
if dir_input == self.folder_level:
self.source_files.append(source_input)
else:
_reg_exp = r"^" + re.escape(self.folder_level) + r"[/\\]?([^/\\]+)"
folder_name = re.match(_reg_exp, dir_input).group(1)
if self.sub_folders.has_key(folder_name):
self.sub_folders[folder_name].insert_file(source_input)
else:
if self.folder_level == "":
#Top level exception
self.sub_folders[folder_name] = IarFolder(folder_name, folder_name, [source_input])
else:
self.sub_folders[folder_name] = IarFolder(os.path.join(self.folder_level, folder_name), folder_name, [source_input])
@staticmethod
def get_directory(file_path):
"""
Returns the directory of the file
"""
return os.path.dirname(file_path)

View File

@ -0,0 +1,150 @@
import os
from os.path import sep, join, exists
from collections import namedtuple
from subprocess import Popen, PIPE
from distutils.spawn import find_executable
import re
import sys
from tools.targets import TARGET_MAP
from tools.export.exporters import Exporter, FailedBuildException
import json
from tools.export.cmsis import DeviceCMSIS
class IAR(Exporter):
NAME = 'iar'
TOOLCHAIN = 'IAR'
#iar_definitions.json location
def_loc = os.path.join(
os.path.dirname(os.path.abspath(__file__)), '..', '..', '..',
'tools','export', 'iar', 'iar_definitions.json')
#create a dictionary of the definitions
with open(def_loc, 'r') as f:
IAR_DEFS = json.load(f)
#supported targets have a device name and corresponding definition in
#iar_definitions.json
TARGETS = [target for target, obj in TARGET_MAP.iteritems()
if hasattr(obj, 'device_name') and
obj.device_name in IAR_DEFS.keys()]
SPECIAL_TEMPLATES = {
'rz_a1h' : 'iar/iar_rz_a1h.ewp.tmpl',
'nucleo_f746zg' : 'iar/iar_nucleo_f746zg.ewp.tmpl'
}
def iar_groups(self, grouped_src):
"""Return a namedtuple of group info
Positional Arguments:
grouped_src: dictionary mapping a group(str) to sources
within it (list of file names)
Relevant part of IAR template
{% for group in groups %}
<group>
<name>group.name</name>
{% for file in group.files %}
<file>
<name>$PROJ_DIR${{file}}</name>
</file>
{% endfor %}
</group>
{% endfor %}
"""
IARgroup = namedtuple('IARgroup', ['name','files'])
groups = []
for name, files in grouped_src.items():
groups.append(IARgroup(name,files))
return groups
def iar_device(self):
"""Retrieve info from iar_definitions.json"""
device_name = TARGET_MAP[self.target].device_name
device_info = self.IAR_DEFS[device_name]
iar_defaults ={
"OGChipSelectEditMenu": "",
"CoreVariant": '',
"GFPUCoreSlave": '',
"GFPUCoreSlave2": 40,
"GBECoreSlave": 35
}
iar_defaults.update(device_info)
IARdevice = namedtuple('IARdevice', iar_defaults.keys())
return IARdevice(**iar_defaults)
def format_file(self, file):
"""Make IAR compatible path"""
return join('$PROJ_DIR$',file)
def format_src(self, srcs):
"""Group source files"""
grouped = self.group_project_files(srcs)
for group, files in grouped.items():
grouped[group] = [self.format_file(src) for src in files]
return grouped
def get_ewp_template(self):
return self.SPECIAL_TEMPLATES.get(self.target.lower(), 'iar/ewp.tmpl')
def generate(self):
"""Generate the .eww, .ewd, and .ewp files"""
srcs = self.resources.headers + self.resources.s_sources + \
self.resources.c_sources + self.resources.cpp_sources + \
self.resources.objects + self.resources.libraries
flags = self.flags
flags['c_flags'] = list(set(flags['common_flags']
+ flags['c_flags']
+ flags['cxx_flags']))
if '--vla' in flags['c_flags']:
flags['c_flags'].remove('--vla')
if '--no_static_destruction' in flags['c_flags']:
flags['c_flags'].remove('--no_static_destruction')
#Optimizations
if '-Oh' in flags['c_flags']:
flags['c_flags'].remove('-Oh')
ctx = {
'name': self.project_name,
'groups': self.iar_groups(self.format_src(srcs)),
'linker_script': self.format_file(self.resources.linker_script),
'include_paths': [self.format_file(src) for src in self.resources.inc_dirs],
'device': self.iar_device(),
'ewp': sep+self.project_name + ".ewp",
'debugger': DeviceCMSIS(self.target).debug.replace('-','').upper()
}
ctx.update(flags)
self.gen_file('iar/eww.tmpl', ctx, self.project_name+".eww")
self.gen_file('iar/ewd.tmpl', ctx, self.project_name + ".ewd")
self.gen_file(self.get_ewp_template(), ctx, self.project_name + ".ewp")
def build(self):
""" Build IAR project """
# > IarBuild [project_path] -build [project_name]
proj_file = join(self.export_dir, self.project_name + ".ewp")
if find_executable("IarBuild"):
iar_exe = "IarBuild.exe"
else:
iar_exe = join('C:', sep,
'Program Files (x86)', 'IAR Systems',
'Embedded Workbench 7.5', 'common', 'bin',
'IarBuild.exe')
if not exists(iar_exe):
raise Exception("IarBuild.exe not found. Add to path.")
cmd = [iar_exe, proj_file, '-build', self.project_name]
p = Popen(cmd, stdout=PIPE, stderr=PIPE)
num_errors = 0
#Parse the output for printing and errors
for line in p.stdout.readlines():
sys.stdout.write(line)
error_re = '\s*Total number of errors:\s*(\d+)\s*'
m = re.match(error_re, line)
if m is not None:
num_errors = int(m.group(1))
if num_errors !=0:
# Seems like something went wrong.
raise FailedBuildException("Project: %s build failed with %s erros" % (
proj_file, num_errors))

1492
tools/export/iar/ewd.tmpl Normal file

File diff suppressed because it is too large Load Diff

970
tools/export/iar/ewp.tmpl Normal file
View File

@ -0,0 +1,970 @@
<?xml version="1.0" encoding="utf-8"?>
<project>
<fileVersion>2</fileVersion>
<configuration>
<name>{{name}}</name>
<toolchain>
<name>ARM</name>
</toolchain>
<debug>1</debug>
<settings>
<name>General</name>
<archiveVersion>3</archiveVersion>
<data>
<version>22</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>GRuntimeLibThreads</name>
<state>0</state>
</option>
<option>
<name>ExePath</name>
<state>$PROJ_DIR$\.build\Exe</state>
</option>
<option>
<name>ObjPath</name>
<state>$PROJ_DIR$\.build\Obj</state>
</option>
<option>
<name>ListPath</name>
<state>$PROJ_DIR$\.build\List</state>
</option>
<option>
<name>Variant</name>
<version>20</version>
<state>{{device.CoreVariant}}</state>
</option>
<option>
<name>GEndianMode</name>
<state>0</state>
</option>
<option>
<name>Input variant</name>
<version>3</version>
<state>1</state>
</option>
<option>
<name>Input description</name>
<state>Full formatting.</state>
</option>
<option>
<name>Output variant</name>
<version>2</version>
<state>3</state>
</option>
<option>
<name>Output description</name>
<state>No specifier a, A.</state>
</option>
<option>
<name>GOutputBinary</name>
<state>0</state>
</option>
<option>
<name>FPU</name>
<version>2</version>
<state>5</state>
</option>
<option>
<name>OGCoreOrChip</name>
<state>1</state>
</option>
<option>
<name>GRuntimeLibSelect</name>
<version>0</version>
<state>2</state>
</option>
<option>
<name>GRuntimeLibSelectSlave</name>
<version>0</version>
<state>2</state>
</option>
<option>
<name>RTDescription</name>
<state>Use the full configuration of the C/C++ runtime library. Full locale interface, C locale, file descriptor support, multibytes in printf and scanf, and hex floats in strtod.</state>
</option>
<option>
<name>OGProductVersion</name>
<state>5.10.0.159</state>
</option>
<option>
<name>OGLastSavedByProductVersion</name>
<state>7.10.3.6927</state>
</option>
<option>
<name>GeneralEnableMisra</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraVerbose</name>
<state>0</state>
</option>
<option>
<name>OGChipSelectEditMenu</name>
<state>{{device.OGChipSelectEditMenu}}</state>
</option>
<option>
<name>GenLowLevelInterface</name>
<state>0</state>
</option>
<option>
<name>GEndianModeBE</name>
<state>1</state>
</option>
<option>
<name>OGBufferedTerminalOutput</name>
<state>0</state>
</option>
<option>
<name>GenStdoutInterface</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraRules98</name>
<state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
<version>0</version>
</option>
<option>
<name>GeneralMisraVer</name>
<state>0</state>
</option>
<option>
<state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
<version>0</version>
<name>GeneralMisraRules04</name>
</option>
<option>
<name>RTConfigPath2</name>
<state>$TOOLKIT_DIR$\INC\c\DLib_Config_Full.h</state>
</option>
<option>
<name>GFPUCoreSlave</name>
<version>20</version>
<state>{{device.GFPUCoreSlave}}</state>
</option>
<option>
<name>GBECoreSlave</name>
<version>20</version>
<state>{{device.GBECoreSlave}}</state>
</option>
<option>
<name>OGUseCmsis</name>
<state>0</state>
</option>
<option>
<name>OGUseCmsisDspLib</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
<name>ICCARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>31</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>CCOptimizationNoSizeConstraints</name>
<state>0</state>
</option>
<option>
<name>CCDefines</name>
<state>TARGET_K64F</state>
<state>TARGET_M4</state>
<state>TARGET_Freescale</state>
<state>__CORTEX_M4</state>
<state>ARM_MATH_CM4</state>
<state>__MBED__=1</state>
<state>CPU_MK64FN1M0VMD12</state>
<state>FSL_RTOS_MBED</state>
</option>
<option>
<name>CCPreprocFile</name>
<state>0</state>
</option>
<option>
<name>CCPreprocComments</name>
<state>0</state>
</option>
<option>
<name>CCPreprocLine</name>
<state>0</state>
</option>
<option>
<name>CCListCFile</name>
<state>0</state>
</option>
<option>
<name>CCListCMnemonics</name>
<state>0</state>
</option>
<option>
<name>CCListCMessages</name>
<state>0</state>
</option>
<option>
<name>CCListAssFile</name>
<state>0</state>
</option>
<option>
<name>CCListAssSource</name>
<state>0</state>
</option>
<option>
<name>CCEnableRemarks</name>
<state>0</state>
</option>
<option>
<name>CCDiagSuppress</name>
<state>Pa050,Pa084,Pa093,Pa082</state>
</option>
<option>
<name>CCDiagRemark</name>
<state></state>
</option>
<option>
<name>CCDiagWarning</name>
<state></state>
</option>
<option>
<name>CCDiagError</name>
<state></state>
</option>
<option>
<name>CCObjPrefix</name>
<state>1</state>
</option>
<option>
<name>CCAllowList</name>
<version>1</version>
<state>1111110</state>
</option>
<option>
<name>CCDebugInfo</name>
<state>1</state>
</option>
<option>
<name>IEndianMode</name>
<state>1</state>
</option>
<option>
<name>IProcessor</name>
<state>1</state>
</option>
<option>
<name>IExtraOptionsCheck</name>
<state>1</state>
</option>
<option>
<name>IExtraOptions</name>
{% for flag in c_flags %}
<state>{{flag}}</state>
{% endfor %}
</option>
<option>
<name>CCLangConformance</name>
<state>0</state>
</option>
<option>
<name>CCSignedPlainChar</name>
<state>1</state>
</option>
<option>
<name>CCRequirePrototypes</name>
<state>0</state>
</option>
<option>
<name>CCMultibyteSupport</name>
<state>0</state>
</option>
<option>
<name>CCDiagWarnAreErr</name>
<state>0</state>
</option>
<option>
<name>CCCompilerRuntimeInfo</name>
<state>0</state>
</option>
<option>
<name>IFpuProcessor</name>
<state>0</state>
</option>
<option>
<name>OutputFile</name>
<state>$FILE_BNAME$.o</state>
</option>
<option>
<name>CCLibConfigHeader</name>
<state>1</state>
</option>
<option>
<name>PreInclude</name>
<state></state>
</option>
<option>
<name>CompilerMisraOverride</name>
<state>0</state>
</option>
<option>
<name>CCIncludePath2</name>
{% for file in include_paths %}
<state>{{file}}</state>
{% endfor %}
</option>
<option>
<name>CCStdIncCheck</name>
<state>0</state>
</option>
<option>
<name>CCCodeSection</name>
<state>.text</state>
</option>
<option>
<name>IInterwork2</name>
<state>0</state>
</option>
<option>
<name>IProcessorMode2</name>
<state>1</state>
</option>
<option>
<name>CCOptLevel</name>
<state>3</state>
</option>
<option>
<name>CCOptStrategy</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>CCOptLevelSlave</name>
<state>3</state>
</option>
<option>
<name>CompilerMisraRules98</name>
<version>0</version>
<state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
</option>
<option>
<name>CompilerMisraRules04</name>
<version>0</version>
<state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
</option>
<option>
<name>CCPosIndRopi</name>
<state>0</state>
</option>
<option>
<name>CCPosIndRwpi</name>
<state>0</state>
</option>
<option>
<name>CCPosIndNoDynInit</name>
<state>0</state>
</option>
<option>
<name>IccLang</name>
<state>2</state>
</option>
<option>
<name>IccCDialect</name>
<state>1</state>
</option>
<option>
<name>IccAllowVLA</name>
<state>1</state>
</option>
<option>
<name>IccCppDialect</name>
<state>2</state>
</option>
<option>
<name>IccExceptions</name>
<state>0</state>
</option>
<option>
<name>IccRTTI</name>
<state>0</state>
</option>
<option>
<name>IccStaticDestr</name>
<state>1</state>
</option>
<option>
<name>IccCppInlineSemantics</name>
<state>0</state>
</option>
<option>
<name>IccCmsis</name>
<state>1</state>
</option>
<option>
<name>IccFloatSemantics</name>
<state>0</state>
</option>
<option>
<name>CCNoLiteralPool</name>
<state>0</state>
</option>
<option>
<name>CCOptStrategySlave</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>CCGuardCalls</name>
<state>1</state>
</option>
</data>
</settings>
<settings>
<name>AARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>9</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>AObjPrefix</name>
<state>1</state>
</option>
<option>
<name>AEndian</name>
<state>1</state>
</option>
<option>
<name>ACaseSensitivity</name>
<state>1</state>
</option>
<option>
<name>MacroChars</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>AWarnEnable</name>
<state>0</state>
</option>
<option>
<name>AWarnWhat</name>
<state>0</state>
</option>
<option>
<name>AWarnOne</name>
<state>0</state>
</option>
<option>
<name>AWarnRange1</name>
<state>0</state>
</option>
<option>
<name>AWarnRange2</name>
<state>0</state>
</option>
<option>
<name>ADebug</name>
<state>1</state>
</option>
<option>
<name>AltRegisterNames</name>
<state>0</state>
</option>
<option>
<name>ADefines</name>
<state></state>
</option>
<option>
<name>AList</name>
<state>0</state>
</option>
<option>
<name>AListHeader</name>
<state>1</state>
</option>
<option>
<name>AListing</name>
<state>1</state>
</option>
<option>
<name>Includes</name>
<state>0</state>
</option>
<option>
<name>MacDefs</name>
<state>0</state>
</option>
<option>
<name>MacExps</name>
<state>1</state>
</option>
<option>
<name>MacExec</name>
<state>0</state>
</option>
<option>
<name>OnlyAssed</name>
<state>0</state>
</option>
<option>
<name>MultiLine</name>
<state>0</state>
</option>
<option>
<name>PageLengthCheck</name>
<state>0</state>
</option>
<option>
<name>PageLength</name>
<state>80</state>
</option>
<option>
<name>TabSpacing</name>
<state>8</state>
</option>
<option>
<name>AXRef</name>
<state>0</state>
</option>
<option>
<name>AXRefDefines</name>
<state>0</state>
</option>
<option>
<name>AXRefInternal</name>
<state>0</state>
</option>
<option>
<name>AXRefDual</name>
<state>0</state>
</option>
<option>
<name>AProcessor</name>
<state>1</state>
</option>
<option>
<name>AFpuProcessor</name>
<state>0</state>
</option>
<option>
<name>AOutputFile</name>
<state>$FILE_BNAME$.o</state>
</option>
<option>
<name>AMultibyteSupport</name>
<state>0</state>
</option>
<option>
<name>ALimitErrorsCheck</name>
<state>0</state>
</option>
<option>
<name>ALimitErrorsEdit</name>
<state>100</state>
</option>
<option>
<name>AIgnoreStdInclude</name>
<state>0</state>
</option>
<option>
<name>AUserIncludes</name>
<state></state>
</option>
<option>
<name>AExtraOptionsCheckV2</name>
<state>1</state>
</option>
<option>
<name>AExtraOptionsV2</name>
{% for flag in asm_flags %}
<state>{{flag}}</state>
{% endfor %}
</option>
<option>
<name>AsmNoLiteralPool</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
<name>OBJCOPY</name>
<archiveVersion>0</archiveVersion>
<data>
<version>1</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>OOCOutputFormat</name>
<version>2</version>
<state>0</state>
</option>
<option>
<name>OCOutputOverride</name>
<state>0</state>
</option>
<option>
<name>OOCOutputFile</name>
<state>name.srec</state>
</option>
<option>
<name>OOCCommandLineProducer</name>
<state>0</state>
</option>
<option>
<name>OOCObjCopyEnable</name>
<state>1</state>
</option>
</data>
</settings>
<settings>
<name>CUSTOM</name>
<archiveVersion>3</archiveVersion>
<data>
<extensions></extensions>
<cmdline></cmdline>
</data>
</settings>
<settings>
<name>BICOMP</name>
<archiveVersion>0</archiveVersion>
<data></data>
</settings>
<settings>
<name>BUILDACTION</name>
<archiveVersion>1</archiveVersion>
<data>
<prebuild></prebuild>
<postbuild></postbuild>
</data>
</settings>
<settings>
<name>ILINK</name>
<archiveVersion>0</archiveVersion>
<data>
<version>16</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>IlinkOutputFile</name>
<state>name.out</state>
</option>
<option>
<name>IlinkLibIOConfig</name>
<state>1</state>
</option>
<option>
<name>XLinkMisraHandler</name>
<state>0</state>
</option>
<option>
<name>IlinkInputFileSlave</name>
<state>0</state>
</option>
<option>
<name>IlinkDebugInfoEnable</name>
<state>1</state>
</option>
<option>
<name>IlinkKeepSymbols</name>
<state></state>
</option>
<option>
<name>IlinkRawBinaryFile</name>
<state></state>
</option>
<option>
<name>IlinkRawBinarySymbol</name>
<state></state>
</option>
<option>
<name>IlinkRawBinarySegment</name>
<state></state>
</option>
<option>
<name>IlinkRawBinaryAlign</name>
<state></state>
</option>
<option>
<name>IlinkDefines</name>
<state></state>
</option>
<option>
<name>IlinkConfigDefines</name>
<state></state>
</option>
<option>
<name>IlinkMapFile</name>
<state>0</state>
</option>
<option>
<name>IlinkLogFile</name>
<state>0</state>
</option>
<option>
<name>IlinkLogInitialization</name>
<state>0</state>
</option>
<option>
<name>IlinkLogModule</name>
<state>0</state>
</option>
<option>
<name>IlinkLogSection</name>
<state>0</state>
</option>
<option>
<name>IlinkLogVeneer</name>
<state>0</state>
</option>
<option>
<name>IlinkIcfOverride</name>
<state>1</state>
</option>
<option>
<name>IlinkIcfFile</name>
<state>{{linker_script}}</state>
</option>
<option>
<name>IlinkIcfFileSlave</name>
<state></state>
</option>
<option>
<name>IlinkEnableRemarks</name>
<state>0</state>
</option>
<option>
<name>IlinkSuppressDiags</name>
<state></state>
</option>
<option>
<name>IlinkTreatAsRem</name>
<state></state>
</option>
<option>
<name>IlinkTreatAsWarn</name>
<state></state>
</option>
<option>
<name>IlinkTreatAsErr</name>
<state></state>
</option>
<option>
<name>IlinkWarningsAreErrors</name>
<state>0</state>
</option>
<option>
<name>IlinkUseExtraOptions</name>
<state>1</state>
</option>
<option>
<name>IlinkExtraOptions</name>
{% for flag in ld_flags %}
<state>{{flag}}</state>
{% endfor %}
</option>
<option>
<name>IlinkLowLevelInterfaceSlave</name>
<state>1</state>
</option>
<option>
<name>IlinkAutoLibEnable</name>
<state>1</state>
</option>
<option>
<name>IlinkAdditionalLibs</name>
<state></state>
</option>
<option>
<name>IlinkOverrideProgramEntryLabel</name>
<state>0</state>
</option>
<option>
<name>IlinkProgramEntryLabelSelect</name>
<state>0</state>
</option>
<option>
<name>IlinkProgramEntryLabel</name>
<state>__iar_program_start</state>
</option>
<option>
<name>DoFill</name>
<state>0</state>
</option>
<option>
<name>FillerByte</name>
<state>0xFF</state>
</option>
<option>
<name>FillerStart</name>
<state>0x0</state>
</option>
<option>
<name>FillerEnd</name>
<state>0x0</state>
</option>
<option>
<name>CrcSize</name>
<version>0</version>
<state>1</state>
</option>
<option>
<name>CrcAlign</name>
<state>1</state>
</option>
<option>
<name>CrcPoly</name>
<state>0x11021</state>
</option>
<option>
<name>CrcCompl</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>CrcBitOrder</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>CrcInitialValue</name>
<state>0x0</state>
</option>
<option>
<name>DoCrc</name>
<state>0</state>
</option>
<option>
<name>IlinkBE8Slave</name>
<state>1</state>
</option>
<option>
<name>IlinkBufferedTerminalOutput</name>
<state>1</state>
</option>
<option>
<name>IlinkStdoutInterfaceSlave</name>
<state>1</state>
</option>
<option>
<name>CrcFullSize</name>
<state>0</state>
</option>
<option>
<name>IlinkIElfToolPostProcess</name>
<state>0</state>
</option>
<option>
<name>IlinkLogAutoLibSelect</name>
<state>0</state>
</option>
<option>
<name>IlinkLogRedirSymbols</name>
<state>0</state>
</option>
<option>
<name>IlinkLogUnusedFragments</name>
<state>0</state>
</option>
<option>
<name>IlinkCrcReverseByteOrder</name>
<state>0</state>
</option>
<option>
<name>IlinkCrcUseAsInput</name>
<state>1</state>
</option>
<option>
<name>IlinkOptInline</name>
<state>0</state>
</option>
<option>
<name>IlinkOptExceptionsAllow</name>
<state>0</state>
</option>
<option>
<name>IlinkOptExceptionsForce</name>
<state>0</state>
</option>
<option>
<name>IlinkCmsis</name>
<state>1</state>
</option>
<option>
<name>IlinkOptMergeDuplSections</name>
<state>0</state>
</option>
<option>
<name>IlinkOptUseVfe</name>
<state>1</state>
</option>
<option>
<name>IlinkOptForceVfe</name>
<state>0</state>
</option>
<option>
<name>IlinkStackAnalysisEnable</name>
<state>0</state>
</option>
<option>
<name>IlinkStackControlFile</name>
<state></state>
</option>
<option>
<name>IlinkStackCallGraphFile</name>
<state></state>
</option>
<option>
<name>CrcAlgorithm</name>
<version>0</version>
<state>1</state>
</option>
<option>
<name>CrcUnitSize</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>IlinkThreadsSlave</name>
<state>1</state>
</option>
</data>
</settings>
<settings>
<name>IARCHIVE</name>
<archiveVersion>0</archiveVersion>
<data>
<version>0</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>IarchiveInputs</name>
<state></state>
</option>
<option>
<name>IarchiveOverride</name>
<state>0</state>
</option>
<option>
<name>IarchiveOutput</name>
<state>###Unitialized###</state>
</option>
</data>
</settings>
<settings>
<name>BILINK</name>
<archiveVersion>0</archiveVersion>
<data></data>
</settings>
</configuration>
{% for group in groups %}
<group>
<name>{{group.name}}</name>
{% for file in group.files %}
<file>
<name>{{file}}</name>
</file>
{% endfor %}
</group>
{% endfor %}
</project>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<workspace>
<project>
<path>$WS_DIR${{ewp}}</path>
</project>
<batchBuild></batchBuild>
</workspace>

View File

@ -0,0 +1,150 @@
{
"stm32l476vg": {
"OGChipSelectEditMenu": "STM32L476VG\tST STM32L476VG"
},
"LPC11U24FBD48/401": {
"OGChipSelectEditMenu": "LPC11U24FBD64_401\tNXP LPC11U24FBD64_401"
},
"STM32F334R8": {
"OGChipSelectEditMenu": "STM32F334x8\tST STM32F334x8"
},
"STM32F302R8": {
"OGChipSelectEditMenu": "STM32F302x8\tST STM32F302x8"
},
"EFM32LG990F256": {
"OGChipSelectEditMenu": "EFM32LG990F256\tSiliconLaboratories EFM32LG990F256"
},
"STM32F042K6": {
"OGChipSelectEditMenu": "STM32F042x6\tST STM32F042x6"
},
"stm32l476rg": {
"OGChipSelectEditMenu": "STM32L476RG\tST STM32L476RG"
},
"STM32L011K4": {
"OGChipSelectEditMenu": "STM32L011x4\tST STM32L011x4"
},
"EFM32WG990F256": {
"OGChipSelectEditMenu": "EFM32WG990F256\tSiliconLaboratories EFM32WG990F256"
},
"STM32F401RE": {
"OGChipSelectEditMenu": "STM32F401xE\tST STM32F401xE"
},
"STM32F070RB": {
"OGChipSelectEditMenu": "STM32F070RB\tST STM32F070RB"
},
"MK64FN1M0xxx12": {
"OGChipSelectEditMenu": "MK64FN1M0xxx12\tFreescale MK64FN1M0xxx12"
},
"STM32F072RB": {
"OGChipSelectEditMenu": "STM32F072RB\tST STM32F072RB"
},
"nRF51822_xxAA": {
"OGChipSelectEditMenu": "nRF51822-QFAA\tNordicSemi nRF51822-QFAA"
},
"EFM32GG990F1024": {
"OGChipSelectEditMenu": "EFM32GG990F1024\tSiliconLaboratories EFM32GG990F1024"
},
"MKL46Z256xxx4": {
"OGChipSelectEditMenu": "MKL46Z256xxx4\tFreescale MKL46Z256xxx4"
},
"STM32F030R8": {
"OGChipSelectEditMenu": "STM32F030x8\tST STM32F030x8"
},
"EFM32ZG222F32": {
"OGChipSelectEditMenu": "EFM32ZG220F32\tSiliconLaboratories EFM32ZG220F32"
},
"STM32F303RE": {
"OGChipSelectEditMenu": "STM32F303xE\tST STM32F303xE"
},
"STM32L152RE": {
"OGChipSelectEditMenu": "STM32L152xE\tST STM32L152xE"
},
"STM32F439ZI": {
"OGChipSelectEditMenu": "STM32F439ZI\tST STM32F439ZI"
},
"LPC1768": {
"OGChipSelectEditMenu": "LPC1768\tNXP LPC1768"
},
"STM32F446RE": {
"OGChipSelectEditMenu": "STM32F446RE\tST STM32F446RE"
},
"STM32L073RZ": {
"OGChipSelectEditMenu": "STM32L073RZ\tST STM32L073RZ"
},
"stm32ff746zg": {
"OGChipSelectEditMenu": "STM32F746ZG\tST STM32F746ZG",
"CoreVariant": 41,
"GFPUCoreSlave2": 41,
"GBECoreSlave": 41
},
"MKL43Z256xxx4": {
"OGChipSelectEditMenu": "MKL43Z256xxx4\tFreescale MKL43Z256xxx4"
},
"LPC812M101JDH20": {
"OGChipSelectEditMenu": "LPC812M101\tNXP LPC812M101"
},
"stm32f746ng": {
"OGChipSelectEditMenu": "STM32F746NG\tST STM32F746NG"
},
"STM32F411RE": {
"OGChipSelectEditMenu": "STM32F411RE\tST STM32F411RE"
},
"STM32L053C8": {
"OGChipSelectEditMenu": "STM32L053x8\tST STM32L053x8"
},
"STM32L031K6": {
"OGChipSelectEditMenu": "STM32L031x6\tST STM32L031x6"
},
"EFM32HG322F64": {
"OGChipSelectEditMenu": "EFM32HG322F64\tSiliconLaboratories EFM32HG322F64"
},
"MK20DX256xxx7": {
"OGChipSelectEditMenu": "MK20DX256xxx7\tFreescale MK20DX256xxx7"
},
"STM32F446ZE": {
"OGChipSelectEditMenu": "STM32F446ZE\tST STM32F446ZE"
},
"MK22DN512xxx5": {
"OGChipSelectEditMenu": "MK22FN512xxx12\tFreescale MK22FN512xxx12"
},
"STM32F303K8": {
"OGChipSelectEditMenu": "STM32F303x8\tST STM32F303x8"
},
"STM32F405RG": {
"OGChipSelectEditMenu": "STM32F405RG\tST STM32F405RG"
},
"MK20DX128xxx5": {
"OGChipSelectEditMenu": "MK20DX128xxx5\tFreescale MK20DX128xxx5"
},
"MKL25Z128xxx4": {
"OGChipSelectEditMenu": "MKL25Z128xxx4\tFreescale MKL25Z128xxx4"
},
"STM32F429ZI": {
"OGChipSelectEditMenu": "STM32F429ZI\tST STM32F429ZI"
},
"STM32F103RB": {
"OGChipSelectEditMenu": "STM32F103xB\tST STM32F103xB"
},
"STM32F091RC": {
"OGChipSelectEditMenu": "STM32F091RC\tST STM32F091RC"
},
"r7s721001": {
"OGChipSelectEditMenu": "R7S721001\tRenesas R7S721001",
"CoreVariant": 37,
"GFPUCoreSlave": 37,
"GBECoreSlave": 37,
"NEON":1
},
"MKL05Z32xxx4": {
"OGChipSelectEditMenu": "MKL05Z32xxx4\tFreescale MKL05Z32xxx4"
},
"STM32F031K6": {
"OGChipSelectEditMenu": "STM32F031x6\tST STM32F031x6"
},
"max326000x85": {
"OGChipSelectEditMenu": "MAX32600x85\tMaxim MAX32600x85"
},
"STM32F407VG": {
"OGChipSelectEditMenu": "STM32F407VG\tST STM32F407VG"
}
}

View File

@ -3,7 +3,7 @@
<project>
<fileVersion>2</fileVersion>
<configuration>
<name>Debug</name>
<name>{{name}}</name>
<toolchain>
<name>ARM</name>
</toolchain>
@ -16,16 +16,21 @@
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<state>$PROJ_DIR$\.build\iar_arm\Exe</state>
<name>ExePath</name>
<state>Debug\Exe</state>
</option>
<option>
<state>$PROJ_DIR$\.build\iar_arm\Obj</state>
<name>ObjPath</name>
<state>Debug\Obj</state>
</option>
<option>
<state>$PROJ_DIR$\.build\iar_arm\List</state>
<name>ListPath</name>
<state>Debug\List</state>
</option>
<option>
<name>Variant</name>
<version>19</version>
<state>37</state>
</option>
<option>
<name>GEndianMode</name>
@ -266,7 +271,9 @@
</option>
<option>
<name>IExtraOptions</name>
<state></state>
{% for flag in c_flags %}
<state>{{flag}}</state>
{% endfor %}
</option>
<option>
<name>CCLangConformance</name>
@ -314,7 +321,9 @@
</option>
<option>
<name>CCIncludePath2</name>
<state></state>
{% for file in include_paths %}
<state>{{file}}</state>
{% endfor %}
</option>
<option>
<name>CCStdIncCheck</name>
@ -580,11 +589,9 @@
</option>
<option>
<name>AExtraOptionsV2</name>
<state></state>
</option>
<option>
<name>AsmNoLiteralPool</name>
<state>0</state>
{% for flag in asm_flags %}
<state>{{flag}}</state>
{% endfor %}
</option>
</data>
</settings>
@ -725,7 +732,7 @@
</option>
<option>
<name>IlinkIcfFile</name>
<state></state>
<state>{{linker_script}}</state>
</option>
<option>
<name>IlinkIcfFileSlave</name>
@ -761,7 +768,9 @@
</option>
<option>
<name>IlinkExtraOptions</name>
<state>--skip_dynamic_initialization</state>
{% for flag in ld_flags %}
<state>{{flag}}</state>
{% endfor %}
</option>
<option>
<name>IlinkLowLevelInterfaceSlave</name>
@ -1912,6 +1921,16 @@
<data/>
</settings>
</configuration>
{% for group in groups %}
<group>
<name>{{group.name}}</name>
{% for file in group.files %}
<file>
<name>{{file}}</name>
</file>
{% endfor %}
</group>
{% endfor %}
<fileVersion>2</fileVersion>
</project>

View File

@ -3,7 +3,7 @@
<project>
<fileVersion>2</fileVersion>
<configuration>
<name>Debug</name>
<name>{{name}}</name>
<toolchain>
<name>ARM</name>
</toolchain>
@ -16,16 +16,16 @@
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<state>$PROJ_DIR$\.build\iar_arm\Exe</state>
<name>ExePath</name>
<state>Debug\Exe</state>
</option>
<option>
<state>$PROJ_DIR$\.build\iar_arm\Obj</state>
<name>ObjPath</name>
<state>Debug\Obj</state>
</option>
<option>
<state>$PROJ_DIR$\.build\iar_arm\List</state>
<name>ListPath</name>
<state>Debug\List</state>
</option>
<option>
<name>Variant</name>
@ -242,11 +242,13 @@
</option>
<option>
<name>IExtraOptionsCheck</name>
<state>0</state>
<state>1</state>
</option>
<option>
<name>IExtraOptions</name>
<state></state>
{% for flag in c_flags %}
<state>{{flag}}</state>
{% endfor %}
</option>
<option>
<name>CCLangConformance</name>
@ -294,9 +296,9 @@
</option>
<option>
<name>CCIncludePath2</name>
<state></state>
{% for file in include_paths %}
<state>{{file}}</state>
{% endfor %}
</option>
<option>
<name>CCStdIncCheck</name>
@ -549,7 +551,9 @@
</option>
<option>
<name>AExtraOptionsV2</name>
<state></state>
{% for flag in asm_flags %}
<state>{{flag}}</state>
{% endfor %}
</option>
</data>
</settings>
@ -689,7 +693,7 @@
</option>
<option>
<name>IlinkIcfFile</name>
<state>$PROJ_DIR$\mbed\TARGET_RZ_A1H\TOOLCHAIN_IAR\MBRZA1H.icf</state>
<state>{{linker_script}}</state>
</option>
<option>
<name>IlinkIcfFileSlave</name>
@ -725,7 +729,9 @@
</option>
<option>
<name>IlinkExtraOptions</name>
<state>--skip_dynamic_initialization</state>
{% for flag in ld_flags %}
<state>{{flag}}</state>
{% endfor %}
</option>
<option>
<name>IlinkLowLevelInterfaceSlave</name>
@ -911,15 +917,16 @@
<data/>
</settings>
</configuration>
<file>
<name>$PROJ_DIR$/main.cpp</name>
</file>
<group>
<name>env</name>
<file>
<name>$PROJ_DIR$/env\test_env.cpp</name>
</file>
</group>
{% for group in groups %}
<group>
<name>{{group.name}}</name>
{% for file in group.files %}
<file>
<name>{{file}}</name>
</file>
{% endfor %}
</group>
{% endfor %}
<fileVersion>2</fileVersion>
</project>

View File

@ -1,995 +0,0 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<project>
<fileVersion>2</fileVersion>
<configuration>
<name>Debug</name>
<toolchain>
<name>ARM</name>
</toolchain>
<debug>1</debug>
<settings>
<name>General</name>
<archiveVersion>3</archiveVersion>
<data>
<version>22</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>ExePath</name>
<state>Debug\Exe</state>
</option>
<option>
<name>ObjPath</name>
<state>Debug\Obj</state>
</option>
<option>
<name>ListPath</name>
<state>Debug\List</state>
</option>
<option>
<name>Variant</name>
<version>20</version>
<state>35</state>
</option>
<option>
<name>GEndianMode</name>
<state>0</state>
</option>
<option>
<name>Input variant</name>
<version>3</version>
<state>1</state>
</option>
<option>
<name>Input description</name>
<state>Full formatting.</state>
</option>
<option>
<name>Output variant</name>
<version>2</version>
<state>1</state>
</option>
<option>
<name>Output description</name>
<state>Full formatting.</state>
</option>
<option>
<name>GOutputBinary</name>
<state>0</state>
</option>
<option>
<name>FPU</name>
<version>2</version>
<state>0</state>
</option>
<option>
<name>OGCoreOrChip</name>
<state>1</state>
</option>
<option>
<name>GRuntimeLibSelect</name>
<version>0</version>
<state>2</state>
</option>
<option>
<name>GRuntimeLibSelectSlave</name>
<version>0</version>
<state>2</state>
</option>
<option>
<name>RTDescription</name>
<state>Use the full configuration of the C/C++ runtime library. Full locale interface, C locale, file descriptor support, multibytes in printf and scanf, and hex floats in strtod.</state>
</option>
<option>
<name>OGProductVersion</name>
<state>7.10.1.6733</state>
</option>
<option>
<name>OGLastSavedByProductVersion</name>
<state>7.10.1.6733</state>
</option>
<option>
<name>GeneralEnableMisra</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraVerbose</name>
<state>0</state>
</option>
<option>
<name>OGChipSelectEditMenu</name>
<state>MKL25Z128xxx4 Freescale MKL25Z128xxx4</state>
</option>
<option>
<name>GenLowLevelInterface</name>
<state>0</state>
</option>
<option>
<name>GEndianModeBE</name>
<state>1</state>
</option>
<option>
<name>OGBufferedTerminalOutput</name>
<state>0</state>
</option>
<option>
<name>GenStdoutInterface</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraRules98</name>
<version>0</version>
<state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
</option>
<option>
<name>GeneralMisraVer</name>
<state>0</state>
</option>
<option>
<name>GeneralMisraRules04</name>
<version>0</version>
<state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
</option>
<option>
<name>RTConfigPath2</name>
<state>$TOOLKIT_DIR$\INC\c\DLib_Config_Full.h</state>
</option>
<option>
<name>GFPUCoreSlave</name>
<version>20</version>
<state>35</state>
</option>
<option>
<name>GBECoreSlave</name>
<version>20</version>
<state>35</state>
</option>
<option>
<name>OGUseCmsis</name>
<state>0</state>
</option>
<option>
<name>OGUseCmsisDspLib</name>
<state>0</state>
</option>
<option>
<name>GRuntimeLibThreads</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
<name>ICCARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>30</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>CCDefines</name>
<state>TARGET_FF_ARDUINO</state>
<state>TARGET_KLXX</state>
<state>TARGET_KL25Z</state>
<state>TARGET_CORTEX_M</state>
<state>TARGET_LIKE_MBED</state>
<state>TARGET_M0P</state>
<state>TARGET_Freescale</state>
<state>__MBED__=1</state>
<state>__CORTEX_M0PLUS</state>
<state>TOOLCHAIN_IAR</state>
<state>MBED_BUILD_TIMESTAMP=1456248884.8</state>
<state>TARGET_LIKE_CORTEX_M0</state>
<state>ARM_MATH_CM0PLUS</state>
</option>
<option>
<name>CCPreprocFile</name>
<state>0</state>
</option>
<option>
<name>CCPreprocComments</name>
<state>0</state>
</option>
<option>
<name>CCPreprocLine</name>
<state>0</state>
</option>
<option>
<name>CCListCFile</name>
<state>0</state>
</option>
<option>
<name>CCListCMnemonics</name>
<state>0</state>
</option>
<option>
<name>CCListCMessages</name>
<state>0</state>
</option>
<option>
<name>CCListAssFile</name>
<state>0</state>
</option>
<option>
<name>CCListAssSource</name>
<state>0</state>
</option>
<option>
<name>CCEnableRemarks</name>
<state>0</state>
</option>
<option>
<name>CCDiagSuppress</name>
<state>Pa050,Pa084,Pa093,Pa082</state>
</option>
<option>
<name>CCDiagRemark</name>
<state></state>
</option>
<option>
<name>CCDiagWarning</name>
<state></state>
</option>
<option>
<name>CCDiagError</name>
<state></state>
</option>
<option>
<name>CCObjPrefix</name>
<state>1</state>
</option>
<option>
<name>CCAllowList</name>
<version>1</version>
<state>11111110</state>
</option>
<option>
<name>CCDebugInfo</name>
<state>1</state>
</option>
<option>
<name>IEndianMode</name>
<state>1</state>
</option>
<option>
<name>IProcessor</name>
<state>1</state>
</option>
<option>
<name>IExtraOptionsCheck</name>
<state>0</state>
</option>
<option>
<name>IExtraOptions</name>
<state></state>
</option>
<option>
<name>CCLangConformance</name>
<state>0</state>
</option>
<option>
<name>CCSignedPlainChar</name>
<state>1</state>
</option>
<option>
<name>CCRequirePrototypes</name>
<state>0</state>
</option>
<option>
<name>CCMultibyteSupport</name>
<state>0</state>
</option>
<option>
<name>CCDiagWarnAreErr</name>
<state>0</state>
</option>
<option>
<name>CCCompilerRuntimeInfo</name>
<state>0</state>
</option>
<option>
<name>IFpuProcessor</name>
<state>1</state>
</option>
<option>
<name>OutputFile</name>
<state>$FILE_BNAME$.o</state>
</option>
<option>
<name>CCLibConfigHeader</name>
<state>1</state>
</option>
<option>
<name>PreInclude</name>
<state></state>
</option>
<option>
<name>CompilerMisraOverride</name>
<state>0</state>
</option>
<option>
<name>CCIncludePath2</name>
<state>$PROJ_DIR$\.</state>
<state>$PROJ_DIR$\env</state>
<state>$PROJ_DIR$\mbed</state>
<state>$PROJ_DIR$\mbed\TARGET_KL25Z</state>
<state>$PROJ_DIR$\mbed\TARGET_KL25Z\TARGET_Freescale</state>
<state>$PROJ_DIR$\mbed\TARGET_KL25Z\TARGET_Freescale\TARGET_KLXX</state>
<state>$PROJ_DIR$\mbed\TARGET_KL25Z\TARGET_Freescale\TARGET_KLXX\TARGET_KL25Z</state>
<state>$PROJ_DIR$\mbed\TARGET_KL25Z\TOOLCHAIN_IAR</state>
</option>
<option>
<name>CCStdIncCheck</name>
<state>0</state>
</option>
<option>
<name>CCCodeSection</name>
<state>.text</state>
</option>
<option>
<name>IInterwork2</name>
<state>0</state>
</option>
<option>
<name>IProcessorMode2</name>
<state>1</state>
</option>
<option>
<name>CCOptLevel</name>
<state>3</state>
</option>
<option>
<name>CCOptStrategy</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>CCOptLevelSlave</name>
<state>3</state>
</option>
<option>
<name>CompilerMisraRules98</name>
<version>0</version>
<state>1000111110110101101110011100111111101110011011000101110111101101100111111111111100110011111001110111001111111111111111111111111</state>
</option>
<option>
<name>CompilerMisraRules04</name>
<version>0</version>
<state>111101110010111111111000110111111111111111111111111110010111101111010101111111111111111111111111101111111011111001111011111011111111111111111</state>
</option>
<option>
<name>CCPosIndRopi</name>
<state>0</state>
</option>
<option>
<name>CCPosIndRwpi</name>
<state>0</state>
</option>
<option>
<name>CCPosIndNoDynInit</name>
<state>0</state>
</option>
<option>
<name>IccLang</name>
<state>2</state>
</option>
<option>
<name>IccCDialect</name>
<state>1</state>
</option>
<option>
<name>IccAllowVLA</name>
<state>1</state>
</option>
<option>
<name>IccCppDialect</name>
<state>2</state>
</option>
<option>
<name>IccExceptions</name>
<state>0</state>
</option>
<option>
<name>IccRTTI</name>
<state>0</state>
</option>
<option>
<name>IccStaticDestr</name>
<state>1</state>
</option>
<option>
<name>IccCppInlineSemantics</name>
<state>0</state>
</option>
<option>
<name>IccCmsis</name>
<state>1</state>
</option>
<option>
<name>IccFloatSemantics</name>
<state>0</state>
</option>
<option>
<name>CCOptimizationNoSizeConstraints</name>
<state>0</state>
</option>
<option>
<name>CCNoLiteralPool</name>
<state>0</state>
</option>
<option>
<name>CCOptStrategySlave</name>
<version>0</version>
<state>0</state>
</option>
</data>
</settings>
<settings>
<name>AARM</name>
<archiveVersion>2</archiveVersion>
<data>
<version>9</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>AObjPrefix</name>
<state>1</state>
</option>
<option>
<name>AEndian</name>
<state>1</state>
</option>
<option>
<name>ACaseSensitivity</name>
<state>1</state>
</option>
<option>
<name>MacroChars</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>AWarnEnable</name>
<state>0</state>
</option>
<option>
<name>AWarnWhat</name>
<state>0</state>
</option>
<option>
<name>AWarnOne</name>
<state></state>
</option>
<option>
<name>AWarnRange1</name>
<state></state>
</option>
<option>
<name>AWarnRange2</name>
<state></state>
</option>
<option>
<name>ADebug</name>
<state>1</state>
</option>
<option>
<name>AltRegisterNames</name>
<state>0</state>
</option>
<option>
<name>ADefines</name>
<state></state>
</option>
<option>
<name>AList</name>
<state>0</state>
</option>
<option>
<name>AListHeader</name>
<state>1</state>
</option>
<option>
<name>AListing</name>
<state>1</state>
</option>
<option>
<name>Includes</name>
<state>0</state>
</option>
<option>
<name>MacDefs</name>
<state>0</state>
</option>
<option>
<name>MacExps</name>
<state>1</state>
</option>
<option>
<name>MacExec</name>
<state>0</state>
</option>
<option>
<name>OnlyAssed</name>
<state>0</state>
</option>
<option>
<name>MultiLine</name>
<state>0</state>
</option>
<option>
<name>PageLengthCheck</name>
<state>0</state>
</option>
<option>
<name>PageLength</name>
<state>80</state>
</option>
<option>
<name>TabSpacing</name>
<state>8</state>
</option>
<option>
<name>AXRef</name>
<state>0</state>
</option>
<option>
<name>AXRefDefines</name>
<state>0</state>
</option>
<option>
<name>AXRefInternal</name>
<state>0</state>
</option>
<option>
<name>AXRefDual</name>
<state>0</state>
</option>
<option>
<name>AProcessor</name>
<state>1</state>
</option>
<option>
<name>AFpuProcessor</name>
<state>1</state>
</option>
<option>
<name>AOutputFile</name>
<state>$FILE_BNAME$.o</state>
</option>
<option>
<name>AMultibyteSupport</name>
<state>0</state>
</option>
<option>
<name>ALimitErrorsCheck</name>
<state>0</state>
</option>
<option>
<name>ALimitErrorsEdit</name>
<state>100</state>
</option>
<option>
<name>AIgnoreStdInclude</name>
<state>1</state>
</option>
<option>
<name>AUserIncludes</name>
<state></state>
</option>
<option>
<name>AExtraOptionsCheckV2</name>
<state>0</state>
</option>
<option>
<name>AExtraOptionsV2</name>
<state></state>
</option>
<option>
<name>AsmNoLiteralPool</name>
<state>0</state>
</option>
</data>
</settings>
<settings>
<name>OBJCOPY</name>
<archiveVersion>0</archiveVersion>
<data>
<version>1</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>OOCOutputFormat</name>
<version>2</version>
<state>2</state>
</option>
<option>
<name>OCOutputOverride</name>
<state>0</state>
</option>
<option>
<name>OOCOutputFile</name>
<state>MBED_12.bin</state>
</option>
<option>
<name>OOCCommandLineProducer</name>
<state>1</state>
</option>
<option>
<name>OOCObjCopyEnable</name>
<state>1</state>
</option>
</data>
</settings>
<settings>
<name>CUSTOM</name>
<archiveVersion>3</archiveVersion>
<data>
<extensions></extensions>
<cmdline></cmdline>
</data>
</settings>
<settings>
<name>BICOMP</name>
<archiveVersion>0</archiveVersion>
<data/>
</settings>
<settings>
<name>BUILDACTION</name>
<archiveVersion>1</archiveVersion>
<data>
<prebuild></prebuild>
<postbuild></postbuild>
</data>
</settings>
<settings>
<name>ILINK</name>
<archiveVersion>0</archiveVersion>
<data>
<version>16</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>IlinkLibIOConfig</name>
<state>1</state>
</option>
<option>
<name>XLinkMisraHandler</name>
<state>0</state>
</option>
<option>
<name>IlinkInputFileSlave</name>
<state>0</state>
</option>
<option>
<name>IlinkOutputFile</name>
<state>cpp.out</state>
</option>
<option>
<name>IlinkDebugInfoEnable</name>
<state>1</state>
</option>
<option>
<name>IlinkKeepSymbols</name>
<state></state>
</option>
<option>
<name>IlinkRawBinaryFile</name>
<state></state>
</option>
<option>
<name>IlinkRawBinarySymbol</name>
<state></state>
</option>
<option>
<name>IlinkRawBinarySegment</name>
<state></state>
</option>
<option>
<name>IlinkRawBinaryAlign</name>
<state></state>
</option>
<option>
<name>IlinkDefines</name>
<state></state>
</option>
<option>
<name>IlinkConfigDefines</name>
<state></state>
</option>
<option>
<name>IlinkMapFile</name>
<state>0</state>
</option>
<option>
<name>IlinkLogFile</name>
<state>0</state>
</option>
<option>
<name>IlinkLogInitialization</name>
<state>0</state>
</option>
<option>
<name>IlinkLogModule</name>
<state>0</state>
</option>
<option>
<name>IlinkLogSection</name>
<state>0</state>
</option>
<option>
<name>IlinkLogVeneer</name>
<state>0</state>
</option>
<option>
<name>IlinkIcfOverride</name>
<state>1</state>
</option>
<option>
<name>IlinkIcfFile</name>
<state>$PROJ_DIR$\mbed\TARGET_KL25Z\TOOLCHAIN_IAR\MKL25Z4.icf</state>
</option>
<option>
<name>IlinkIcfFileSlave</name>
<state></state>
</option>
<option>
<name>IlinkEnableRemarks</name>
<state>0</state>
</option>
<option>
<name>IlinkSuppressDiags</name>
<state></state>
</option>
<option>
<name>IlinkTreatAsRem</name>
<state></state>
</option>
<option>
<name>IlinkTreatAsWarn</name>
<state></state>
</option>
<option>
<name>IlinkTreatAsErr</name>
<state></state>
</option>
<option>
<name>IlinkWarningsAreErrors</name>
<state>0</state>
</option>
<option>
<name>IlinkUseExtraOptions</name>
<state>1</state>
</option>
<option>
<name>IlinkExtraOptions</name>
<state>--skip_dynamic_initialization</state>
</option>
<option>
<name>IlinkLowLevelInterfaceSlave</name>
<state>1</state>
</option>
<option>
<name>IlinkAutoLibEnable</name>
<state>1</state>
</option>
<option>
<name>IlinkAdditionalLibs</name>
<state></state>
</option>
<option>
<name>IlinkOverrideProgramEntryLabel</name>
<state>0</state>
</option>
<option>
<name>IlinkProgramEntryLabelSelect</name>
<state>0</state>
</option>
<option>
<name>IlinkProgramEntryLabel</name>
<state>__iar_program_start</state>
</option>
<option>
<name>DoFill</name>
<state>0</state>
</option>
<option>
<name>FillerByte</name>
<state>0xFF</state>
</option>
<option>
<name>FillerStart</name>
<state>0x0</state>
</option>
<option>
<name>FillerEnd</name>
<state>0x0</state>
</option>
<option>
<name>CrcSize</name>
<version>0</version>
<state>1</state>
</option>
<option>
<name>CrcAlign</name>
<state>1</state>
</option>
<option>
<name>CrcPoly</name>
<state>0x11021</state>
</option>
<option>
<name>CrcCompl</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>CrcBitOrder</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>CrcInitialValue</name>
<state>0x0</state>
</option>
<option>
<name>DoCrc</name>
<state>0</state>
</option>
<option>
<name>IlinkBE8Slave</name>
<state>1</state>
</option>
<option>
<name>IlinkBufferedTerminalOutput</name>
<state>1</state>
</option>
<option>
<name>IlinkStdoutInterfaceSlave</name>
<state>1</state>
</option>
<option>
<name>CrcFullSize</name>
<state>0</state>
</option>
<option>
<name>IlinkIElfToolPostProcess</name>
<state>0</state>
</option>
<option>
<name>IlinkLogAutoLibSelect</name>
<state>0</state>
</option>
<option>
<name>IlinkLogRedirSymbols</name>
<state>0</state>
</option>
<option>
<name>IlinkLogUnusedFragments</name>
<state>0</state>
</option>
<option>
<name>IlinkCrcReverseByteOrder</name>
<state>0</state>
</option>
<option>
<name>IlinkCrcUseAsInput</name>
<state>1</state>
</option>
<option>
<name>IlinkOptInline</name>
<state>0</state>
</option>
<option>
<name>IlinkOptExceptionsAllow</name>
<state>0</state>
</option>
<option>
<name>IlinkOptExceptionsForce</name>
<state>0</state>
</option>
<option>
<name>IlinkCmsis</name>
<state>1</state>
</option>
<option>
<name>IlinkOptMergeDuplSections</name>
<state>0</state>
</option>
<option>
<name>IlinkOptUseVfe</name>
<state>1</state>
</option>
<option>
<name>IlinkOptForceVfe</name>
<state>0</state>
</option>
<option>
<name>IlinkStackAnalysisEnable</name>
<state>0</state>
</option>
<option>
<name>IlinkStackControlFile</name>
<state></state>
</option>
<option>
<name>IlinkStackCallGraphFile</name>
<state></state>
</option>
<option>
<name>CrcAlgorithm</name>
<version>0</version>
<state>1</state>
</option>
<option>
<name>CrcUnitSize</name>
<version>0</version>
<state>0</state>
</option>
<option>
<name>IlinkThreadsSlave</name>
<state>1</state>
</option>
</data>
</settings>
<settings>
<name>IARCHIVE</name>
<archiveVersion>0</archiveVersion>
<data>
<version>0</version>
<wantNonLocal>1</wantNonLocal>
<debug>1</debug>
<option>
<name>IarchiveInputs</name>
<state></state>
</option>
<option>
<name>IarchiveOverride</name>
<state>0</state>
</option>
<option>
<name>IarchiveOutput</name>
<state>###Unitialized###</state>
</option>
</data>
</settings>
<settings>
<name>BILINK</name>
<archiveVersion>0</archiveVersion>
<data/>
</settings>
</configuration>
<file>
<name>$PROJ_DIR$/main.cpp</name>
</file>
<group>
<name>env</name>
<file>
<name>$PROJ_DIR$/env\test_env.cpp</name>
</file>
</group>
</project>

View File

@ -1,403 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_proj.xsd">
<SchemaVersion>1.1</SchemaVersion>
<Header>###This file was automagically generated by mbed.org. For more information, see http://mbed.org/handbook/Exporting-To-Uvision </Header>
<Targets>
<Target>
<TargetName>mbed FRDM-KL25Z</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<TargetOption>
<TargetCommonOption>
<Device>MKL25Z128xxx4</Device>
<Vendor>Freescale Semiconductor</Vendor>
<Cpu>IRAM(0x1FFFF000-0x1FFFFFFF) IRAM2(0x20000000-0x20002FFF) IROM(0x0-0x1FFFF) CLOCK(8000000) CPUTYPE("Cortex-M0+") ELITTLE</Cpu>
<FlashUtilSpec></FlashUtilSpec>
<StartupFile>"STARTUP\Freescale\Kinetis\startup_MKL25Z4.s" ("Freescale MKL25Zxxxxxx4 Startup Code")</StartupFile>
<FlashDriverDll>ULP2CM3(-O2510 -S0 -C0 -FO15 -FD20000000 -FC800 -FN1 -FF0MK_P128_48MHZ -FS00 -FL020000)</FlashDriverDll>
<DeviceId>6533</DeviceId>
<RegisterFile>MKL25Z4.H</RegisterFile>
<MemoryEnv></MemoryEnv>
<Cmp></Cmp>
<Asm></Asm>
<Linker></Linker>
<OHString></OHString>
<InfinionOptionDll></InfinionOptionDll>
<SLE66CMisc></SLE66CMisc>
<SLE66AMisc></SLE66AMisc>
<SLE66LinkerMisc></SLE66LinkerMisc>
<SFDFile>SFD\Freescale\Kinetis\MKL25Z4.sfr</SFDFile>
<UseEnv>0</UseEnv>
<BinPath></BinPath>
<IncludePath></IncludePath>
<LibPath></LibPath>
<RegisterFilePath>Freescale\Kinetis\</RegisterFilePath>
<DBRegisterFilePath>Freescale\Kinetis\</DBRegisterFilePath>
<TargetStatus>
<Error>0</Error>
<ExitCodeStop>0</ExitCodeStop>
<ButtonStop>0</ButtonStop>
<NotGenerated>0</NotGenerated>
<InvalidFlash>1</InvalidFlash>
</TargetStatus>
<OutputDirectory>.\build\</OutputDirectory>
<OutputName>MBED_11</OutputName>
<CreateExecutable>1</CreateExecutable>
<CreateLib>0</CreateLib>
<CreateHexFile>0</CreateHexFile>
<DebugInformation>1</DebugInformation>
<BrowseInformation>1</BrowseInformation>
<ListingPath>.\build\</ListingPath>
<HexFormatSelection>1</HexFormatSelection>
<Merge32K>0</Merge32K>
<CreateBatchFile>0</CreateBatchFile>
<BeforeCompile>
<RunUserProg1>0</RunUserProg1>
<RunUserProg2>0</RunUserProg2>
<UserProg1Name></UserProg1Name>
<UserProg2Name></UserProg2Name>
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
<nStopU1X>0</nStopU1X>
<nStopU2X>0</nStopU2X>
</BeforeCompile>
<BeforeMake>
<RunUserProg1>0</RunUserProg1>
<RunUserProg2>0</RunUserProg2>
<UserProg1Name></UserProg1Name>
<UserProg2Name></UserProg2Name>
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
</BeforeMake>
<AfterMake>
<RunUserProg1>1</RunUserProg1>
<RunUserProg2>0</RunUserProg2>
<UserProg1Name>fromelf --bin --output=@L.bin !L</UserProg1Name>
<UserProg2Name></UserProg2Name>
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
</AfterMake>
<SelectedForBatchBuild>0</SelectedForBatchBuild>
<SVCSIdString></SVCSIdString>
</TargetCommonOption>
<CommonProperty>
<UseCPPCompiler>0</UseCPPCompiler>
<RVCTCodeConst>0</RVCTCodeConst>
<RVCTZI>0</RVCTZI>
<RVCTOtherData>0</RVCTOtherData>
<ModuleSelection>0</ModuleSelection>
<IncludeInBuild>1</IncludeInBuild>
<AlwaysBuild>0</AlwaysBuild>
<GenerateAssemblyFile>0</GenerateAssemblyFile>
<AssembleAssemblyFile>0</AssembleAssemblyFile>
<PublicsOnly>0</PublicsOnly>
<StopOnExitCode>3</StopOnExitCode>
<CustomArgument></CustomArgument>
<IncludeLibraryModules></IncludeLibraryModules>
</CommonProperty>
<DllOption>
<SimDllName>SARMCM3.DLL</SimDllName>
<SimDllArguments></SimDllArguments>
<SimDlgDll>DARMCM1.DLL</SimDlgDll>
<SimDlgDllArguments>-pCM0+</SimDlgDllArguments>
<TargetDllName>SARMCM3.DLL</TargetDllName>
<TargetDllArguments></TargetDllArguments>
<TargetDlgDll>TARMCM1.DLL</TargetDlgDll>
<TargetDlgDllArguments>-pCM0+</TargetDlgDllArguments>
</DllOption>
<DebugOption>
<OPTHX>
<HexSelection>1</HexSelection>
<HexRangeLowAddress>0</HexRangeLowAddress>
<HexRangeHighAddress>0</HexRangeHighAddress>
<HexOffset>0</HexOffset>
<Oh166RecLen>16</Oh166RecLen>
</OPTHX>
<Simulator>
<UseSimulator>0</UseSimulator>
<LoadApplicationAtStartup>1</LoadApplicationAtStartup>
<RunToMain>1</RunToMain>
<RestoreBreakpoints>1</RestoreBreakpoints>
<RestoreWatchpoints>1</RestoreWatchpoints>
<RestoreMemoryDisplay>1</RestoreMemoryDisplay>
<RestoreFunctions>1</RestoreFunctions>
<RestoreToolbox>1</RestoreToolbox>
<LimitSpeedToRealTime>0</LimitSpeedToRealTime>
</Simulator>
<Target>
<UseTarget>1</UseTarget>
<LoadApplicationAtStartup>1</LoadApplicationAtStartup>
<RunToMain>1</RunToMain>
<RestoreBreakpoints>1</RestoreBreakpoints>
<RestoreWatchpoints>1</RestoreWatchpoints>
<RestoreMemoryDisplay>1</RestoreMemoryDisplay>
<RestoreFunctions>0</RestoreFunctions>
<RestoreToolbox>1</RestoreToolbox>
</Target>
<RunDebugAfterBuild>0</RunDebugAfterBuild>
<TargetSelection>14</TargetSelection>
<SimDlls>
<CpuDll></CpuDll>
<CpuDllArguments></CpuDllArguments>
<PeripheralDll></PeripheralDll>
<PeripheralDllArguments></PeripheralDllArguments>
<InitializationFile></InitializationFile>
</SimDlls>
<TargetDlls>
<CpuDll></CpuDll>
<CpuDllArguments></CpuDllArguments>
<PeripheralDll></PeripheralDll>
<PeripheralDllArguments></PeripheralDllArguments>
<InitializationFile></InitializationFile>
<Driver>BIN\CMSIS_AGDI.dll</Driver>
</TargetDlls>
</DebugOption>
<Utilities>
<Flash1>
<UseTargetDll>1</UseTargetDll>
<UseExternalTool>0</UseExternalTool>
<RunIndependent>0</RunIndependent>
<UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging>
<Capability>1</Capability>
<DriverSelection>4105</DriverSelection>
</Flash1>
<Flash2>BIN\CMSIS_AGDI.dll</Flash2>
<Flash3>"" ()</Flash3>
<Flash4></Flash4>
</Utilities>
<TargetArmAds>
<ArmAdsMisc>
<GenerateListings>0</GenerateListings>
<asHll>1</asHll>
<asAsm>1</asAsm>
<asMacX>1</asMacX>
<asSyms>1</asSyms>
<asFals>1</asFals>
<asDbgD>1</asDbgD>
<asForm>1</asForm>
<ldLst>0</ldLst>
<ldmm>1</ldmm>
<ldXref>1</ldXref>
<BigEnd>0</BigEnd>
<AdsALst>1</AdsALst>
<AdsACrf>1</AdsACrf>
<AdsANop>0</AdsANop>
<AdsANot>0</AdsANot>
<AdsLLst>1</AdsLLst>
<AdsLmap>1</AdsLmap>
<AdsLcgr>1</AdsLcgr>
<AdsLsym>1</AdsLsym>
<AdsLszi>1</AdsLszi>
<AdsLtoi>1</AdsLtoi>
<AdsLsun>1</AdsLsun>
<AdsLven>1</AdsLven>
<AdsLsxf>1</AdsLsxf>
<RvctClst>0</RvctClst>
<GenPPlst>0</GenPPlst>
<AdsCpuType>"Cortex-M0+"</AdsCpuType>
<RvctDeviceName></RvctDeviceName>
<mOS>0</mOS>
<uocRom>0</uocRom>
<uocRam>0</uocRam>
<hadIROM>1</hadIROM>
<hadIRAM>1</hadIRAM>
<hadXRAM>0</hadXRAM>
<uocXRam>0</uocXRam>
<RvdsVP>0</RvdsVP>
<hadIRAM2>1</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
<useUlib>0</useUlib>
<EndSel>0</EndSel>
<uLtcg>0</uLtcg>
<RoSelD>3</RoSelD>
<RwSelD>3</RwSelD>
<CodeSel>0</CodeSel>
<OptFeed>0</OptFeed>
<NoZi1>0</NoZi1>
<NoZi2>0</NoZi2>
<NoZi3>0</NoZi3>
<NoZi4>0</NoZi4>
<NoZi5>0</NoZi5>
<Ro1Chk>0</Ro1Chk>
<Ro2Chk>0</Ro2Chk>
<Ro3Chk>0</Ro3Chk>
<Ir1Chk>1</Ir1Chk>
<Ir2Chk>0</Ir2Chk>
<Ra1Chk>0</Ra1Chk>
<Ra2Chk>0</Ra2Chk>
<Ra3Chk>0</Ra3Chk>
<Im1Chk>1</Im1Chk>
<Im2Chk>0</Im2Chk>
<OnChipMemories>
<Ocm1>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</Ocm1>
<Ocm2>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</Ocm2>
<Ocm3>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</Ocm3>
<Ocm4>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</Ocm4>
<Ocm5>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</Ocm5>
<Ocm6>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</Ocm6>
<IRAM>
<Type>0</Type>
<StartAddress>0x1ffff000</StartAddress>
<Size>0x1000</Size>
</IRAM>
<IROM>
<Type>1</Type>
<StartAddress>0x0</StartAddress>
<Size>0x20000</Size>
</IROM>
<XRAM>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</XRAM>
<OCR_RVCT1>
<Type>1</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT1>
<OCR_RVCT2>
<Type>1</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT2>
<OCR_RVCT3>
<Type>1</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT3>
<OCR_RVCT4>
<Type>1</Type>
<StartAddress>0x0</StartAddress>
<Size>0x20000</Size>
</OCR_RVCT4>
<OCR_RVCT5>
<Type>1</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT5>
<OCR_RVCT6>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT6>
<OCR_RVCT7>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT7>
<OCR_RVCT8>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT8>
<OCR_RVCT9>
<Type>0</Type>
<StartAddress>0x20000000</StartAddress>
<Size>0x3000</Size>
</OCR_RVCT9>
<OCR_RVCT10>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT10>
</OnChipMemories>
<RvctStartVector></RvctStartVector>
</ArmAdsMisc>
<Cads>
<interw>1</interw>
<Optim>1</Optim>
<oTime>0</oTime>
<SplitLS>0</SplitLS>
<OneElfS>0</OneElfS>
<Strict>0</Strict>
<EnumInt>0</EnumInt>
<PlainCh>0</PlainCh>
<Ropi>0</Ropi>
<Rwpi>0</Rwpi>
<wLevel>0</wLevel>
<uThumb>0</uThumb>
<uSurpInc>0</uSurpInc>
<uC99>1</uC99>
<VariousControls>
<MiscControls></MiscControls>
<Define> </Define>
<Undefine></Undefine>
<IncludePath> </IncludePath>
</VariousControls>
</Cads>
<Aads>
<interw>1</interw>
<Ropi>0</Ropi>
<Rwpi>0</Rwpi>
<thumb>0</thumb>
<SplitLS>0</SplitLS>
<SwStkChk>0</SwStkChk>
<NoWarn>0</NoWarn>
<uSurpInc>0</uSurpInc>
<VariousControls>
<MiscControls></MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
</VariousControls>
</Aads>
<LDads>
<umfTarg>0</umfTarg>
<Ropi>0</Ropi>
<Rwpi>0</Rwpi>
<noStLib>0</noStLib>
<RepFail>1</RepFail>
<useFile>0</useFile>
<TextAddressRange>0x00000000</TextAddressRange>
<DataAddressRange>0x10000000</DataAddressRange>
<ScatterFile>mbed\TARGET_KL25Z\TOOLCHAIN_ARM_STD\MKL25Z4.sct</ScatterFile>
<IncludeLibs></IncludeLibs>
<IncludeLibsPath></IncludeLibsPath>
<Misc>
</Misc>
<LinkerInputFile></LinkerInputFile>
<DisabledWarnings></DisabledWarnings>
</LDads>
</TargetArmAds>
</TargetOption>
<Groups>
<Group>
<GroupName>src</GroupName>
<Files>
</Files>
</Group>
</Groups>
</Target>
</Targets>
</Project>

View File

@ -0,0 +1,232 @@
import os
from os.path import sep, normpath, join, exists
import ntpath
import copy
from collections import namedtuple
from distutils.spawn import find_executable
import subprocess
import re
from tools.arm_pack_manager import Cache
from tools.targets import TARGET_MAP
from tools.export.exporters import Exporter, FailedBuildException
from tools.export.cmsis import DeviceCMSIS
cache_d = False
class DeviceUvision(DeviceCMSIS):
"""Uvision Device class, inherits CMSIS Device class
Encapsulates information necessary for uvision project targets"""
def __init__(self, target):
DeviceCMSIS.__init__(self, target)
dev_format = "$$Device:{0}${1}"
self.svd = ''
if self.debug_svd:
self.svd = dev_format.format(self.dname, self.debug_svd)
self.reg_file = dev_format.format(self.dname, self.compile_header)
self.debug_interface = self.uv_debug()
self.flash_dll = self.generate_flash_dll()
def uv_debug(self):
"""Return a namedtuple of information about uvision debug settings"""
UVDebug = namedtuple('UVDebug',['bin_loc','core_flag', 'key'])
# CortexMXn => pCMX
cpu = self.core.replace("Cortex-", "C")
cpu = cpu.replace("+", "")
cpu = cpu.replace("F", "")
cpu_flag = "p"+cpu
# Locations found in Keil_v5/TOOLS.INI
debuggers = {"st-link": ('STLink\\ST-LINKIII-KEIL_SWO.dll', 'ST-LINKIII-KEIL_SWO'),
"j-link":('Segger\\JL2CM3.dll', 'JL2CM3'),
"cmsis-dap":('BIN\\CMSIS_AGDI.dll', 'CMSIS_AGDI'),
"nulink":('NULink\\Nu_Link.dll','Nu_Link')}
res = debuggers[self.debug.lower()]
binary = res[0]
key = res[1]
return UVDebug(binary, cpu_flag, key)
def generate_flash_dll(self):
'''Flash DLL string from uvision
S = SW/JTAG Clock ID
C = CPU index in JTAG chain
P = Access Port
For the Options for Target -> Debug tab -> settings -> "Flash" tab in the dialog:
FD = RAM Start for Flash Functions
FC = RAM Size for Flash Functions
FN = Number of Flash types
FF = Flash File Name (without an extension)
FS = Start Address of the Flash Device
FL = Size of the Flash Device
FP = Full path to the Device algorithm (RTE)
Necessary to flash some targets. Info gathered from algorithms field of pdsc file.
'''
fl_count = 0
def get_mem_no_x(mem_str):
mem_reg = "\dx(\w+)"
m = re.search(mem_reg, mem_str)
return m.group(1) if m else None
RAMS = [(get_mem_no_x(info["start"]), get_mem_no_x(info["size"]))
for mem, info in self.target_info["memory"].items() if "RAM" in mem]
format_str = "UL2CM3(-S0 -C0 -P0 -FD{ramstart}"+" -FC{ramsize} "+"-FN{num_algos} {extra_flags})"
ramstart = ''
#Default according to Keil developer
ramsize = '1000'
if len(RAMS)>=1:
ramstart = RAMS[0][0]
extra_flags = []
for name, info in self.target_info["algorithm"].items():
if int(info["default"])==0:
continue
name_reg = "\w*/([\w_]+)\.flm"
m = re.search(name_reg, name.lower())
fl_name = m.group(1) if m else None
name_flag = "-FF" + str(fl_count) + fl_name
start, size = get_mem_no_x(info["start"]), get_mem_no_x(info["size"])
rom_start_flag = "-FS"+str(fl_count)+str(start)
rom_size_flag = "-FL" + str(fl_count) + str(size)
if info["ramstart"] is not None and info["ramsize"] is not None:
ramstart = get_mem_no_x(info["ramstart"])
ramsize = get_mem_no_x(info["ramsize"])
path_flag = "-FP" + str(fl_count) + "($$Device:"+self.dname+"$"+name+")"
extra_flags.extend([name_flag, rom_start_flag, rom_size_flag, path_flag])
fl_count += 1
extra = " ".join(extra_flags)
return format_str.format(ramstart=ramstart,
ramsize=ramsize,
extra_flags=extra, num_algos=fl_count)
class Uvision(Exporter):
"""Keil Uvision class
This class encapsulates information to be contained in a Uvision
project file (.uvprojx).
The needed information can be viewed in uvision.tmpl
"""
NAME = 'cmsis'
TOOLCHAIN = 'ARM'
TARGETS = [target for target, obj in TARGET_MAP.iteritems()
if "ARM" in obj.supported_toolchains]
#File associations within .uvprojx file
file_types = {'.cpp': 8, '.c': 1, '.s': 2,
'.obj': 3, '.o': 3, '.lib': 4,
'.ar': 4, '.h': 5, '.sct': 4}
def uv_file(self, loc):
"""Return a namedtuple of information about project file
Positional Arguments:
loc - the file's location
.uvprojx XML for project file:
<File>
<FileType>{{file.type}}</FileType>
<FileName>{{file.name}}</FileName>
<FilePath>{{file.loc}}</FilePath>
</File>
"""
UVFile = namedtuple('UVFile', ['type','loc','name'])
_, ext = os.path.splitext(loc)
type = self.file_types[ext.lower()]
name = ntpath.basename(normpath(loc))
return UVFile(type, loc, name)
def format_flags(self):
"""Format toolchain flags for Uvision"""
flags = copy.deepcopy(self.flags)
asm_flag_string = '--cpreproc --cpreproc_opts=-D__ASSERT_MSG,' + \
",".join(flags['asm_flags'])
# asm flags only, common are not valid within uvision project,
# they are armcc specific
flags['asm_flags'] = asm_flag_string
# cxx flags included, as uvision have them all in one tab
flags['c_flags'] = list(set(['-D__ASSERT_MSG']
+ flags['common_flags']
+ flags['c_flags']
+ flags['cxx_flags']))
# not compatible with c99 flag set in the template
try: flags['c_flags'].remove("--c99")
except ValueError: pass
# cpp is not required as it's implicit for cpp files
try: flags['c_flags'].remove("--cpp")
except ValueError: pass
# we want no-vla for only cxx, but it's also applied for C in IDE,
# thus we remove it
try: flags['c_flags'].remove("--no_vla")
except ValueError: pass
flags['c_flags'] =" ".join(flags['c_flags'])
return flags
def format_src(self, srcs):
"""Make sources into the named tuple for use in the template"""
grouped = self.group_project_files(srcs)
for group, files in grouped.items():
grouped[group] = [self.uv_file(src) for src in files]
return grouped
def generate(self):
"""Generate the .uvproj file"""
cache = Cache(True, False)
if cache_d:
cache.cache_descriptors()
srcs = self.resources.headers + self.resources.s_sources + \
self.resources.c_sources + self.resources.cpp_sources + \
self.resources.objects + self.resources.libraries
ctx = {
'name': self.project_name,
'project_files': self.format_src(srcs),
'linker_script':self.resources.linker_script,
'include_paths': '; '.join(self.resources.inc_dirs).encode('utf-8'),
'device': DeviceUvision(self.target),
}
# Turn on FPU optimizations if the core has an FPU
ctx['fpu_setting'] = 1 if 'f' not in ctx['device'].core.lower() \
or 'd' in ctx['device'].core.lower() else 2
ctx.update(self.format_flags())
self.gen_file('uvision/uvision.tmpl', ctx, self.project_name+".uvprojx")
self.gen_file('uvision/uvision_debug.tmpl', ctx, self.project_name + ".uvoptx")
def build(self):
ERRORLEVEL = {
0: 'success (0 warnings, 0 errors)',
1: 'warnings',
2: 'errors',
3: 'fatal errors',
11: 'cant write to project file',
12: 'device error',
13: 'error writing',
15: 'error reading xml file',
}
success = 0
warn = 1
if find_executable("UV4"):
uv_exe = "UV4.exe"
else:
uv_exe = join('C:', sep,
'Keil_v5', 'UV4', 'UV4.exe')
if not exists(uv_exe):
raise Exception("UV4.exe not found. Add to path.")
cmd = [uv_exe, '-r', '-j0', '-o', join(self.export_dir,'build_log.txt'), join(self.export_dir,self.project_name+".uvprojx")]
ret_code = subprocess.call(cmd)
with open(join(self.export_dir, 'build_log.txt'), 'r') as build_log:
print build_log.read()
if ret_code != success and ret_code != warn:
# Seems like something went wrong.
raise FailedBuildException("Project: %s build failed with the status: %s" % (
self.project_name, ERRORLEVEL.get(ret_code, "Unknown")))
else:
return "Project: %s build succeeded with the status: %s" % (
self.project_name, ERRORLEVEL.get(ret_code, "Unknown"))

View File

@ -1,25 +1,27 @@
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_proj.xsd">
<Project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_projx.xsd">
<SchemaVersion>1.1</SchemaVersion>
<SchemaVersion>2.1</SchemaVersion>
<Header>###This file was automagically generated by mbed.org. For more information, see http://mbed.org/handbook/Exporting-To-Uvision </Header>
<Header>### uVision Project, (C) Keil Software</Header>
<Targets>
<Target>
<TargetName>ARM BEETLE SoC</TargetName>
<TargetName>{{name}}</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<TargetOption>
<TargetCommonOption>
<Device>ARMCM3</Device>
<Vendor>ARM</Vendor>
<Cpu>IROM(0x00000000,0x40000) IRAM(0x20000200,0x1FE00) CPUTYPE("Cortex-M3") CLOCK(24000000) ESEL ELITTLE</Cpu>
<Device>{{device.dname}}</Device>
<Vendor>{{device.dvendor}}</Vendor>
<PackID>{{device.pack_id}}</PackID>
<PackURL>{{device.pack_url}}</PackURL>
<Cpu></Cpu>
<FlashUtilSpec></FlashUtilSpec>
<StartupFile></StartupFile>
<FlashDriverDll>UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000)</FlashDriverDll>
<FlashDriverDll>{{device.flash_dll}}</FlashDriverDll>
<DeviceId>0</DeviceId>
<RegisterFile>$$Device:ARMCM3$Device\ARM\ARMCM3\Include\ARMCM3.h</RegisterFile>
<RegisterFile>{{device.reg_file}}</RegisterFile>
<MemoryEnv></MemoryEnv>
<Cmp></Cmp>
<Asm></Asm>
@ -29,7 +31,8 @@
<SLE66CMisc></SLE66CMisc>
<SLE66AMisc></SLE66AMisc>
<SLE66LinkerMisc></SLE66LinkerMisc>
<SFDFile></SFDFile>
<SFDFile>{{device.svd}}</SFDFile>
<bCustSvd>0</bCustSvd>
<UseEnv>0</UseEnv>
<BinPath></BinPath>
<IncludePath></IncludePath>
@ -43,14 +46,14 @@
<NotGenerated>0</NotGenerated>
<InvalidFlash>1</InvalidFlash>
</TargetStatus>
<OutputDirectory>.\build\</OutputDirectory>
<OutputName></OutputName>
<OutputDirectory>.\.build\uvision5\</OutputDirectory>
<OutputName>{{name}}</OutputName>
<CreateExecutable>1</CreateExecutable>
<CreateLib>0</CreateLib>
<CreateHexFile>0</CreateHexFile>
<DebugInformation>1</DebugInformation>
<BrowseInformation>1</BrowseInformation>
<ListingPath>.\build\</ListingPath>
<ListingPath>.\.build\uvision5\</ListingPath>
<HexFormatSelection>1</HexFormatSelection>
<Merge32K>0</Merge32K>
<CreateBatchFile>0</CreateBatchFile>
@ -71,11 +74,13 @@
<UserProg2Name></UserProg2Name>
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
<nStopB1X>0</nStopB1X>
<nStopB2X>0</nStopB2X>
</BeforeMake>
<AfterMake>
<RunUserProg1>1</RunUserProg1>
<RunUserProg1>0</RunUserProg1>
<RunUserProg2>0</RunUserProg2>
<UserProg1Name>$K\ARM\ARMCC\bin\fromelf.exe --bin --output=.\build\@L.bin !L</UserProg1Name>
<UserProg1Name></UserProg1Name>
<UserProg2Name></UserProg2Name>
<UserProg1Dos16Mode>0</UserProg1Dos16Mode>
<UserProg2Dos16Mode>0</UserProg2Dos16Mode>
@ -102,14 +107,14 @@
<ComprImg>1</ComprImg>
</CommonProperty>
<DllOption>
<SimDllName>SARMCM3.DLL</SimDllName>
<SimDllArguments>-MPU</SimDllArguments>
<SimDllName></SimDllName>
<SimDllArguments> </SimDllArguments>
<SimDlgDll>DCM.DLL</SimDlgDll>
<SimDlgDllArguments>-pCM3</SimDlgDllArguments>
<SimDlgDllArguments></SimDlgDllArguments>
<TargetDllName>SARMCM3.DLL</TargetDllName>
<TargetDllArguments>-MPU</TargetDllArguments>
<TargetDllArguments></TargetDllArguments>
<TargetDlgDll>TCM.DLL</TargetDlgDll>
<TargetDlgDllArguments>-pCM3</TargetDlgDllArguments>
<TargetDlgDllArguments>-{{device.debug_interface.core_flag}}</TargetDlgDllArguments>
</DllOption>
<DebugOption>
<OPTHX>
@ -144,7 +149,7 @@
<RestoreSysVw>1</RestoreSysVw>
</Target>
<RunDebugAfterBuild>0</RunDebugAfterBuild>
<TargetSelection>1</TargetSelection>
<TargetSelection>0</TargetSelection>
<SimDlls>
<CpuDll></CpuDll>
<CpuDllArguments></CpuDllArguments>
@ -158,7 +163,7 @@
<PeripheralDll></PeripheralDll>
<PeripheralDllArguments></PeripheralDllArguments>
<InitializationFile></InitializationFile>
<Driver>BIN\UL2CM3.DLL</Driver>
<Driver>{{device.debug_interface.bin_loc}}</Driver>
</TargetDlls>
</DebugOption>
<Utilities>
@ -167,8 +172,8 @@
<UseExternalTool>0</UseExternalTool>
<RunIndependent>0</RunIndependent>
<UpdateFlashBeforeDebugging>1</UpdateFlashBeforeDebugging>
<Capability>1</Capability>
<DriverSelection>4096</DriverSelection>
<Capability>0</Capability>
<DriverSelection>-1</DriverSelection>
</Flash1>
<bUseTDR>1</bUseTDR>
<Flash2>BIN\UL2CM3.DLL</Flash2>
@ -208,7 +213,7 @@
<AdsLsxf>1</AdsLsxf>
<RvctClst>0</RvctClst>
<GenPPlst>0</GenPPlst>
<AdsCpuType>"Cortex-M3"</AdsCpuType>
<AdsCpuType>"{{device.core.replace("D","").replace("F","")}}"</AdsCpuType>
<RvctDeviceName></RvctDeviceName>
<mOS>0</mOS>
<uocRom>0</uocRom>
@ -217,12 +222,12 @@
<hadIRAM>1</hadIRAM>
<hadXRAM>0</hadXRAM>
<uocXRam>0</uocXRam>
<RvdsVP>0</RvdsVP>
<hadIRAM2>0</hadIRAM2>
<RvdsVP>{{fpu_setting}}</RvdsVP>
<hadIRAM2>1</hadIRAM2>
<hadIROM2>0</hadIROM2>
<StupSel>8</StupSel>
<useUlib>0</useUlib>
<EndSel>1</EndSel>
<EndSel>0</EndSel>
<uLtcg>0</uLtcg>
<nSecure>0</nSecure>
<RoSelD>3</RoSelD>
@ -260,11 +265,11 @@
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</Ocm3>
<Ocm3>
<Ocm4>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</Ocm3>
</Ocm4>
<Ocm5>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
@ -275,15 +280,16 @@
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</Ocm6>
{
<IRAM>
<Type>0</Type>
<StartAddress>0x20000000</StartAddress>
<Size>0x20000</Size>
<StartAddress>0</StartAddress>
<Size>0</Size>
</IRAM>
<IROM>
<Type>1</Type>
<StartAddress>0x0</StartAddress>
<Size>0x40000</Size>
<StartAddress>0</StartAddress>
<Size>0</Size>
</IROM>
<XRAM>
<Type>0</Type>
@ -291,27 +297,27 @@
<Size>0x0</Size>
</XRAM>
<OCR_RVCT1>
<Type>1</Type>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT1>
<OCR_RVCT2>
<Type>1</Type>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT2>
<OCR_RVCT3>
<Type>1</Type>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT3>
<OCR_RVCT4>
<Type>1</Type>
<StartAddress>0x0</StartAddress>
<Size>0x40000</Size>
<Size>0x20000</Size>
</OCR_RVCT4>
<OCR_RVCT5>
<Type>1</Type>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
</OCR_RVCT5>
@ -333,19 +339,19 @@
<OCR_RVCT9>
<Type>0</Type>
<StartAddress>0x20000000</StartAddress>
<Size>0x20000</Size>
<Size>0x2000</Size>
</OCR_RVCT9>
<OCR_RVCT10>
<Type>0</Type>
<StartAddress>0x0</StartAddress>
<Size>0x0</Size>
<StartAddress>0x1fffe000</StartAddress>
<Size>0x2000</Size>
</OCR_RVCT10>
</OnChipMemories>
<RvctStartVector></RvctStartVector>
</ArmAdsMisc>
<Cads>
<interw>1</interw>
<Optim>4</Optim>
<interw>0</interw>
<Optim>2</Optim>
<oTime>0</oTime>
<SplitLS>0</SplitLS>
<OneElfS>0</OneElfS>
@ -354,20 +360,27 @@
<PlainCh>0</PlainCh>
<Ropi>0</Ropi>
<Rwpi>0</Rwpi>
<wLevel>2</wLevel>
<wLevel>0</wLevel>
<uThumb>0</uThumb>
<uSurpInc>0</uSurpInc>
<uC99>1</uC99>
<useXO>0</useXO>
<v6Lang>1</v6Lang>
<v6LangP>1</v6LangP>
<vShortEn>1</vShortEn>
<vShortWch>1</vShortWch>
<v6Lto>0</v6Lto>
<v6WtE>0</v6WtE>
<v6Rtti>0</v6Rtti>
<VariousControls>
<MiscControls>--gnu --no_rtti </MiscControls>
<MiscControls>{{c_flags}}</MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
<IncludePath>{{include_paths}}</IncludePath>
</VariousControls>
</Cads>
<Aads>
<interw>1</interw>
<interw>0</interw>
<Ropi>0</Ropi>
<Rwpi>0</Rwpi>
<thumb>0</thumb>
@ -376,8 +389,9 @@
<NoWarn>0</NoWarn>
<uSurpInc>0</uSurpInc>
<useXO>0</useXO>
<uClangAs>0</uClangAs>
<VariousControls>
<MiscControls></MiscControls>
<MiscControls>{{asm_flags}}</MiscControls>
<Define></Define>
<Undefine></Undefine>
<IncludePath></IncludePath>
@ -388,41 +402,35 @@
<Ropi>0</Ropi>
<Rwpi>0</Rwpi>
<noStLib>0</noStLib>
<RepFail>1</RepFail>
<RepFail>0</RepFail>
<useFile>0</useFile>
<TextAddressRange>0x00000000</TextAddressRange>
<DataAddressRange>0x20000000</DataAddressRange>
<ScatterFile></ScatterFile>
<TextAddressRange>0</TextAddressRange>
<DataAddressRange>0</DataAddressRange>
<pXoBase></pXoBase>
<ScatterFile>{{linker_script}}</ScatterFile>
<IncludeLibs></IncludeLibs>
<IncludeLibsPath></IncludeLibsPath>
<Misc>
--entry=Reset_Handler
</Misc>
<Misc></Misc>
<LinkerInputFile></LinkerInputFile>
<DisabledWarnings></DisabledWarnings>
</LDads>
</TargetArmAds>
</TargetOption>
<Groups>
{% for group, files in project_files.iteritems() %}
<Group>
<GroupName></GroupName>
<Files>
<File>
<FileName></FileName>
<FileType></FileType>
<FilePath></FilePath>
<FileOption>
<FileArmAds>
<Cads>
<VariousControls>
<MiscControls>--c99</MiscControls>
</VariousControls>
</Cads>
</FileArmAds>
</FileOption>
</File>
</Files>
</Group>
<GroupName>{{group}}</GroupName>
<Files>
{% for file in files %}
<File>
<FileType>{{file.type}}</FileType>
<FileName>{{file.name}}</FileName>
<FilePath>{{file.loc}}</FilePath>
</File>
{% endfor %}
</Files>
</Group>
{% endfor %}
</Groups>
</Target>
</Targets>

View File

@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<ProjectOpt xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="project_optx.xsd">
<SchemaVersion>1.0</SchemaVersion>
<Target>
<TargetName>{{name}}</TargetName>
<ToolsetNumber>0x4</ToolsetNumber>
<ToolsetName>ARM-ADS</ToolsetName>
<TargetOption>
<DebugOpt>
<uSim>0</uSim>
<uTrg>1</uTrg>
<nTsel>11</nTsel>
<pMon>{{device.debug_interface.bin_loc}}</pMon>
</DebugOpt>
<TargetDriverDllRegistry>
<SetRegEntry>
<Number>0</Number>
<Key>{{device.debug_interface.key}}</Key>
<Name>{{device.flash_dll}}</Name>
</SetRegEntry>
</TargetDriverDllRegistry>
</TargetOption>
</Target>
</ProjectOpt>

View File

@ -1,99 +0,0 @@
"""
mbed SDK
Copyright (c) 2011-2016 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
from os.path import basename, join, dirname
from project_generator_definitions.definitions import ProGenDef
from tools.export.exporters import Exporter, ExporterTargetsProperty
from tools.targets import TARGET_MAP, TARGET_NAMES
from tools.utils import remove_if_in
# If you wish to add a new target, add it to project_generator_definitions, and then
# define progen_target name in the target class (`` self.progen_target = 'my_target_name' ``)
# There are 2 default mbed templates (predefined settings) uvision.uvproj and uvproj_microlib.uvproj.tmpl
class Uvision4(Exporter):
"""
Exporter class for uvision. This class uses project generator.
"""
# These 2 are currently for exporters backward compatiblity
NAME = 'uvision'
TOOLCHAIN = 'ARM'
# PROGEN_ACTIVE contains information for exporter scripts that this is using progen
PROGEN_ACTIVE = True
MBED_CONFIG_HEADER_SUPPORTED = True
@ExporterTargetsProperty
def TARGETS(cls):
if not hasattr(cls, "_targets_supported"):
cls._targets_supported = []
progendef = ProGenDef('uvision')
for target in TARGET_NAMES:
try:
if (progendef.is_supported(str(TARGET_MAP[target])) or
progendef.is_supported(TARGET_MAP[target].progen['target'])):
cls._targets_supported.append(target)
except AttributeError:
# target is not supported yet
continue
return cls._targets_supported
def get_toolchain(self):
return TARGET_MAP[self.target].default_toolchain
def generate(self):
""" Generates the project files """
print "WARNING: exporting to uVision4 is deprecated and will be removed in a future version"
project_data = self.progen_get_project_data()
tool_specific = {}
# Expand tool specific settings by uvision specific settings which are required
try:
if TARGET_MAP[self.target].progen['uvision']['template']:
tool_specific['uvision'] = TARGET_MAP[self.target].progen['uvision']
except KeyError:
# use default template
# by the mbed projects
tool_specific['uvision'] = {
'template': [join(dirname(__file__), 'uvision.uvproj.tmpl')],
}
project_data['tool_specific'] = {}
project_data['tool_specific'].update(tool_specific)
# get flags from toolchain and apply
project_data['misc'] = {}
# need to make this a string for progen. Only adds preprocessor when "macros" set
asm_flag_string = '--cpreproc --cpreproc_opts=-D__ASSERT_MSG,' + ",".join(
list(set(self.flags['asm_flags'])))
# asm flags only, common are not valid within uvision project, they are armcc specific
project_data['misc']['asm_flags'] = [asm_flag_string]
# cxx flags included, as uvision have them all in one tab
project_data['misc']['c_flags'] = list(set(['-D__ASSERT_MSG']
+ self.flags['common_flags']
+ self.flags['c_flags']
+ self.flags['cxx_flags']))
# not compatible with c99 flag set in the template
remove_if_in(project_data['misc']['c_flags'], "--c99")
# cpp is not required as it's implicit for cpp files
remove_if_in(project_data['misc']['c_flags'], "--cpp")
# we want no-vla for only cxx, but it's also applied for C in IDE, thus we remove it
remove_if_in(project_data['misc']['c_flags'], "--no_vla")
project_data['misc']['ld_flags'] = self.flags['ld_flags']
project_data['build_dir'] = project_data['build_dir'] + '\\' + 'uvision4'
self.progen_gen_file(project_data)

View File

@ -1,97 +0,0 @@
"""
mbed SDK
Copyright (c) 2016 ARM Limited
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
"""
from os.path import basename, join, dirname
from project_generator_definitions.definitions import ProGenDef
from tools.export.exporters import Exporter, ExporterTargetsProperty
from tools.targets import TARGET_MAP, TARGET_NAMES
from tools.utils import remove_if_in
# If you wish to add a new target, add it to project_generator_definitions, and then
# define progen_target name in the target class (`` self.progen_target = 'my_target_name' ``)
# There are 2 default mbed templates (predefined settings) uvision.uvproj and uvproj_microlib.uvproj.tmpl
class Uvision5(Exporter):
"""
Exporter class for uvision5. This class uses project generator.
"""
# These 2 are currently for exporters backward compatiblity
NAME = 'uvision5'
TOOLCHAIN = 'ARM'
# PROGEN_ACTIVE contains information for exporter scripts that this is using progen
PROGEN_ACTIVE = True
MBED_CONFIG_HEADER_SUPPORTED = True
@ExporterTargetsProperty
def TARGETS(cls):
if not hasattr(cls, "_targets_supported"):
cls._targets_supported = []
progendef = ProGenDef('uvision5')
for target in TARGET_NAMES:
try:
if (progendef.is_supported(str(TARGET_MAP[target])) or
progendef.is_supported(TARGET_MAP[target].progen['target'])):
cls._targets_supported.append(target)
except AttributeError:
# target is not supported yet
continue
return cls._targets_supported
def get_toolchain(self):
return TARGET_MAP[self.target].default_toolchain
def generate(self):
""" Generates the project files """
project_data = self.progen_get_project_data()
tool_specific = {}
# Expand tool specific settings by uvision specific settings which are required
try:
if TARGET_MAP[self.target].progen['uvision5']['template']:
tool_specific['uvision5'] = TARGET_MAP[self.target].progen['uvision5']
except KeyError:
# use default template
# by the mbed projects
tool_specific['uvision5'] = {
'template': [join(dirname(__file__), 'uvision.uvproj.tmpl')],
}
#project_data['template'] = [tool_specific['uvision5']['template']]
project_data['tool_specific'] = {}
project_data['tool_specific'].update(tool_specific)
# get flags from toolchain and apply
project_data['misc'] = {}
asm_flag_string = '--cpreproc --cpreproc_opts=-D__ASSERT_MSG,' + ",".join(list(set(self.flags['asm_flags'])))
# asm flags only, common are not valid within uvision project, they are armcc specific
project_data['misc']['asm_flags'] = [asm_flag_string]
# cxx flags included, as uvision have them all in one tab
project_data['misc']['c_flags'] = list(set(['-D__ASSERT_MSG']
+ self.flags['common_flags']
+ self.flags['c_flags']
+ self.flags['cxx_flags']))
# not compatible with c99 flag set in the template
remove_if_in(project_data['misc']['c_flags'], "--c99")
# cpp is not required as it's implicit for cpp files
remove_if_in(project_data['misc']['c_flags'], "--cpp")
# we want no-vla for only cxx, but it's also applied for C in IDE, thus we remove it
remove_if_in(project_data['misc']['c_flags'], "--no_vla")
# not compatible with c99 flag set in the template
project_data['misc']['ld_flags'] = self.flags['ld_flags']
i = 0
project_data['build_dir'] = project_data['build_dir'] + '\\' + 'uvision5'
self.progen_gen_file(project_data)

View File

@ -86,6 +86,7 @@ def generate_project_files(resources, export_path, target, name, toolchain, ide,
exporter_cls, _ = get_exporter_toolchain(ide)
exporter = exporter_cls(target, export_path, name, toolchain,
extra_symbols=macros, resources=resources)
exporter.check_supported()
exporter.generate()
files = exporter.generated_files
return files, exporter

View File

@ -126,7 +126,7 @@ class ExportBuildTest(object):
test_case.ide,
test_case.name))
try:
exporter.progen_build()
exporter.build()
except FailedBuildException:
self.failures.append("%s::%s\t%s" % (test_case.mcu,
test_case.ide,
@ -187,6 +187,8 @@ def check_valid_mbed_os(test):
supported = columnate([t for t in all_os_tests.keys()])
raise ArgumentTypeError("Program with name '{0}' not found. "
"Supported tests are: \n{1}".format(test,supported))
def check_version(version):
"""Check if the specified version is valid
args:
@ -201,7 +203,7 @@ def check_version(version):
def main():
"""Entry point"""
ide_list = ["iar", "uvision", "uvision4"]
ide_list = ["iar", "uvision"]
default_v2 = [test_name_known("MBED_BLINKY")]
default_v5 = [check_valid_mbed_os('tests-mbedmicro-rtos-mbed-basic')]