Target + Exporters - progen data expansion by template for tools

Each target can specify own template. This is however not recommended for general use.
Each target should be supported by progendef, and well definied. However, as tools are
quickly changing, some targets add extra information which might not be supported, this
template expansion allows a target to temporary override default mbed tool template.

In this commit, we add RZ_A1H iar template. I experienced with never tools some breakage in
the templates, this might come handy, but repeat, please consider using the default template, and
contribute to progen or progendef which should contain fixes or support for newer targets/tools.
pull/1563/head
0xc0170 2016-02-25 14:02:08 +00:00
parent 6076b3a49b
commit 5f2541c8aa
2 changed files with 20 additions and 11 deletions

View File

@ -47,19 +47,24 @@ class IAREmbeddedWorkbench(Exporter):
def generate(self):
""" Generates the project files """
project_data = self.progen_get_project_data()
tool_specific = {}
# Expand tool specific settings by IAR specific settings which are required
# by the mbed projects
tool_specific = {
'iar': {
# We currently don't use misc, template sets those for us
# 'misc': {
# 'cxx_flags': ['--no_rtti', '--no_exceptions'],
# 'c_flags': ['--diag_suppress=Pa050,Pa084,Pa093,Pa082'],
# 'ld_flags': ['--skip_dynamic_initialization'],
# },
'template': [os.path.join(os.path.dirname(__file__), 'iar_template.ewp.tmpl')],
try:
if TARGET_MAP[self.target].progen['iar']['template']:
tool_specific['iar'] = TARGET_MAP[self.target].progen['iar']
except KeyError:
# use default template
# by the mbed projects
tool_specific['iar'] = {
# We currently don't use misc, template sets those for us
# 'misc': {
# 'cxx_flags': ['--no_rtti', '--no_exceptions'],
# 'c_flags': ['--diag_suppress=Pa050,Pa084,Pa093,Pa082'],
# 'ld_flags': ['--skip_dynamic_initialization'],
# },
'template': [os.path.join(os.path.dirname(__file__), 'iar_template.ewp.tmpl')],
}
}
project_data['tool_specific'] = {}
project_data['tool_specific'].update(tool_specific)
self.progen_gen_file('iar_arm', project_data)

View File

@ -1762,6 +1762,10 @@ class RZ_A1H(Target):
self.default_toolchain = "ARM"
self.progen = {
"target": "gr-peach",
"iar": {
# rewrite generic template, this device needs futher support for FPU in progendef
"template": [os.path.join(os.path.dirname(__file__), 'export', 'iar_rz_a1h.ewp.tmpl')],
}
}
def program_cycle_s(self):