Skip to content

[Silicon Labs] Update exporter for Simplicity Studio #1100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 12, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ Nordic:
Renesas:
* [RZ-A1H](http://developer.mbed.org/platforms/Renesas-GR-PEACH/) (Cortex-A9)

Silicon Labs:
* [EFM32 Zero Gecko] (https://developer.mbed.org/platforms/EFM32-Zero-Gecko/) (Cortex-M0+)
* [EFM32 Happy Gecko] (https://developer.mbed.org/platforms/EFM32-Happy-Gecko/) (Cortex-M0+)
* [EFM32 Leopard Gecko] (https://developer.mbed.org/platforms/EFM32-Leopard-Gecko/) (Cortex-M3)
* [EFM32 Giant Gecko] (https://developer.mbed.org/platforms/EFM32-Giant-Gecko/) (Cortex-M3)
* [EFM32 Wonder Gecko] (https://developer.mbed.org/platforms/EFM32-Wonder-Gecko/) (Cortex-M4)


Supported Toolchains and IDEs
-----------------------------
Expand Down
23 changes: 21 additions & 2 deletions workspace_tools/export/simplicityv3.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class SimplicityV3(Exporter):
'EFM32ZG_STK3200': 'com.silabs.kit.si32.efm32.efm32zg.stk3200',
'EFM32LG_STK3600': 'com.silabs.kit.si32.efm32.efm32lg.stk3600',
'EFM32WG_STK3800': 'com.silabs.kit.si32.efm32.efm32wg.stk3800',
'EFM32HG_STK3400': 'com.silabs.kit.si32.efm32.efm32hg.stk3400'
'EFM32HG_STK3400': 'com.silabs.kit.si32.efm32.efm32hg.slstk3400a'
}

FILE_TYPES = {
Expand All @@ -87,6 +87,15 @@ class SimplicityV3(Exporter):
's_sources':'1'
}

EXCLUDED_LIBS = [
'm',
'c',
'gcc',
'nosys',
'supc++',
'stdc++'
]

DOT_IN_RELATIVE_PATH = False

orderedPaths = Folder("Root")
Expand All @@ -108,6 +117,15 @@ def generate(self):

main_files = []

EXCLUDED_LIBS = [
'm',
'c',
'gcc',
'nosys',
'supc++',
'stdc++'
]

for r_type in ['s_sources', 'c_sources', 'cpp_sources']:
r = getattr(self.resources, r_type)
if r:
Expand All @@ -120,7 +138,8 @@ def generate(self):
libraries = []
for lib in self.resources.libraries:
l, _ = splitext(basename(lib))
libraries.append(l[3:])
if l[3:] not in EXCLUDED_LIBS:
libraries.append(l[3:])

defines = []
for define in self.get_symbols():
Expand Down
26 changes: 25 additions & 1 deletion workspace_tools/export/simplicityv3_slsproj.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<project xmlns:model="http://www.silabs.com/sls/IDE.ecore" name="{{ name }}" kitCompatibility="{{ kit }}"
partCompatibility="{{ part }}"
toolchainCompatibility="com.silabs.ide.si32.gcc:4.8.3.20131129"
sdkCompatibility="com.silabs.sdk.si32.efm32.sls:2.0.5"
sdkCompatibility="com.silabs.sdk.si32.efm32"
propertyScope="project"
contentRoot=".">
{# Hierarchically include all folders into the project #}
Expand Down Expand Up @@ -55,6 +55,18 @@
${workspace_loc:/${ProjName}/{{ file }}}{% if not loop.last %} {% endif %}
{%- endfor -%}"/>
{%- endif %}
{# Manually override linker ordering #}
{%- if libraries %}
<toolOption toolId="com.silabs.ide.si32.gcc.cdt.managedbuild.tool.gnu.cpp.linker.base" optionId="com.silabs.ide.si32.gcc.cdt.managedbuild.tool.gnu.cpp.linker.category.ordering.selection" value="
{%- if object_files -%}
{%- for file in object_files -%}
${workspace_loc:/${ProjName}/{{ file }}};
{%- endfor -%}
{%- endif -%}
{%- for library in libraries -%}
${-l{{ library }}}{% if not loop.last %};{% endif %}
{%- endfor -%}"/>
{%- endif %}
{# Define mbed-specific linker file #}
<toolOption toolId="com.silabs.ide.si32.gcc.cdt.managedbuild.toolchain.exe" optionId="com.silabs.ide.si32.gcc.cdt.managedbuild.tool.gnu.c.linker.usescript" value="true"/>
<toolOption toolId="com.silabs.ide.si32.gcc.cdt.managedbuild.toolchain.exe" optionId="com.silabs.ide.si32.gcc.cdt.managedbuild.tool.gnu.c.linker.script" value="${workspace_loc:/${ProjName}/{{ linker_script }}}"/>
Expand Down Expand Up @@ -100,6 +112,18 @@
${workspace_loc:/${ProjName}/{{ file }}}{% if not loop.last %} {% endif %}
{%- endfor -%}"/>
{%- endif %}
{# Manually override linker ordering #}
{%- if libraries %}
<toolOption toolId="com.silabs.ide.si32.gcc.cdt.managedbuild.tool.gnu.cpp.linker.base" optionId="com.silabs.ide.si32.gcc.cdt.managedbuild.tool.gnu.cpp.linker.category.ordering.selection" value="
{%- if object_files -%}
{%- for file in object_files -%}
${workspace_loc:/${ProjName}/{{ file }}};
{%- endfor -%}
{%- endif -%}
{%- for library in libraries -%}{% if not loop.last %};{% endif %}
${-l{{ library }}}
{%- endfor -%}"/>
{%- endif %}
{# Define mbed-specific linker file #}
<toolOption toolId="com.silabs.ide.si32.gcc.cdt.managedbuild.toolchain.exe" optionId="com.silabs.ide.si32.gcc.cdt.managedbuild.tool.gnu.c.linker.usescript" value="true"/>
<toolOption toolId="com.silabs.ide.si32.gcc.cdt.managedbuild.toolchain.exe" optionId="com.silabs.ide.si32.gcc.cdt.managedbuild.tool.gnu.c.linker.script" value="${workspace_loc:/${ProjName}/{{ linker_script }}}"/>
Expand Down