diff --git a/workspace_tools/export/__init__.py b/workspace_tools/export/__init__.py
index 05ae0495630..226d841079e 100755
--- a/workspace_tools/export/__init__.py
+++ b/workspace_tools/export/__init__.py
@@ -19,7 +19,7 @@
from shutil import copytree, rmtree, copy
from workspace_tools.utils import mkdir
-from workspace_tools.export import uvision4, codesourcery, codered, gccarm, ds5_5, iar, emblocks, coide, kds, zip, simplicityv3, atmelstudio
+from workspace_tools.export import uvision4, codesourcery, codered, gccarm, ds5_5, iar, emblocks, coide, kds, zip, simplicityv3, atmelstudio, sw4stm32
from workspace_tools.export.exporters import zip_working_directory_and_clean_up, OldLibrariesException
from workspace_tools.targets import TARGET_NAMES, EXPORT_MAP, TARGET_MAP
@@ -37,6 +37,7 @@
'kds' : kds.KDS,
'simplicityv3' : simplicityv3.SimplicityV3,
'atmelstudio' : atmelstudio.AtmelStudio,
+ 'sw4stm32' : sw4stm32.Sw4STM32,
}
ERROR_MESSAGE_UNSUPPORTED_TOOLCHAIN = """
@@ -172,9 +173,9 @@ def mcu_ide_matrix(verbose_html=False, platform_filter=None):
for ide in supported_ides:
text = "-"
if target in EXPORTERS[ide].TARGETS:
- if verbose_html:
- text = "✓"
- else:
+ if verbose_html:
+ text = "✓"
+ else:
text = "x"
perm_counter += 1
row.append(text)
diff --git a/workspace_tools/export/sw4stm32.py b/workspace_tools/export/sw4stm32.py
new file mode 100644
index 00000000000..9ffc660f96c
--- /dev/null
+++ b/workspace_tools/export/sw4stm32.py
@@ -0,0 +1,92 @@
+"""
+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 exporters import Exporter
+from os.path import splitext, basename, join
+from random import randint
+from workspace_tools.utils import mkdir
+
+
+class Sw4STM32(Exporter):
+ NAME = 'Sw4STM32'
+ TOOLCHAIN = 'GCC_ARM'
+
+ BOARDS = {
+ # 'DISCO_F051R8': {'name': 'STM32F0DISCOVERY', 'mcuId': 'STM32F051R8Tx'},
+ # 'DISCO_F303VC': {'name': 'STM32F3DISCOVERY', 'mcuId': 'STM32F303VCTx'},
+ 'DISCO_F334C8': {'name': 'STM32F3348DISCOVERY', 'mcuId': 'STM32F334C8Tx'},
+ # 'DISCO_F401VC': {'name': 'STM32F401C-DISCO', 'mcuId': 'STM32F401VCTx'},
+ 'DISCO_F407VG': {'name': 'STM32F4DISCOVERY', 'mcuId': 'STM32F407VGTx'},
+ 'DISCO_F429ZI': {'name': 'STM32F429I-DISCO', 'mcuId': 'STM32F429ZITx'},
+ 'DISCO_F746NG': {'name': 'STM32F746G-DISCO', 'mcuId': 'STM32F746NGHx'},
+ 'DISCO_L053C8': {'name': 'STM32L0538DISCOVERY', 'mcuId': 'STM32L053C8Tx'},
+ 'DISCO_L476VG': {'name': 'STM32L476G-DISCO', 'mcuId': 'STM32L476VGTx'},
+ 'DISCO_F469NI': {'name': 'DISCO-F469NI', 'mcuId': 'STM32F469NIHx'},
+ 'NUCLEO_F030R8': {'name': 'NUCLEO-F030R8', 'mcuId': 'STM32F030R8Tx'},
+ 'NUCLEO_F070RB': {'name': 'NUCLEO-F070RB', 'mcuId': 'STM32F070RBTx'},
+ 'NUCLEO_F072RB': {'name': 'NUCLEO-F072RB', 'mcuId': 'STM32F072RBTx'},
+ 'NUCLEO_F091RC': {'name': 'NUCLEO-F091RC', 'mcuId': 'STM32F091RCTx'},
+ 'NUCLEO_F103RB': {'name': 'NUCLEO-F103RB', 'mcuId': 'STM32F103RBTx'},
+ 'NUCLEO_F302R8': {'name': 'NUCLEO-F302R8', 'mcuId': 'STM32F302R8Tx'},
+ 'NUCLEO_F303RE': {'name': 'NUCLEO-F303RE', 'mcuId': 'STM32F303RETx'},
+ 'NUCLEO_F334R8': {'name': 'NUCLEO-F334R8', 'mcuId': 'STM32F334R8Tx'},
+ 'NUCLEO_F401RE': {'name': 'NUCLEO-F401RE', 'mcuId': 'STM32F401RETx'},
+ 'NUCLEO_F411RE': {'name': 'NUCLEO-F411RE', 'mcuId': 'STM32F411RETx'},
+ 'NUCLEO_F446RE': {'name': 'NUCLEO-F446RE', 'mcuId': 'STM32F446RETx'},
+ 'NUCLEO_L053R8': {'name': 'NUCLEO-L053R8', 'mcuId': 'STM32L053R8Tx'},
+ 'NUCLEO_L152RE': {'name': 'NUCLEO-L152RE', 'mcuId': 'STM32L152RETx'},
+ 'NUCLEO_L476RG': {'name': 'NUCLEO-L476RG', 'mcuId': 'STM32L476RGTx'},
+ 'NUCLEO_F031K6': {'name': 'NUCLEO-F031K6', 'mcuId': 'STM32F031K6Tx'},
+ 'NUCLEO_F042K6': {'name': 'NUCLEO-F042K6', 'mcuId': 'STM32F042K6Tx'},
+ 'NUCLEO_F303K8': {'name': 'NUCLEO-F303K8', 'mcuId': 'STM32F303K8Tx'},
+ 'NUCLEO_F410RB': {'name': 'NUCLEO-F410RB', 'mcuId': 'STM32F410RBTx'},
+ }
+
+ TARGETS = BOARDS.keys()
+
+ def __gen_dir(self, dirname):
+ settings = join(self.inputDir, dirname)
+ mkdir(settings)
+
+ def __generate_uid(self):
+ return "%0.9u" % randint(0, 999999999)
+
+ def generate(self):
+ libraries = []
+ for lib in self.resources.libraries:
+ l, _ = splitext(basename(lib))
+ libraries.append(l[3:])
+
+ ctx = {
+ 'name': self.program_name,
+ 'include_paths': self.resources.inc_dirs,
+ 'linker_script': self.resources.linker_script,
+ 'symbols': self.get_symbols(),
+ 'board_name': self.BOARDS[self.target.upper()]['name'],
+ 'mcu_name': self.BOARDS[self.target.upper()]['mcuId'],
+ 'debug_config_uid': self.__generate_uid(),
+ 'debug_tool_compiler_uid': self.__generate_uid(),
+ 'debug_tool_compiler_input_uid': self.__generate_uid(),
+ 'release_config_uid': self.__generate_uid(),
+ 'release_tool_compiler_uid': self.__generate_uid(),
+ 'release_tool_compiler_input_uid': self.__generate_uid(),
+ 'uid': self.__generate_uid()
+ }
+
+ self.__gen_dir('.settings')
+ self.gen_file('sw4stm32_language_settings_commom.tmpl', ctx, '.settings/language.settings.xml')
+ self.gen_file('sw4stm32_project_common.tmpl', ctx, '.project')
+ self.gen_file('sw4stm32_cproject_common.tmpl', ctx, '.cproject')
diff --git a/workspace_tools/export/sw4stm32_cproject_common.tmpl b/workspace_tools/export/sw4stm32_cproject_common.tmpl
new file mode 100644
index 00000000000..95c45740825
--- /dev/null
+++ b/workspace_tools/export/sw4stm32_cproject_common.tmpl
@@ -0,0 +1,170 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/workspace_tools/export/sw4stm32_language_settings_commom.tmpl b/workspace_tools/export/sw4stm32_language_settings_commom.tmpl
new file mode 100644
index 00000000000..d138720fd22
--- /dev/null
+++ b/workspace_tools/export/sw4stm32_language_settings_commom.tmpl
@@ -0,0 +1,25 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/workspace_tools/export/sw4stm32_project_common.tmpl b/workspace_tools/export/sw4stm32_project_common.tmpl
new file mode 100644
index 00000000000..2e0378c223c
--- /dev/null
+++ b/workspace_tools/export/sw4stm32_project_common.tmpl
@@ -0,0 +1,28 @@
+
+
+ {{name}}
+
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.genmakebuilder
+ clean,full,incremental,
+
+
+
+
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder
+ full,incremental,
+
+
+
+
+
+ org.eclipse.cdt.core.cnature
+ org.eclipse.cdt.core.ccnature
+ org.eclipse.cdt.managedbuilder.core.managedBuildNature
+ org.eclipse.cdt.managedbuilder.core.ScannerConfigNature
+ fr.ac6.mcu.ide.core.MCUProjectNature
+
+
diff --git a/workspace_tools/export_test.py b/workspace_tools/export_test.py
index 020b94d422c..69b30fd95ca 100644
--- a/workspace_tools/export_test.py
+++ b/workspace_tools/export_test.py
@@ -78,7 +78,7 @@ def test_export(toolchain, target, expected_error=None):
for toolchain, target in [
('zip', 'LPC1768'),
-
+
('emblocks', 'LPC1768'),
('emblocks', 'LPC1549'),
('emblocks', 'LPC1114'),
@@ -266,6 +266,40 @@ def test_export(toolchain, target, expected_error=None):
('iar', 'MAX32600MBED'),
('iar', 'MOTE_L152RC'),
+ # ('sw4stm32', 'DISCO_F051R8'),
+ # ('sw4stm32', 'DISCO_F100RB'),
+ ('sw4stm32', 'DISCO_F303VC'),
+ ('sw4stm32', 'DISCO_F334C8'),
+ # ('sw4stm32', 'DISCO_F401VC'),
+ ('sw4stm32', 'DISCO_F407VG'),
+ ('sw4stm32', 'DISCO_F429ZI'),
+ ('sw4stm32', 'DISCO_F469NI'),
+ ('sw4stm32', 'DISCO_F746NG'),
+ ('sw4stm32', 'DISCO_L053C8'),
+ ('sw4stm32', 'DISCO_L476VG'),
+ ('sw4stm32', 'NUCLEO_F030R8'),
+ ('sw4stm32', 'NUCLEO_F031K6'),
+ ('sw4stm32', 'NUCLEO_F042K6'),
+ ('sw4stm32', 'NUCLEO_F070RB'),
+ ('sw4stm32', 'NUCLEO_F072RB'),
+ ('sw4stm32', 'NUCLEO_F091RC'),
+ ('sw4stm32', 'NUCLEO_F103RB'),
+ ('sw4stm32', 'NUCLEO_F302R8'),
+ ('sw4stm32', 'NUCLEO_F303K8'),
+ ('sw4stm32', 'NUCLEO_F303RE'),
+ ('sw4stm32', 'NUCLEO_F334R8'),
+ ('sw4stm32', 'NUCLEO_F401RE'),
+ ('sw4stm32', 'NUCLEO_F410RB'),
+ ('sw4stm32', 'NUCLEO_F411RE'),
+ ('sw4stm32', 'NUCLEO_F446RE'),
+ ('sw4stm32', 'NUCLEO_L053R8'),
+ ('sw4stm32', 'NUCLEO_L073RZ'),
+ ('sw4stm32', 'NUCLEO_L152RE'),
+ ('sw4stm32', 'NUCLEO_L476RG'),
+ ('sw4stm32', 'NUCLEO_F031K6'),
+ ('sw4stm32', 'NUCLEO_F042K6'),
+ ('sw4stm32', 'NUCLEO_F303K8'),
+ ('sw4stm32', 'NUCLEO_F410RB'),
# Removed following item to avoid script error
#(None, None),
]: