From 06ca004bfa80edf63ecf29862a97143b3a45d9d9 Mon Sep 17 00:00:00 2001 From: Russ Butler Date: Thu, 12 Jan 2017 11:25:09 -0600 Subject: [PATCH 01/45] Fix invalid assert in exporters Assert that the length is greater than one rather than the value itself. This bug was introduced in the commit: 329be06ad02b82e045c1aadc799f88005276400a - "exporters - group by directories in prj root" --- tools/export/exporters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/export/exporters.py b/tools/export/exporters.py index 25bec756bf..783fbf2d68 100644 --- a/tools/export/exporters.py +++ b/tools/export/exporters.py @@ -132,7 +132,7 @@ class Exporter(object): """ rel_path = relpath(src, self.resources.file_basepath[src]) path_list = os.path.normpath(rel_path).split(os.sep) - assert path_list >= 1 + assert len(path_list) >= 1 if len(path_list) == 1: key = self.project_name else: From f2663876fc3ab0e5a65141d44ce8554ad681e828 Mon Sep 17 00:00:00 2001 From: Jimmy Brisson Date: Thu, 12 Jan 2017 15:05:27 -0600 Subject: [PATCH 02/45] Inherit names from target parents --- tools/targets.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/targets.py b/tools/targets.py index a795958f5a..84ae222b1c 100644 --- a/tools/targets.py +++ b/tools/targets.py @@ -21,6 +21,7 @@ import struct import shutil import inspect import sys +from copy import copy from collections import namedtuple from tools.patch import patch from tools.paths import TOOLS_BOOTLOADERS @@ -276,7 +277,10 @@ class Target(namedtuple("Target", "name json_data resolution_order resolution_or @property def labels(self): """Get all possible labels for this target""" - labels = [self.name] + CORE_LABELS[self.core] + self.extra_labels + names = copy(self.resolution_order_names) + if "Target" in names: + names.remove("Target") + labels = (names + CORE_LABELS[self.core] + self.extra_labels) # Automatically define UVISOR_UNSUPPORTED if the target doesn't # specifically define UVISOR_SUPPORTED if "UVISOR_SUPPORTED" not in labels: From b150ca4ecd855422e4bde9dba8457c4c9a058fd1 Mon Sep 17 00:00:00 2001 From: Irit Arkin Date: Fri, 13 Jan 2017 16:26:21 +0000 Subject: [PATCH 03/45] Linking to latest --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0d44946ce6..f9a9808bd4 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ The current release, along with a selection of previous versions are detailed he We have a getting started guide for developers using mbed OS in applications: -- [Getting Started](https://docs.mbed.com/docs/mbed-os-handbook/en/5.2/) +- [Getting Started](https://docs.mbed.com/docs/mbed-os-handbook/en/latest/) ## Getting Started for Contributors From 7a8964af6fe55c7956883280381a5ab1b8115ade Mon Sep 17 00:00:00 2001 From: Russ Butler Date: Fri, 13 Jan 2017 11:54:27 -0600 Subject: [PATCH 04/45] arm-pack-manager - fix tracebacks Fix tracebacks from trying to read dictionary values that don't exist and from incorrect variable names. --- tools/arm_pack_manager/__init__.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/arm_pack_manager/__init__.py b/tools/arm_pack_manager/__init__.py index b2ca051e07..771fb48fb9 100644 --- a/tools/arm_pack_manager/__init__.py +++ b/tools/arm_pack_manager/__init__.py @@ -251,8 +251,9 @@ class Cache () : :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']) + device = self.index[device_name] + pack = self.pack_from_cache(device) + return pack.open(device['algorithm'].keys()[0]) def get_svd_file(self, device_name) : """Retrieve the flash algorithm file for a particular part. @@ -264,7 +265,8 @@ class Cache () : :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]) + device = self.index[device_name] + pack = self.pack_from_cache(device) return pack.open(device['debug']) def generate_index(self) : @@ -407,7 +409,7 @@ class Cache () : with open(dest, "r") as fd : return BeautifulSoup(fd, "html.parser") - def pack_from_cache(self, url) : + def pack_from_cache(self, device) : """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. From 39a5caacabff9e85c3152f7543c3bd03c1cd9250 Mon Sep 17 00:00:00 2001 From: Jimmy Brisson Date: Wed, 4 Jan 2017 15:51:53 -0600 Subject: [PATCH 05/45] Refactor scan resources to account for base_paths --- tools/toolchains/__init__.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tools/toolchains/__init__.py b/tools/toolchains/__init__.py index 6a15fc6cee..58520b9860 100644 --- a/tools/toolchains/__init__.py +++ b/tools/toolchains/__init__.py @@ -512,6 +512,13 @@ class mbedToolchain: return True return False + def add_ignore_patterns(self, root, base_path, patterns): + real_base = relpath(root, base_path) + if real_base == ".": + self.ignore_patterns.extend(patterns) + else: + self.ignore_patterns.extend(join(real_base, pat) for pat in patterns) + # Create a Resources object from the path pointed to by *path* by either traversing a # a directory structure, when *path* is a directory, or adding *path* to the resources, # when *path* is a file. @@ -559,10 +566,11 @@ class mbedToolchain: lines = [l for l in lines if l != ""] # Strip empty lines lines = [l for l in lines if not re.match("^#",l)] # Strip comment lines # Append root path to glob patterns and append patterns to ignore_patterns - self.ignore_patterns.extend([join(root,line.strip()) for line in lines]) + self.add_ignore_patterns(root, base_path, lines) # Skip the whole folder if ignored, e.g. .mbedignore containing '*' - if self.is_ignored(join(root,"")): + if self.is_ignored(join(relpath(root, base_path),"")): + dirs[:] = [] continue for d in copy(dirs): @@ -577,7 +585,7 @@ class mbedToolchain: # Ignore toolchain that do not match the current TOOLCHAIN (d.startswith('TOOLCHAIN_') and d[10:] not in labels['TOOLCHAIN']) or # Ignore .mbedignore files - self.is_ignored(join(dir_path,"")) or + self.is_ignored(join(relpath(root, base_path), d,"")) or # Ignore TESTS dir (d == 'TESTS')): dirs.remove(d) @@ -606,7 +614,7 @@ class mbedToolchain: def _add_file(self, file_path, resources, base_path, exclude_paths=None): resources.file_basepath[file_path] = base_path - if self.is_ignored(file_path): + if self.is_ignored(relpath(file_path, base_path)): return _, ext = splitext(file_path) From c14a5b94ec3dc7cf10038d4eaaae5bb9ed23d7b7 Mon Sep 17 00:00:00 2001 From: Jimmy Brisson Date: Tue, 10 Jan 2017 14:36:15 -0600 Subject: [PATCH 06/45] Add docstrings --- tools/toolchains/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/toolchains/__init__.py b/tools/toolchains/__init__.py index 58520b9860..eb9bbd33fa 100644 --- a/tools/toolchains/__init__.py +++ b/tools/toolchains/__init__.py @@ -507,12 +507,20 @@ class mbedToolchain: return False def is_ignored(self, file_path): + """Check if file path is ignored by any .mbedignore thus far""" for pattern in self.ignore_patterns: if fnmatch.fnmatch(file_path, pattern): return True return False def add_ignore_patterns(self, root, base_path, patterns): + """Add a series of patterns to the ignored paths + + Positional arguments: + root - the directory containing the ignore file + base_path - the location that the scan started from + patterns - the list of patterns we will ignore in the future + """ real_base = relpath(root, base_path) if real_base == ".": self.ignore_patterns.extend(patterns) From 5ccd0153eec3ad7cba0a2e2a25cdf542724b4ccc Mon Sep 17 00:00:00 2001 From: Jimmy Brisson Date: Fri, 13 Jan 2017 12:14:20 -0600 Subject: [PATCH 07/45] Correct revision compares --- tools/arm_pack_manager/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/arm_pack_manager/__init__.py b/tools/arm_pack_manager/__init__.py index 771fb48fb9..6cd66399f0 100644 --- a/tools/arm_pack_manager/__init__.py +++ b/tools/arm_pack_manager/__init__.py @@ -26,7 +26,8 @@ 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] + return sorted([t['version'] for t in content.package.releases('release')], + reverse=True, key=lambda v: map(int, v.split(".")))[0] def do_queue(Class, function, interable) : q = Queue() From 938ac93496c2e7ae9563982dc95ac76bb7142366 Mon Sep 17 00:00:00 2001 From: Brian Daniels Date: Fri, 13 Jan 2017 11:41:44 -0600 Subject: [PATCH 08/45] Fixing toolchain executable not found error for build.py Commit 19d56fd40fc3130b970e03fd530ab340d4a65465 removed the default file paths for the toolchains. This was done under the assumption that the top-level compile scripts were properly checking that the toolchain executable was availble. The build.py script was doing this in the wrong place. This commit rearranges the script a bit so the check is performed properly. --- tools/build.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/tools/build.py b/tools/build.py index 2749776a08..68c2d08962 100644 --- a/tools/build.py +++ b/tools/build.py @@ -211,15 +211,17 @@ if __name__ == '__main__': successes = [] skipped = [] - # CPPCHECK code validation - if options.cppcheck_validation: - for toolchain in toolchains: - if not TOOLCHAIN_CLASSES[toolchain].check_executable(): - search_path = TOOLCHAIN_PATHS[toolchain] or "No path set" - args_error(parser, "Could not find executable for %s.\n" - "Currently set search path: %s" - % (toolchain, search_path)) - for target in targets: + for toolchain in toolchains: + if not TOOLCHAIN_CLASSES[toolchain].check_executable(): + search_path = TOOLCHAIN_PATHS[toolchain] or "No path set" + args_error(parser, "Could not find executable for %s.\n" + "Currently set search path: %s" + % (toolchain, search_path)) + + for toolchain in toolchains: + for target in targets: + # CPPCHECK code validation + if options.cppcheck_validation: try: mcu = TARGET_MAP[target] # CMSIS and MBED libs analysis @@ -244,10 +246,8 @@ if __name__ == '__main__': traceback.print_exc(file=sys.stdout) sys.exit(1) print e - else: - # Build - for toolchain in toolchains: - for target in targets: + else: + # Build tt_id = "%s::%s" % (toolchain, target) if toolchain not in TARGET_MAP[target].supported_toolchains: # Log this later @@ -299,6 +299,7 @@ if __name__ == '__main__': failures.append(tt_id) print e + # Write summary of the builds print print "Completed in: (%.2f)s" % (time() - start) From bdd0ff42728ba345c5bc2cf0f217facd004642be Mon Sep 17 00:00:00 2001 From: Brian Daniels Date: Mon, 9 Jan 2017 14:24:14 -0600 Subject: [PATCH 09/45] Reduce thread stack size for parallel network tests This commit reduces the thread stack from 2k to 1k for each thread in the parallel network tests. This allows the test to run on more constrained devices (like the LPC1768). --- .../TESTS/mbedmicro-net/tcp_echo_parallel/main.cpp | 4 ++++ .../TESTS/mbedmicro-net/udp_echo_parallel/main.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/features/FEATURE_LWIP/TESTS/mbedmicro-net/tcp_echo_parallel/main.cpp b/features/FEATURE_LWIP/TESTS/mbedmicro-net/tcp_echo_parallel/main.cpp index a7121cb673..14bdcea016 100644 --- a/features/FEATURE_LWIP/TESTS/mbedmicro-net/tcp_echo_parallel/main.cpp +++ b/features/FEATURE_LWIP/TESTS/mbedmicro-net/tcp_echo_parallel/main.cpp @@ -42,6 +42,10 @@ private: Thread thread; public: + // Limiting stack size to 1k + Echo(): thread(osPriorityNormal, 1024) { + } + void start() { osStatus status = thread.start(callback(this, &Echo::echo)); TEST_ASSERT_EQUAL(osOK, status); diff --git a/features/FEATURE_LWIP/TESTS/mbedmicro-net/udp_echo_parallel/main.cpp b/features/FEATURE_LWIP/TESTS/mbedmicro-net/udp_echo_parallel/main.cpp index 61327f6e57..b043defaa6 100644 --- a/features/FEATURE_LWIP/TESTS/mbedmicro-net/udp_echo_parallel/main.cpp +++ b/features/FEATURE_LWIP/TESTS/mbedmicro-net/udp_echo_parallel/main.cpp @@ -46,6 +46,10 @@ private: Thread thread; public: + // Limiting stack size to 1k + Echo(): thread(osPriorityNormal, 1024) { + } + void start() { osStatus status = thread.start(callback(this, &Echo::echo)); TEST_ASSERT_EQUAL(osOK, status); From 81df273849541466cbae32ce1d39c0639bb64a26 Mon Sep 17 00:00:00 2001 From: Jimmy Brisson Date: Tue, 17 Jan 2017 11:51:11 -0600 Subject: [PATCH 10/45] Move sys_libs into mbedToolchain class --- tools/toolchains/__init__.py | 3 +++ tools/toolchains/arm.py | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/toolchains/__init__.py b/tools/toolchains/__init__.py index 6a15fc6cee..b8e97fb604 100644 --- a/tools/toolchains/__init__.py +++ b/tools/toolchains/__init__.py @@ -266,6 +266,9 @@ class mbedToolchain: # Toolchain flags self.flags = deepcopy(build_profile or self.profile_template) + # System libraries provided by the toolchain + self.sys_libs = [] + # User-defined macros self.macros = macros or [] diff --git a/tools/toolchains/arm.py b/tools/toolchains/arm.py index 135e8b09b3..b365d0b0f9 100644 --- a/tools/toolchains/arm.py +++ b/tools/toolchains/arm.py @@ -66,7 +66,6 @@ class ARM(mbedToolchain): self.cppc = [main_cc] + self.flags['common'] + self.flags['c'] + self.flags['cxx'] self.ld = [join(ARM_BIN, "armlink")] - self.sys_libs = [] self.ar = join(ARM_BIN, "armar") self.elf2bin = join(ARM_BIN, "fromelf") From 17f691c54fbc52e8943488e5eb9caee645f0e4e6 Mon Sep 17 00:00:00 2001 From: Jimmy Brisson Date: Tue, 17 Jan 2017 12:07:28 -0600 Subject: [PATCH 11/45] Move codered to its own directory --- tools/export/{codered.py => codered/__init__.py} | 6 +++--- .../arch_pro_cproject.tmpl} | 0 .../arch_pro_project.tmpl} | 0 .../cproject_common.tmpl} | 0 .../cproject_cortexm0_common.tmpl} | 0 .../cproject_cortexm3_common.tmpl} | 0 .../lpc1114_cproject.tmpl} | 0 .../lpc1114_project.tmpl} | 0 .../lpc11u35_401_cproject.tmpl} | 0 .../lpc11u35_401_project.tmpl} | 0 .../lpc11u35_501_cproject.tmpl} | 0 .../lpc11u35_501_project.tmpl} | 0 .../lpc11u37h_401_cproject.tmpl} | 0 .../lpc11u37h_401_project.tmpl} | 0 .../lpc11u68_cproject.tmpl} | 0 .../lpc11u68_project.tmpl} | 0 .../lpc1549_cproject.tmpl} | 0 .../lpc1549_project.tmpl} | 0 .../lpc1768_cproject.tmpl} | 0 .../lpc1768_project.tmpl} | 0 .../lpc4088_cproject.tmpl} | 0 .../lpc4088_dm_cproject.tmpl} | 0 .../lpc4088_dm_project.tmpl} | 0 .../lpc4088_project.tmpl} | 0 .../lpc4330_m4_cproject.tmpl} | 0 .../lpc4330_m4_project.tmpl} | 0 .../lpc824_cproject.tmpl} | 0 .../lpc824_project.tmpl} | 0 .../lpccappuccino_cproject.tmpl} | 0 .../lpccappuccino_project.tmpl} | 0 .../project_common.tmpl} | 0 .../ublox_c027_cproject.tmpl} | 0 .../ublox_c027_project.tmpl} | 0 33 files changed, 3 insertions(+), 3 deletions(-) rename tools/export/{codered.py => codered/__init__.py} (90%) rename tools/export/{codered_arch_pro_cproject.tmpl => codered/arch_pro_cproject.tmpl} (100%) rename tools/export/{codered_arch_pro_project.tmpl => codered/arch_pro_project.tmpl} (100%) rename tools/export/{codered_cproject_common.tmpl => codered/cproject_common.tmpl} (100%) rename tools/export/{codered_cproject_cortexm0_common.tmpl => codered/cproject_cortexm0_common.tmpl} (100%) rename tools/export/{codered_cproject_cortexm3_common.tmpl => codered/cproject_cortexm3_common.tmpl} (100%) rename tools/export/{codered_lpc1114_cproject.tmpl => codered/lpc1114_cproject.tmpl} (100%) rename tools/export/{codered_lpc1114_project.tmpl => codered/lpc1114_project.tmpl} (100%) rename tools/export/{codered_lpc11u35_401_cproject.tmpl => codered/lpc11u35_401_cproject.tmpl} (100%) rename tools/export/{codered_lpc11u35_401_project.tmpl => codered/lpc11u35_401_project.tmpl} (100%) rename tools/export/{codered_lpc11u35_501_cproject.tmpl => codered/lpc11u35_501_cproject.tmpl} (100%) rename tools/export/{codered_lpc11u35_501_project.tmpl => codered/lpc11u35_501_project.tmpl} (100%) rename tools/export/{codered_lpc11u37h_401_cproject.tmpl => codered/lpc11u37h_401_cproject.tmpl} (100%) rename tools/export/{codered_lpc11u37h_401_project.tmpl => codered/lpc11u37h_401_project.tmpl} (100%) rename tools/export/{codered_lpc11u68_cproject.tmpl => codered/lpc11u68_cproject.tmpl} (100%) rename tools/export/{codered_lpc11u68_project.tmpl => codered/lpc11u68_project.tmpl} (100%) rename tools/export/{codered_lpc1549_cproject.tmpl => codered/lpc1549_cproject.tmpl} (100%) rename tools/export/{codered_lpc1549_project.tmpl => codered/lpc1549_project.tmpl} (100%) rename tools/export/{codered_lpc1768_cproject.tmpl => codered/lpc1768_cproject.tmpl} (100%) rename tools/export/{codered_lpc1768_project.tmpl => codered/lpc1768_project.tmpl} (100%) rename tools/export/{codered_lpc4088_cproject.tmpl => codered/lpc4088_cproject.tmpl} (100%) rename tools/export/{codered_lpc4088_dm_cproject.tmpl => codered/lpc4088_dm_cproject.tmpl} (100%) rename tools/export/{codered_lpc4088_dm_project.tmpl => codered/lpc4088_dm_project.tmpl} (100%) rename tools/export/{codered_lpc4088_project.tmpl => codered/lpc4088_project.tmpl} (100%) rename tools/export/{codered_lpc4330_m4_cproject.tmpl => codered/lpc4330_m4_cproject.tmpl} (100%) rename tools/export/{codered_lpc4330_m4_project.tmpl => codered/lpc4330_m4_project.tmpl} (100%) rename tools/export/{codered_lpc824_cproject.tmpl => codered/lpc824_cproject.tmpl} (100%) rename tools/export/{codered_lpc824_project.tmpl => codered/lpc824_project.tmpl} (100%) rename tools/export/{codered_lpccappuccino_cproject.tmpl => codered/lpccappuccino_cproject.tmpl} (100%) rename tools/export/{codered_lpccappuccino_project.tmpl => codered/lpccappuccino_project.tmpl} (100%) rename tools/export/{codered_project_common.tmpl => codered/project_common.tmpl} (100%) rename tools/export/{codered_ublox_c027_cproject.tmpl => codered/ublox_c027_cproject.tmpl} (100%) rename tools/export/{codered_ublox_c027_project.tmpl => codered/ublox_c027_project.tmpl} (100%) diff --git a/tools/export/codered.py b/tools/export/codered/__init__.py similarity index 90% rename from tools/export/codered.py rename to tools/export/codered/__init__.py index 185e69a60d..325191553b 100644 --- a/tools/export/codered.py +++ b/tools/export/codered/__init__.py @@ -14,9 +14,9 @@ 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 +from tools.export.exporters import Exporter class CodeRed(Exporter): NAME = 'CodeRed' @@ -56,5 +56,5 @@ class CodeRed(Exporter): 'symbols': self.toolchain.get_symbols() } ctx.update(self.flags) - self.gen_file('codered_%s_project.tmpl' % self.target.lower(), ctx, '.project') - self.gen_file('codered_%s_cproject.tmpl' % self.target.lower(), ctx, '.cproject') + self.gen_file('codered/%s_project.tmpl' % self.target.lower(), ctx, '.project') + self.gen_file('codered/%s_cproject.tmpl' % self.target.lower(), ctx, '.cproject') diff --git a/tools/export/codered_arch_pro_cproject.tmpl b/tools/export/codered/arch_pro_cproject.tmpl similarity index 100% rename from tools/export/codered_arch_pro_cproject.tmpl rename to tools/export/codered/arch_pro_cproject.tmpl diff --git a/tools/export/codered_arch_pro_project.tmpl b/tools/export/codered/arch_pro_project.tmpl similarity index 100% rename from tools/export/codered_arch_pro_project.tmpl rename to tools/export/codered/arch_pro_project.tmpl diff --git a/tools/export/codered_cproject_common.tmpl b/tools/export/codered/cproject_common.tmpl similarity index 100% rename from tools/export/codered_cproject_common.tmpl rename to tools/export/codered/cproject_common.tmpl diff --git a/tools/export/codered_cproject_cortexm0_common.tmpl b/tools/export/codered/cproject_cortexm0_common.tmpl similarity index 100% rename from tools/export/codered_cproject_cortexm0_common.tmpl rename to tools/export/codered/cproject_cortexm0_common.tmpl diff --git a/tools/export/codered_cproject_cortexm3_common.tmpl b/tools/export/codered/cproject_cortexm3_common.tmpl similarity index 100% rename from tools/export/codered_cproject_cortexm3_common.tmpl rename to tools/export/codered/cproject_cortexm3_common.tmpl diff --git a/tools/export/codered_lpc1114_cproject.tmpl b/tools/export/codered/lpc1114_cproject.tmpl similarity index 100% rename from tools/export/codered_lpc1114_cproject.tmpl rename to tools/export/codered/lpc1114_cproject.tmpl diff --git a/tools/export/codered_lpc1114_project.tmpl b/tools/export/codered/lpc1114_project.tmpl similarity index 100% rename from tools/export/codered_lpc1114_project.tmpl rename to tools/export/codered/lpc1114_project.tmpl diff --git a/tools/export/codered_lpc11u35_401_cproject.tmpl b/tools/export/codered/lpc11u35_401_cproject.tmpl similarity index 100% rename from tools/export/codered_lpc11u35_401_cproject.tmpl rename to tools/export/codered/lpc11u35_401_cproject.tmpl diff --git a/tools/export/codered_lpc11u35_401_project.tmpl b/tools/export/codered/lpc11u35_401_project.tmpl similarity index 100% rename from tools/export/codered_lpc11u35_401_project.tmpl rename to tools/export/codered/lpc11u35_401_project.tmpl diff --git a/tools/export/codered_lpc11u35_501_cproject.tmpl b/tools/export/codered/lpc11u35_501_cproject.tmpl similarity index 100% rename from tools/export/codered_lpc11u35_501_cproject.tmpl rename to tools/export/codered/lpc11u35_501_cproject.tmpl diff --git a/tools/export/codered_lpc11u35_501_project.tmpl b/tools/export/codered/lpc11u35_501_project.tmpl similarity index 100% rename from tools/export/codered_lpc11u35_501_project.tmpl rename to tools/export/codered/lpc11u35_501_project.tmpl diff --git a/tools/export/codered_lpc11u37h_401_cproject.tmpl b/tools/export/codered/lpc11u37h_401_cproject.tmpl similarity index 100% rename from tools/export/codered_lpc11u37h_401_cproject.tmpl rename to tools/export/codered/lpc11u37h_401_cproject.tmpl diff --git a/tools/export/codered_lpc11u37h_401_project.tmpl b/tools/export/codered/lpc11u37h_401_project.tmpl similarity index 100% rename from tools/export/codered_lpc11u37h_401_project.tmpl rename to tools/export/codered/lpc11u37h_401_project.tmpl diff --git a/tools/export/codered_lpc11u68_cproject.tmpl b/tools/export/codered/lpc11u68_cproject.tmpl similarity index 100% rename from tools/export/codered_lpc11u68_cproject.tmpl rename to tools/export/codered/lpc11u68_cproject.tmpl diff --git a/tools/export/codered_lpc11u68_project.tmpl b/tools/export/codered/lpc11u68_project.tmpl similarity index 100% rename from tools/export/codered_lpc11u68_project.tmpl rename to tools/export/codered/lpc11u68_project.tmpl diff --git a/tools/export/codered_lpc1549_cproject.tmpl b/tools/export/codered/lpc1549_cproject.tmpl similarity index 100% rename from tools/export/codered_lpc1549_cproject.tmpl rename to tools/export/codered/lpc1549_cproject.tmpl diff --git a/tools/export/codered_lpc1549_project.tmpl b/tools/export/codered/lpc1549_project.tmpl similarity index 100% rename from tools/export/codered_lpc1549_project.tmpl rename to tools/export/codered/lpc1549_project.tmpl diff --git a/tools/export/codered_lpc1768_cproject.tmpl b/tools/export/codered/lpc1768_cproject.tmpl similarity index 100% rename from tools/export/codered_lpc1768_cproject.tmpl rename to tools/export/codered/lpc1768_cproject.tmpl diff --git a/tools/export/codered_lpc1768_project.tmpl b/tools/export/codered/lpc1768_project.tmpl similarity index 100% rename from tools/export/codered_lpc1768_project.tmpl rename to tools/export/codered/lpc1768_project.tmpl diff --git a/tools/export/codered_lpc4088_cproject.tmpl b/tools/export/codered/lpc4088_cproject.tmpl similarity index 100% rename from tools/export/codered_lpc4088_cproject.tmpl rename to tools/export/codered/lpc4088_cproject.tmpl diff --git a/tools/export/codered_lpc4088_dm_cproject.tmpl b/tools/export/codered/lpc4088_dm_cproject.tmpl similarity index 100% rename from tools/export/codered_lpc4088_dm_cproject.tmpl rename to tools/export/codered/lpc4088_dm_cproject.tmpl diff --git a/tools/export/codered_lpc4088_dm_project.tmpl b/tools/export/codered/lpc4088_dm_project.tmpl similarity index 100% rename from tools/export/codered_lpc4088_dm_project.tmpl rename to tools/export/codered/lpc4088_dm_project.tmpl diff --git a/tools/export/codered_lpc4088_project.tmpl b/tools/export/codered/lpc4088_project.tmpl similarity index 100% rename from tools/export/codered_lpc4088_project.tmpl rename to tools/export/codered/lpc4088_project.tmpl diff --git a/tools/export/codered_lpc4330_m4_cproject.tmpl b/tools/export/codered/lpc4330_m4_cproject.tmpl similarity index 100% rename from tools/export/codered_lpc4330_m4_cproject.tmpl rename to tools/export/codered/lpc4330_m4_cproject.tmpl diff --git a/tools/export/codered_lpc4330_m4_project.tmpl b/tools/export/codered/lpc4330_m4_project.tmpl similarity index 100% rename from tools/export/codered_lpc4330_m4_project.tmpl rename to tools/export/codered/lpc4330_m4_project.tmpl diff --git a/tools/export/codered_lpc824_cproject.tmpl b/tools/export/codered/lpc824_cproject.tmpl similarity index 100% rename from tools/export/codered_lpc824_cproject.tmpl rename to tools/export/codered/lpc824_cproject.tmpl diff --git a/tools/export/codered_lpc824_project.tmpl b/tools/export/codered/lpc824_project.tmpl similarity index 100% rename from tools/export/codered_lpc824_project.tmpl rename to tools/export/codered/lpc824_project.tmpl diff --git a/tools/export/codered_lpccappuccino_cproject.tmpl b/tools/export/codered/lpccappuccino_cproject.tmpl similarity index 100% rename from tools/export/codered_lpccappuccino_cproject.tmpl rename to tools/export/codered/lpccappuccino_cproject.tmpl diff --git a/tools/export/codered_lpccappuccino_project.tmpl b/tools/export/codered/lpccappuccino_project.tmpl similarity index 100% rename from tools/export/codered_lpccappuccino_project.tmpl rename to tools/export/codered/lpccappuccino_project.tmpl diff --git a/tools/export/codered_project_common.tmpl b/tools/export/codered/project_common.tmpl similarity index 100% rename from tools/export/codered_project_common.tmpl rename to tools/export/codered/project_common.tmpl diff --git a/tools/export/codered_ublox_c027_cproject.tmpl b/tools/export/codered/ublox_c027_cproject.tmpl similarity index 100% rename from tools/export/codered_ublox_c027_cproject.tmpl rename to tools/export/codered/ublox_c027_cproject.tmpl diff --git a/tools/export/codered_ublox_c027_project.tmpl b/tools/export/codered/ublox_c027_project.tmpl similarity index 100% rename from tools/export/codered_ublox_c027_project.tmpl rename to tools/export/codered/ublox_c027_project.tmpl From 13b2a95d3a4c278f7f72d626f163400dc766524f Mon Sep 17 00:00:00 2001 From: Jimmy Brisson Date: Tue, 17 Jan 2017 12:12:24 -0600 Subject: [PATCH 12/45] Move coide into its own directory --- tools/export/{coide.py => coide/__init__.py} | 5 +++-- .../arch_max.coproj.tmpl} | 0 .../arch_pro.coproj.tmpl} | 0 .../disco_f051r8.coproj.tmpl} | 0 .../disco_f100rb.coproj.tmpl} | 0 .../disco_f303vc.coproj.tmpl} | 0 .../disco_f334c8.coproj.tmpl} | 0 .../disco_f401vc.coproj.tmpl} | 0 .../disco_f407vg.coproj.tmpl} | 0 .../disco_f429zi.coproj.tmpl} | 0 .../disco_l053c8.coproj.tmpl} | 0 .../{coide_kl05z.coproj.tmpl => coide/kl05z.coproj.tmpl} | 0 .../{coide_kl25z.coproj.tmpl => coide/kl25z.coproj.tmpl} | 0 .../{coide_lpc1768.coproj.tmpl => coide/lpc1768.coproj.tmpl} | 0 .../mote_l152rc.coproj.tmpl} | 0 .../mts_mdot_f405rg.coproj.tmpl} | 0 .../mts_mdot_f411re.coproj.tmpl} | 0 .../nucleo_f030r8.coproj.tmpl} | 0 .../nucleo_f042k6.coproj.tmpl} | 0 .../nucleo_f070rb.coproj.tmpl} | 0 .../nucleo_f072rb.coproj.tmpl} | 0 .../nucleo_f091rc.coproj.tmpl} | 0 .../nucleo_f103rb.coproj.tmpl} | 0 .../nucleo_f302r8.coproj.tmpl} | 0 .../nucleo_f303re.coproj.tmpl} | 0 .../nucleo_f334r8.coproj.tmpl} | 0 .../nucleo_f401re.coproj.tmpl} | 0 .../nucleo_f410rb.coproj.tmpl} | 0 .../nucleo_f411re.coproj.tmpl} | 0 .../nucleo_f446re.coproj.tmpl} | 0 .../nucleo_l053r8.coproj.tmpl} | 0 .../nucleo_l152re.coproj.tmpl} | 0 .../nz32_sc151.coproj.tmpl} | 0 .../ublox_c027.coproj.tmpl} | 0 34 files changed, 3 insertions(+), 2 deletions(-) rename tools/export/{coide.py => coide/__init__.py} (96%) rename tools/export/{coide_arch_max.coproj.tmpl => coide/arch_max.coproj.tmpl} (100%) rename tools/export/{coide_arch_pro.coproj.tmpl => coide/arch_pro.coproj.tmpl} (100%) rename tools/export/{coide_disco_f051r8.coproj.tmpl => coide/disco_f051r8.coproj.tmpl} (100%) rename tools/export/{coide_disco_f100rb.coproj.tmpl => coide/disco_f100rb.coproj.tmpl} (100%) rename tools/export/{coide_disco_f303vc.coproj.tmpl => coide/disco_f303vc.coproj.tmpl} (100%) rename tools/export/{coide_disco_f334c8.coproj.tmpl => coide/disco_f334c8.coproj.tmpl} (100%) rename tools/export/{coide_disco_f401vc.coproj.tmpl => coide/disco_f401vc.coproj.tmpl} (100%) rename tools/export/{coide_disco_f407vg.coproj.tmpl => coide/disco_f407vg.coproj.tmpl} (100%) rename tools/export/{coide_disco_f429zi.coproj.tmpl => coide/disco_f429zi.coproj.tmpl} (100%) rename tools/export/{coide_disco_l053c8.coproj.tmpl => coide/disco_l053c8.coproj.tmpl} (100%) rename tools/export/{coide_kl05z.coproj.tmpl => coide/kl05z.coproj.tmpl} (100%) rename tools/export/{coide_kl25z.coproj.tmpl => coide/kl25z.coproj.tmpl} (100%) rename tools/export/{coide_lpc1768.coproj.tmpl => coide/lpc1768.coproj.tmpl} (100%) rename tools/export/{coide_mote_l152rc.coproj.tmpl => coide/mote_l152rc.coproj.tmpl} (100%) rename tools/export/{coide_mts_mdot_f405rg.coproj.tmpl => coide/mts_mdot_f405rg.coproj.tmpl} (100%) rename tools/export/{coide_mts_mdot_f411re.coproj.tmpl => coide/mts_mdot_f411re.coproj.tmpl} (100%) rename tools/export/{coide_nucleo_f030r8.coproj.tmpl => coide/nucleo_f030r8.coproj.tmpl} (100%) rename tools/export/{coide_nucleo_f042k6.coproj.tmpl => coide/nucleo_f042k6.coproj.tmpl} (100%) rename tools/export/{coide_nucleo_f070rb.coproj.tmpl => coide/nucleo_f070rb.coproj.tmpl} (100%) rename tools/export/{coide_nucleo_f072rb.coproj.tmpl => coide/nucleo_f072rb.coproj.tmpl} (100%) rename tools/export/{coide_nucleo_f091rc.coproj.tmpl => coide/nucleo_f091rc.coproj.tmpl} (100%) rename tools/export/{coide_nucleo_f103rb.coproj.tmpl => coide/nucleo_f103rb.coproj.tmpl} (100%) rename tools/export/{coide_nucleo_f302r8.coproj.tmpl => coide/nucleo_f302r8.coproj.tmpl} (100%) rename tools/export/{coide_nucleo_f303re.coproj.tmpl => coide/nucleo_f303re.coproj.tmpl} (100%) rename tools/export/{coide_nucleo_f334r8.coproj.tmpl => coide/nucleo_f334r8.coproj.tmpl} (100%) rename tools/export/{coide_nucleo_f401re.coproj.tmpl => coide/nucleo_f401re.coproj.tmpl} (100%) rename tools/export/{coide_nucleo_f410rb.coproj.tmpl => coide/nucleo_f410rb.coproj.tmpl} (100%) rename tools/export/{coide_nucleo_f411re.coproj.tmpl => coide/nucleo_f411re.coproj.tmpl} (100%) rename tools/export/{coide_nucleo_f446re.coproj.tmpl => coide/nucleo_f446re.coproj.tmpl} (100%) rename tools/export/{coide_nucleo_l053r8.coproj.tmpl => coide/nucleo_l053r8.coproj.tmpl} (100%) rename tools/export/{coide_nucleo_l152re.coproj.tmpl => coide/nucleo_l152re.coproj.tmpl} (100%) rename tools/export/{coide_nz32_sc151.coproj.tmpl => coide/nz32_sc151.coproj.tmpl} (100%) rename tools/export/{coide_ublox_c027.coproj.tmpl => coide/ublox_c027.coproj.tmpl} (100%) diff --git a/tools/export/coide.py b/tools/export/coide/__init__.py similarity index 96% rename from tools/export/coide.py rename to tools/export/coide/__init__.py index cde592c083..5c570921c5 100644 --- a/tools/export/coide.py +++ b/tools/export/coide/__init__.py @@ -14,9 +14,10 @@ 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 +from tools.export.exporters import Exporter + class CoIDE(Exporter): NAME = 'CoIDE' @@ -112,4 +113,4 @@ class CoIDE(Exporter): target = self.target.lower() # Project file - self.gen_file('coide_%s.coproj.tmpl' % target, ctx, '%s.coproj' % self.project_name) + self.gen_file('coide/%s.coproj.tmpl' % target, ctx, '%s.coproj' % self.project_name) diff --git a/tools/export/coide_arch_max.coproj.tmpl b/tools/export/coide/arch_max.coproj.tmpl similarity index 100% rename from tools/export/coide_arch_max.coproj.tmpl rename to tools/export/coide/arch_max.coproj.tmpl diff --git a/tools/export/coide_arch_pro.coproj.tmpl b/tools/export/coide/arch_pro.coproj.tmpl similarity index 100% rename from tools/export/coide_arch_pro.coproj.tmpl rename to tools/export/coide/arch_pro.coproj.tmpl diff --git a/tools/export/coide_disco_f051r8.coproj.tmpl b/tools/export/coide/disco_f051r8.coproj.tmpl similarity index 100% rename from tools/export/coide_disco_f051r8.coproj.tmpl rename to tools/export/coide/disco_f051r8.coproj.tmpl diff --git a/tools/export/coide_disco_f100rb.coproj.tmpl b/tools/export/coide/disco_f100rb.coproj.tmpl similarity index 100% rename from tools/export/coide_disco_f100rb.coproj.tmpl rename to tools/export/coide/disco_f100rb.coproj.tmpl diff --git a/tools/export/coide_disco_f303vc.coproj.tmpl b/tools/export/coide/disco_f303vc.coproj.tmpl similarity index 100% rename from tools/export/coide_disco_f303vc.coproj.tmpl rename to tools/export/coide/disco_f303vc.coproj.tmpl diff --git a/tools/export/coide_disco_f334c8.coproj.tmpl b/tools/export/coide/disco_f334c8.coproj.tmpl similarity index 100% rename from tools/export/coide_disco_f334c8.coproj.tmpl rename to tools/export/coide/disco_f334c8.coproj.tmpl diff --git a/tools/export/coide_disco_f401vc.coproj.tmpl b/tools/export/coide/disco_f401vc.coproj.tmpl similarity index 100% rename from tools/export/coide_disco_f401vc.coproj.tmpl rename to tools/export/coide/disco_f401vc.coproj.tmpl diff --git a/tools/export/coide_disco_f407vg.coproj.tmpl b/tools/export/coide/disco_f407vg.coproj.tmpl similarity index 100% rename from tools/export/coide_disco_f407vg.coproj.tmpl rename to tools/export/coide/disco_f407vg.coproj.tmpl diff --git a/tools/export/coide_disco_f429zi.coproj.tmpl b/tools/export/coide/disco_f429zi.coproj.tmpl similarity index 100% rename from tools/export/coide_disco_f429zi.coproj.tmpl rename to tools/export/coide/disco_f429zi.coproj.tmpl diff --git a/tools/export/coide_disco_l053c8.coproj.tmpl b/tools/export/coide/disco_l053c8.coproj.tmpl similarity index 100% rename from tools/export/coide_disco_l053c8.coproj.tmpl rename to tools/export/coide/disco_l053c8.coproj.tmpl diff --git a/tools/export/coide_kl05z.coproj.tmpl b/tools/export/coide/kl05z.coproj.tmpl similarity index 100% rename from tools/export/coide_kl05z.coproj.tmpl rename to tools/export/coide/kl05z.coproj.tmpl diff --git a/tools/export/coide_kl25z.coproj.tmpl b/tools/export/coide/kl25z.coproj.tmpl similarity index 100% rename from tools/export/coide_kl25z.coproj.tmpl rename to tools/export/coide/kl25z.coproj.tmpl diff --git a/tools/export/coide_lpc1768.coproj.tmpl b/tools/export/coide/lpc1768.coproj.tmpl similarity index 100% rename from tools/export/coide_lpc1768.coproj.tmpl rename to tools/export/coide/lpc1768.coproj.tmpl diff --git a/tools/export/coide_mote_l152rc.coproj.tmpl b/tools/export/coide/mote_l152rc.coproj.tmpl similarity index 100% rename from tools/export/coide_mote_l152rc.coproj.tmpl rename to tools/export/coide/mote_l152rc.coproj.tmpl diff --git a/tools/export/coide_mts_mdot_f405rg.coproj.tmpl b/tools/export/coide/mts_mdot_f405rg.coproj.tmpl similarity index 100% rename from tools/export/coide_mts_mdot_f405rg.coproj.tmpl rename to tools/export/coide/mts_mdot_f405rg.coproj.tmpl diff --git a/tools/export/coide_mts_mdot_f411re.coproj.tmpl b/tools/export/coide/mts_mdot_f411re.coproj.tmpl similarity index 100% rename from tools/export/coide_mts_mdot_f411re.coproj.tmpl rename to tools/export/coide/mts_mdot_f411re.coproj.tmpl diff --git a/tools/export/coide_nucleo_f030r8.coproj.tmpl b/tools/export/coide/nucleo_f030r8.coproj.tmpl similarity index 100% rename from tools/export/coide_nucleo_f030r8.coproj.tmpl rename to tools/export/coide/nucleo_f030r8.coproj.tmpl diff --git a/tools/export/coide_nucleo_f042k6.coproj.tmpl b/tools/export/coide/nucleo_f042k6.coproj.tmpl similarity index 100% rename from tools/export/coide_nucleo_f042k6.coproj.tmpl rename to tools/export/coide/nucleo_f042k6.coproj.tmpl diff --git a/tools/export/coide_nucleo_f070rb.coproj.tmpl b/tools/export/coide/nucleo_f070rb.coproj.tmpl similarity index 100% rename from tools/export/coide_nucleo_f070rb.coproj.tmpl rename to tools/export/coide/nucleo_f070rb.coproj.tmpl diff --git a/tools/export/coide_nucleo_f072rb.coproj.tmpl b/tools/export/coide/nucleo_f072rb.coproj.tmpl similarity index 100% rename from tools/export/coide_nucleo_f072rb.coproj.tmpl rename to tools/export/coide/nucleo_f072rb.coproj.tmpl diff --git a/tools/export/coide_nucleo_f091rc.coproj.tmpl b/tools/export/coide/nucleo_f091rc.coproj.tmpl similarity index 100% rename from tools/export/coide_nucleo_f091rc.coproj.tmpl rename to tools/export/coide/nucleo_f091rc.coproj.tmpl diff --git a/tools/export/coide_nucleo_f103rb.coproj.tmpl b/tools/export/coide/nucleo_f103rb.coproj.tmpl similarity index 100% rename from tools/export/coide_nucleo_f103rb.coproj.tmpl rename to tools/export/coide/nucleo_f103rb.coproj.tmpl diff --git a/tools/export/coide_nucleo_f302r8.coproj.tmpl b/tools/export/coide/nucleo_f302r8.coproj.tmpl similarity index 100% rename from tools/export/coide_nucleo_f302r8.coproj.tmpl rename to tools/export/coide/nucleo_f302r8.coproj.tmpl diff --git a/tools/export/coide_nucleo_f303re.coproj.tmpl b/tools/export/coide/nucleo_f303re.coproj.tmpl similarity index 100% rename from tools/export/coide_nucleo_f303re.coproj.tmpl rename to tools/export/coide/nucleo_f303re.coproj.tmpl diff --git a/tools/export/coide_nucleo_f334r8.coproj.tmpl b/tools/export/coide/nucleo_f334r8.coproj.tmpl similarity index 100% rename from tools/export/coide_nucleo_f334r8.coproj.tmpl rename to tools/export/coide/nucleo_f334r8.coproj.tmpl diff --git a/tools/export/coide_nucleo_f401re.coproj.tmpl b/tools/export/coide/nucleo_f401re.coproj.tmpl similarity index 100% rename from tools/export/coide_nucleo_f401re.coproj.tmpl rename to tools/export/coide/nucleo_f401re.coproj.tmpl diff --git a/tools/export/coide_nucleo_f410rb.coproj.tmpl b/tools/export/coide/nucleo_f410rb.coproj.tmpl similarity index 100% rename from tools/export/coide_nucleo_f410rb.coproj.tmpl rename to tools/export/coide/nucleo_f410rb.coproj.tmpl diff --git a/tools/export/coide_nucleo_f411re.coproj.tmpl b/tools/export/coide/nucleo_f411re.coproj.tmpl similarity index 100% rename from tools/export/coide_nucleo_f411re.coproj.tmpl rename to tools/export/coide/nucleo_f411re.coproj.tmpl diff --git a/tools/export/coide_nucleo_f446re.coproj.tmpl b/tools/export/coide/nucleo_f446re.coproj.tmpl similarity index 100% rename from tools/export/coide_nucleo_f446re.coproj.tmpl rename to tools/export/coide/nucleo_f446re.coproj.tmpl diff --git a/tools/export/coide_nucleo_l053r8.coproj.tmpl b/tools/export/coide/nucleo_l053r8.coproj.tmpl similarity index 100% rename from tools/export/coide_nucleo_l053r8.coproj.tmpl rename to tools/export/coide/nucleo_l053r8.coproj.tmpl diff --git a/tools/export/coide_nucleo_l152re.coproj.tmpl b/tools/export/coide/nucleo_l152re.coproj.tmpl similarity index 100% rename from tools/export/coide_nucleo_l152re.coproj.tmpl rename to tools/export/coide/nucleo_l152re.coproj.tmpl diff --git a/tools/export/coide_nz32_sc151.coproj.tmpl b/tools/export/coide/nz32_sc151.coproj.tmpl similarity index 100% rename from tools/export/coide_nz32_sc151.coproj.tmpl rename to tools/export/coide/nz32_sc151.coproj.tmpl diff --git a/tools/export/coide_ublox_c027.coproj.tmpl b/tools/export/coide/ublox_c027.coproj.tmpl similarity index 100% rename from tools/export/coide_ublox_c027.coproj.tmpl rename to tools/export/coide/ublox_c027.coproj.tmpl From fdfbde8051693e56a84c7309255b87b7668f552e Mon Sep 17 00:00:00 2001 From: Jimmy Brisson Date: Tue, 17 Jan 2017 12:16:56 -0600 Subject: [PATCH 13/45] Move DS_5 into its own directory --- tools/export/{ds5_5.py => ds5_5/__init__.py} | 9 +++++---- .../arch_pro.cproject.tmpl} | 0 .../arch_pro.launch.tmpl} | 0 .../arch_pro.project.tmpl} | 0 .../lpc11u24.cproject.tmpl} | 0 .../lpc11u24.launch.tmpl} | 0 .../lpc11u24.project.tmpl} | 0 .../lpc1768.cproject.tmpl} | 0 .../lpc1768.launch.tmpl} | 0 .../lpc1768.project.tmpl} | 0 .../lpc812.cproject.tmpl} | 0 .../lpc812.launch.tmpl} | 0 .../lpc812.project.tmpl} | 0 .../rz_a1h.cproject.tmpl} | 0 .../rz_a1h.launch.tmpl} | 0 .../rz_a1h.project.tmpl} | 0 .../ublox_c027.cproject.tmpl} | 0 .../ublox_c027.launch.tmpl} | 0 .../ublox_c027.project.tmpl} | 0 19 files changed, 5 insertions(+), 4 deletions(-) rename tools/export/{ds5_5.py => ds5_5/__init__.py} (88%) rename tools/export/{ds5_5_arch_pro.cproject.tmpl => ds5_5/arch_pro.cproject.tmpl} (100%) rename tools/export/{ds5_5_arch_pro.launch.tmpl => ds5_5/arch_pro.launch.tmpl} (100%) rename tools/export/{ds5_5_arch_pro.project.tmpl => ds5_5/arch_pro.project.tmpl} (100%) rename tools/export/{ds5_5_lpc11u24.cproject.tmpl => ds5_5/lpc11u24.cproject.tmpl} (100%) rename tools/export/{ds5_5_lpc11u24.launch.tmpl => ds5_5/lpc11u24.launch.tmpl} (100%) rename tools/export/{ds5_5_lpc11u24.project.tmpl => ds5_5/lpc11u24.project.tmpl} (100%) rename tools/export/{ds5_5_lpc1768.cproject.tmpl => ds5_5/lpc1768.cproject.tmpl} (100%) rename tools/export/{ds5_5_lpc1768.launch.tmpl => ds5_5/lpc1768.launch.tmpl} (100%) rename tools/export/{ds5_5_lpc1768.project.tmpl => ds5_5/lpc1768.project.tmpl} (100%) rename tools/export/{ds5_5_lpc812.cproject.tmpl => ds5_5/lpc812.cproject.tmpl} (100%) rename tools/export/{ds5_5_lpc812.launch.tmpl => ds5_5/lpc812.launch.tmpl} (100%) rename tools/export/{ds5_5_lpc812.project.tmpl => ds5_5/lpc812.project.tmpl} (100%) rename tools/export/{ds5_5_rz_a1h.cproject.tmpl => ds5_5/rz_a1h.cproject.tmpl} (100%) rename tools/export/{ds5_5_rz_a1h.launch.tmpl => ds5_5/rz_a1h.launch.tmpl} (100%) rename tools/export/{ds5_5_rz_a1h.project.tmpl => ds5_5/rz_a1h.project.tmpl} (100%) rename tools/export/{ds5_5_ublox_c027.cproject.tmpl => ds5_5/ublox_c027.cproject.tmpl} (100%) rename tools/export/{ds5_5_ublox_c027.launch.tmpl => ds5_5/ublox_c027.launch.tmpl} (100%) rename tools/export/{ds5_5_ublox_c027.project.tmpl => ds5_5/ublox_c027.project.tmpl} (100%) diff --git a/tools/export/ds5_5.py b/tools/export/ds5_5/__init__.py similarity index 88% rename from tools/export/ds5_5.py rename to tools/export/ds5_5/__init__.py index 9be2535867..00acacf554 100644 --- a/tools/export/ds5_5.py +++ b/tools/export/ds5_5/__init__.py @@ -14,9 +14,10 @@ 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 basename +from tools.export.exporters import Exporter + class DS5_5(Exporter): NAME = 'DS5' @@ -64,6 +65,6 @@ class DS5_5(Exporter): target = self.target.lower() # Project file - self.gen_file('ds5_5_%s.project.tmpl' % target, ctx, '.project') - self.gen_file('ds5_5_%s.cproject.tmpl' % target, ctx, '.cproject') - self.gen_file('ds5_5_%s.launch.tmpl' % target, ctx, 'ds5_%s.launch' % target) + self.gen_file('ds5_5/%s.project.tmpl' % target, ctx, '.project') + self.gen_file('ds5_5/%s.cproject.tmpl' % target, ctx, '.cproject') + self.gen_file('ds5_5/%s.launch.tmpl' % target, ctx, 'ds5_%s.launch' % target) diff --git a/tools/export/ds5_5_arch_pro.cproject.tmpl b/tools/export/ds5_5/arch_pro.cproject.tmpl similarity index 100% rename from tools/export/ds5_5_arch_pro.cproject.tmpl rename to tools/export/ds5_5/arch_pro.cproject.tmpl diff --git a/tools/export/ds5_5_arch_pro.launch.tmpl b/tools/export/ds5_5/arch_pro.launch.tmpl similarity index 100% rename from tools/export/ds5_5_arch_pro.launch.tmpl rename to tools/export/ds5_5/arch_pro.launch.tmpl diff --git a/tools/export/ds5_5_arch_pro.project.tmpl b/tools/export/ds5_5/arch_pro.project.tmpl similarity index 100% rename from tools/export/ds5_5_arch_pro.project.tmpl rename to tools/export/ds5_5/arch_pro.project.tmpl diff --git a/tools/export/ds5_5_lpc11u24.cproject.tmpl b/tools/export/ds5_5/lpc11u24.cproject.tmpl similarity index 100% rename from tools/export/ds5_5_lpc11u24.cproject.tmpl rename to tools/export/ds5_5/lpc11u24.cproject.tmpl diff --git a/tools/export/ds5_5_lpc11u24.launch.tmpl b/tools/export/ds5_5/lpc11u24.launch.tmpl similarity index 100% rename from tools/export/ds5_5_lpc11u24.launch.tmpl rename to tools/export/ds5_5/lpc11u24.launch.tmpl diff --git a/tools/export/ds5_5_lpc11u24.project.tmpl b/tools/export/ds5_5/lpc11u24.project.tmpl similarity index 100% rename from tools/export/ds5_5_lpc11u24.project.tmpl rename to tools/export/ds5_5/lpc11u24.project.tmpl diff --git a/tools/export/ds5_5_lpc1768.cproject.tmpl b/tools/export/ds5_5/lpc1768.cproject.tmpl similarity index 100% rename from tools/export/ds5_5_lpc1768.cproject.tmpl rename to tools/export/ds5_5/lpc1768.cproject.tmpl diff --git a/tools/export/ds5_5_lpc1768.launch.tmpl b/tools/export/ds5_5/lpc1768.launch.tmpl similarity index 100% rename from tools/export/ds5_5_lpc1768.launch.tmpl rename to tools/export/ds5_5/lpc1768.launch.tmpl diff --git a/tools/export/ds5_5_lpc1768.project.tmpl b/tools/export/ds5_5/lpc1768.project.tmpl similarity index 100% rename from tools/export/ds5_5_lpc1768.project.tmpl rename to tools/export/ds5_5/lpc1768.project.tmpl diff --git a/tools/export/ds5_5_lpc812.cproject.tmpl b/tools/export/ds5_5/lpc812.cproject.tmpl similarity index 100% rename from tools/export/ds5_5_lpc812.cproject.tmpl rename to tools/export/ds5_5/lpc812.cproject.tmpl diff --git a/tools/export/ds5_5_lpc812.launch.tmpl b/tools/export/ds5_5/lpc812.launch.tmpl similarity index 100% rename from tools/export/ds5_5_lpc812.launch.tmpl rename to tools/export/ds5_5/lpc812.launch.tmpl diff --git a/tools/export/ds5_5_lpc812.project.tmpl b/tools/export/ds5_5/lpc812.project.tmpl similarity index 100% rename from tools/export/ds5_5_lpc812.project.tmpl rename to tools/export/ds5_5/lpc812.project.tmpl diff --git a/tools/export/ds5_5_rz_a1h.cproject.tmpl b/tools/export/ds5_5/rz_a1h.cproject.tmpl similarity index 100% rename from tools/export/ds5_5_rz_a1h.cproject.tmpl rename to tools/export/ds5_5/rz_a1h.cproject.tmpl diff --git a/tools/export/ds5_5_rz_a1h.launch.tmpl b/tools/export/ds5_5/rz_a1h.launch.tmpl similarity index 100% rename from tools/export/ds5_5_rz_a1h.launch.tmpl rename to tools/export/ds5_5/rz_a1h.launch.tmpl diff --git a/tools/export/ds5_5_rz_a1h.project.tmpl b/tools/export/ds5_5/rz_a1h.project.tmpl similarity index 100% rename from tools/export/ds5_5_rz_a1h.project.tmpl rename to tools/export/ds5_5/rz_a1h.project.tmpl diff --git a/tools/export/ds5_5_ublox_c027.cproject.tmpl b/tools/export/ds5_5/ublox_c027.cproject.tmpl similarity index 100% rename from tools/export/ds5_5_ublox_c027.cproject.tmpl rename to tools/export/ds5_5/ublox_c027.cproject.tmpl diff --git a/tools/export/ds5_5_ublox_c027.launch.tmpl b/tools/export/ds5_5/ublox_c027.launch.tmpl similarity index 100% rename from tools/export/ds5_5_ublox_c027.launch.tmpl rename to tools/export/ds5_5/ublox_c027.launch.tmpl diff --git a/tools/export/ds5_5_ublox_c027.project.tmpl b/tools/export/ds5_5/ublox_c027.project.tmpl similarity index 100% rename from tools/export/ds5_5_ublox_c027.project.tmpl rename to tools/export/ds5_5/ublox_c027.project.tmpl From eda115dad99630a2c54b3e1c30ef5b4176012d80 Mon Sep 17 00:00:00 2001 From: Jimmy Brisson Date: Tue, 17 Jan 2017 12:22:59 -0600 Subject: [PATCH 14/45] Move atmelstudio to its own directory --- tools/export/{atmelstudio.py => atmelstudio/__init__.py} | 7 ++++--- .../{atmelstudio6_2.atsln.tmpl => atmelstudio/atsln.tmpl} | 0 .../cppproj.tmpl} | 0 3 files changed, 4 insertions(+), 3 deletions(-) rename tools/export/{atmelstudio.py => atmelstudio/__init__.py} (91%) rename tools/export/{atmelstudio6_2.atsln.tmpl => atmelstudio/atsln.tmpl} (100%) rename tools/export/{atmelstudio6_2.cppproj.tmpl => atmelstudio/cppproj.tmpl} (100%) diff --git a/tools/export/atmelstudio.py b/tools/export/atmelstudio/__init__.py similarity index 91% rename from tools/export/atmelstudio.py rename to tools/export/atmelstudio/__init__.py index 66c3c43020..bab012db69 100644 --- a/tools/export/atmelstudio.py +++ b/tools/export/atmelstudio/__init__.py @@ -15,9 +15,10 @@ See the License for the specific language governing permissions and limitations under the License. """ import uuid -from exporters import Exporter from os.path import splitext, basename, dirname +from tools.export.exporters import Exporter + class AtmelStudio(Exporter): NAME = 'AtmelStudio' @@ -75,5 +76,5 @@ class AtmelStudio(Exporter): } ctx.update(self.flags) target = self.target.lower() - self.gen_file('atmelstudio6_2.atsln.tmpl', ctx, '%s.atsln' % self.project_name) - self.gen_file('atmelstudio6_2.cppproj.tmpl', ctx, '%s.cppproj' % self.project_name) + self.gen_file('atmelstudio/atsln.tmpl', ctx, '%s.atsln' % self.project_name) + self.gen_file('atmelstudio/cppproj.tmpl', ctx, '%s.cppproj' % self.project_name) diff --git a/tools/export/atmelstudio6_2.atsln.tmpl b/tools/export/atmelstudio/atsln.tmpl similarity index 100% rename from tools/export/atmelstudio6_2.atsln.tmpl rename to tools/export/atmelstudio/atsln.tmpl diff --git a/tools/export/atmelstudio6_2.cppproj.tmpl b/tools/export/atmelstudio/cppproj.tmpl similarity index 100% rename from tools/export/atmelstudio6_2.cppproj.tmpl rename to tools/export/atmelstudio/cppproj.tmpl From ad58ec47e0b9eebd691cd4b4c0ef533447bdc0a8 Mon Sep 17 00:00:00 2001 From: Jimmy Brisson Date: Tue, 17 Jan 2017 12:25:04 -0600 Subject: [PATCH 15/45] Move e2studio into its own folder --- tools/export/{e2studio.py => e2studio/__init__.py} | 10 +++++----- .../{e2studio_launch.tmpl => e2studio/launch.tmpl} | 0 .../rz_a1h_cproject.tmpl} | 0 .../rz_a1h_gdbinit.tmpl} | 0 .../rz_a1h_project.tmpl} | 0 5 files changed, 5 insertions(+), 5 deletions(-) rename tools/export/{e2studio.py => e2studio/__init__.py} (81%) rename tools/export/{e2studio_launch.tmpl => e2studio/launch.tmpl} (100%) rename tools/export/{e2studio_rz_a1h_cproject.tmpl => e2studio/rz_a1h_cproject.tmpl} (100%) rename tools/export/{e2studio_rz_a1h_gdbinit.tmpl => e2studio/rz_a1h_gdbinit.tmpl} (100%) rename tools/export/{e2studio_rz_a1h_project.tmpl => e2studio/rz_a1h_project.tmpl} (100%) diff --git a/tools/export/e2studio.py b/tools/export/e2studio/__init__.py similarity index 81% rename from tools/export/e2studio.py rename to tools/export/e2studio/__init__.py index 205287089a..a80d53553b 100644 --- a/tools/export/e2studio.py +++ b/tools/export/e2studio/__init__.py @@ -14,9 +14,9 @@ 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 +from tools.export.exporters import Exporter class E2Studio(Exporter): NAME = 'e2 studio' @@ -41,7 +41,7 @@ class E2Studio(Exporter): 'libraries': libraries, 'symbols': self.toolchain.get_symbols() } - self.gen_file('e2studio_%s_project.tmpl' % self.target.lower(), ctx, '.project') - self.gen_file('e2studio_%s_cproject.tmpl' % self.target.lower(), ctx, '.cproject') - self.gen_file('e2studio_%s_gdbinit.tmpl' % self.target.lower(), ctx, '.gdbinit') - self.gen_file('e2studio_launch.tmpl', ctx, '%s OpenOCD.launch' % self.project_name) + self.gen_file('e2studio/%s_project.tmpl' % self.target.lower(), ctx, '.project') + self.gen_file('e2studio/%s_cproject.tmpl' % self.target.lower(), ctx, '.cproject') + self.gen_file('e2studio/%s_gdbinit.tmpl' % self.target.lower(), ctx, '.gdbinit') + self.gen_file('e2studio/launch.tmpl', ctx, '%s OpenOCD.launch' % self.project_name) diff --git a/tools/export/e2studio_launch.tmpl b/tools/export/e2studio/launch.tmpl similarity index 100% rename from tools/export/e2studio_launch.tmpl rename to tools/export/e2studio/launch.tmpl diff --git a/tools/export/e2studio_rz_a1h_cproject.tmpl b/tools/export/e2studio/rz_a1h_cproject.tmpl similarity index 100% rename from tools/export/e2studio_rz_a1h_cproject.tmpl rename to tools/export/e2studio/rz_a1h_cproject.tmpl diff --git a/tools/export/e2studio_rz_a1h_gdbinit.tmpl b/tools/export/e2studio/rz_a1h_gdbinit.tmpl similarity index 100% rename from tools/export/e2studio_rz_a1h_gdbinit.tmpl rename to tools/export/e2studio/rz_a1h_gdbinit.tmpl diff --git a/tools/export/e2studio_rz_a1h_project.tmpl b/tools/export/e2studio/rz_a1h_project.tmpl similarity index 100% rename from tools/export/e2studio_rz_a1h_project.tmpl rename to tools/export/e2studio/rz_a1h_project.tmpl From 084c93b3b9e2baaa6fc17b9b6dd40d7b84d4e2cb Mon Sep 17 00:00:00 2001 From: Jimmy Brisson Date: Tue, 17 Jan 2017 12:27:00 -0600 Subject: [PATCH 16/45] Move KDS to its own directory --- tools/export/{kds.py => kds/__init__.py} | 9 +++++---- .../hexiwear_cproject.tmpl} | 0 .../hexiwear_project.tmpl} | 0 .../{kds_k22f_cproject.tmpl => kds/k22f_cproject.tmpl} | 0 .../{kds_k22f_project.tmpl => kds/k22f_project.tmpl} | 0 .../{kds_k64f_cproject.tmpl => kds/k64f_cproject.tmpl} | 0 .../{kds_k64f_project.tmpl => kds/k64f_project.tmpl} | 0 tools/export/{kds_launch.tmpl => kds/launch.tmpl} | 0 8 files changed, 5 insertions(+), 4 deletions(-) rename tools/export/{kds.py => kds/__init__.py} (84%) rename tools/export/{kds_hexiwear_cproject.tmpl => kds/hexiwear_cproject.tmpl} (100%) rename tools/export/{kds_hexiwear_project.tmpl => kds/hexiwear_project.tmpl} (100%) rename tools/export/{kds_k22f_cproject.tmpl => kds/k22f_cproject.tmpl} (100%) rename tools/export/{kds_k22f_project.tmpl => kds/k22f_project.tmpl} (100%) rename tools/export/{kds_k64f_cproject.tmpl => kds/k64f_cproject.tmpl} (100%) rename tools/export/{kds_k64f_project.tmpl => kds/k64f_project.tmpl} (100%) rename tools/export/{kds_launch.tmpl => kds/launch.tmpl} (100%) diff --git a/tools/export/kds.py b/tools/export/kds/__init__.py similarity index 84% rename from tools/export/kds.py rename to tools/export/kds/__init__.py index b77a507f17..c663c9c875 100644 --- a/tools/export/kds.py +++ b/tools/export/kds/__init__.py @@ -14,9 +14,10 @@ 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 +from tools.export.exporters import Exporter + class KDS(Exporter): NAME = 'Kinetis Design Studio' @@ -42,6 +43,6 @@ class KDS(Exporter): 'libraries': libraries, 'symbols': self.toolchain.get_symbols() } - self.gen_file('kds_%s_project.tmpl' % self.target.lower(), ctx, '.project') - self.gen_file('kds_%s_cproject.tmpl' % self.target.lower(), ctx, '.cproject') - self.gen_file('kds_launch.tmpl', ctx, '%s.launch' % self.project_name) + self.gen_file('kds/%s_project.tmpl' % self.target.lower(), ctx, '.project') + self.gen_file('kds/%s_cproject.tmpl' % self.target.lower(), ctx, '.cproject') + self.gen_file('kds/launch.tmpl', ctx, '%s.launch' % self.project_name) diff --git a/tools/export/kds_hexiwear_cproject.tmpl b/tools/export/kds/hexiwear_cproject.tmpl similarity index 100% rename from tools/export/kds_hexiwear_cproject.tmpl rename to tools/export/kds/hexiwear_cproject.tmpl diff --git a/tools/export/kds_hexiwear_project.tmpl b/tools/export/kds/hexiwear_project.tmpl similarity index 100% rename from tools/export/kds_hexiwear_project.tmpl rename to tools/export/kds/hexiwear_project.tmpl diff --git a/tools/export/kds_k22f_cproject.tmpl b/tools/export/kds/k22f_cproject.tmpl similarity index 100% rename from tools/export/kds_k22f_cproject.tmpl rename to tools/export/kds/k22f_cproject.tmpl diff --git a/tools/export/kds_k22f_project.tmpl b/tools/export/kds/k22f_project.tmpl similarity index 100% rename from tools/export/kds_k22f_project.tmpl rename to tools/export/kds/k22f_project.tmpl diff --git a/tools/export/kds_k64f_cproject.tmpl b/tools/export/kds/k64f_cproject.tmpl similarity index 100% rename from tools/export/kds_k64f_cproject.tmpl rename to tools/export/kds/k64f_cproject.tmpl diff --git a/tools/export/kds_k64f_project.tmpl b/tools/export/kds/k64f_project.tmpl similarity index 100% rename from tools/export/kds_k64f_project.tmpl rename to tools/export/kds/k64f_project.tmpl diff --git a/tools/export/kds_launch.tmpl b/tools/export/kds/launch.tmpl similarity index 100% rename from tools/export/kds_launch.tmpl rename to tools/export/kds/launch.tmpl From 70aaaa9367bb3f6ca8fce06adb405fff58a12985 Mon Sep 17 00:00:00 2001 From: Jimmy Brisson Date: Tue, 17 Jan 2017 12:28:00 -0600 Subject: [PATCH 17/45] Move zip into its own dir --- tools/export/{zip.py => zip/__init__.py} | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) rename tools/export/{zip.py => zip/__init__.py} (95%) diff --git a/tools/export/zip.py b/tools/export/zip/__init__.py similarity index 95% rename from tools/export/zip.py rename to tools/export/zip/__init__.py index 3961eb0622..f2d9a19c0a 100644 --- a/tools/export/zip.py +++ b/tools/export/zip/__init__.py @@ -14,9 +14,10 @@ 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 basename +from tools.export.exporters import Exporter + class ZIP(Exporter): NAME = 'ZIP' From 3489b146438bbb16325fa9ca010510e70b6cbec4 Mon Sep 17 00:00:00 2001 From: Jimmy Brisson Date: Tue, 17 Jan 2017 11:52:41 -0600 Subject: [PATCH 18/45] Use sys_libs from mbedToolchain in Makefiles --- tools/export/makefile/Makefile.tmpl | 2 +- tools/export/makefile/__init__.py | 17 +++++++++++++++++ tools/export/makefile/make-gcc-arm.tmpl | 6 +----- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/tools/export/makefile/Makefile.tmpl b/tools/export/makefile/Makefile.tmpl index 275d7bf5f9..7c1051ab8c 100644 --- a/tools/export/makefile/Makefile.tmpl +++ b/tools/export/makefile/Makefile.tmpl @@ -80,7 +80,7 @@ SREC_CAT = srec_cat {% endfor %} LD_FLAGS :={%- block ld_flags -%} {{ld_flags|join(" ")}} {% endblock %} -{% block sys_libs -%}{%- endblock %} +LD_SYS_LIBS :={%- block sys_libs -%} {{ld_sys_libs|join(" ")}} {% endblock %} # Tools and Flags ############################################################################### diff --git a/tools/export/makefile/__init__.py b/tools/export/makefile/__init__.py index 135a659206..d9c34a95b6 100644 --- a/tools/export/makefile/__init__.py +++ b/tools/export/makefile/__init__.py @@ -52,6 +52,8 @@ class Makefile(Exporter): libraries = [self.prepare_lib(basename(lib)) for lib in self.resources.libraries] + sys_libs = [self.prepare_sys_lib(lib) for lib + in self.toolchain.sys_libs] ctx = { 'name': self.project_name, @@ -61,6 +63,7 @@ class Makefile(Exporter): 'library_paths': self.resources.lib_dirs, 'linker_script': self.resources.linker_script, 'libraries': libraries, + 'ld_sys_libs': sys_libs, 'hex_files': self.resources.hex_files, 'vpath': (["../../.."] if (basename(dirname(dirname(self.export_dir))) @@ -171,6 +174,10 @@ class GccArm(Makefile): def prepare_lib(libname): return "-l:" + libname + @staticmethod + def prepare_sys_lib(libname): + return "-l" + libname + class Armc5(Makefile): """ARM Compiler 5 specific makefile target""" @@ -186,6 +193,10 @@ class Armc5(Makefile): def prepare_lib(libname): return libname + @staticmethod + def prepare_sys_lib(libname): + return libname + class IAR(Makefile): """IAR specific makefile target""" @@ -202,3 +213,9 @@ class IAR(Makefile): if "lib" == libname[:3]: libname = libname[3:] return "-l" + splitext(libname)[0] + + @staticmethod + def prepare_sys_lib(libname): + if "lib" == libname[:3]: + libname = libname[3:] + return "-l" + splitext(libname)[0] diff --git a/tools/export/makefile/make-gcc-arm.tmpl b/tools/export/makefile/make-gcc-arm.tmpl index ad9eb93cfd..3b89b294ab 100644 --- a/tools/export/makefile/make-gcc-arm.tmpl +++ b/tools/export/makefile/make-gcc-arm.tmpl @@ -1,10 +1,6 @@ {% extends "makefile/Makefile.tmpl" %} -{% block sys_libs %} -{% for lib in ["-lstdc++", "-lsupc++", "-lm", "-lc", "-lgcc", "-lnosys"] -%} -LD_SYS_LIBS += {{lib}} -{% endfor %} -{%- endblock %} +{%- block sys_libs -%} -Wl,--start-group {{ld_sys_libs|join(" ")}} -Wl,--end-group {%- endblock -%} {% block elf2bin %} $(ELF2BIN) -O binary $< $@ From beb9c6f4ec64b2ffa2ca10d62e0053c601470dc5 Mon Sep 17 00:00:00 2001 From: Jimmy Brisson Date: Tue, 17 Jan 2017 12:30:18 -0600 Subject: [PATCH 19/45] Move simplicity to its own dir --- tools/export/__init__.py | 4 ++-- tools/export/{simplicityv3.py => simplicity/__init__.py} | 5 +++-- .../{simplicityv3_slsproj.tmpl => simplicity/slsproj.tmpl} | 0 3 files changed, 5 insertions(+), 4 deletions(-) rename tools/export/{simplicityv3.py => simplicity/__init__.py} (97%) rename tools/export/{simplicityv3_slsproj.tmpl => simplicity/slsproj.tmpl} (100%) diff --git a/tools/export/__init__.py b/tools/export/__init__.py index 6bbf9e8f6e..fe1baf5278 100644 --- a/tools/export/__init__.py +++ b/tools/export/__init__.py @@ -16,7 +16,7 @@ # limitations under the License. from tools.export import codered, ds5_5, iar, makefile -from tools.export import embitz, coide, kds, simplicityv3, atmelstudio +from tools.export import embitz, coide, kds, simplicity, atmelstudio from tools.export import sw4stm32, e2studio, zip, cmsis, uvision, cdt from tools.targets import TARGET_NAMES @@ -33,7 +33,7 @@ EXPORTERS = { 'embitz' : embitz.EmBitz, 'coide' : coide.CoIDE, 'kds' : kds.KDS, - 'simplicityv3' : simplicityv3.SimplicityV3, + 'simplicityv3' : simplicity.SimplicityV3, 'atmelstudio' : atmelstudio.AtmelStudio, 'sw4stm32' : sw4stm32.Sw4STM32, 'e2studio' : e2studio.E2Studio, diff --git a/tools/export/simplicityv3.py b/tools/export/simplicity/__init__.py similarity index 97% rename from tools/export/simplicityv3.py rename to tools/export/simplicity/__init__.py index 624da00184..74ec93a666 100644 --- a/tools/export/simplicityv3.py +++ b/tools/export/simplicity/__init__.py @@ -14,9 +14,10 @@ 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 split,splitext, basename +from tools.export.exporters import Exporter + class Folder: def __init__(self, name): self.name = name @@ -191,4 +192,4 @@ class SimplicityV3(Exporter): print("\t" + bpath.name + "\n") ''' - self.gen_file('simplicityv3_slsproj.tmpl', ctx, '%s.slsproj' % self.project_name) + self.gen_file('simplicity/slsproj.tmpl', ctx, '%s.slsproj' % self.project_name) diff --git a/tools/export/simplicityv3_slsproj.tmpl b/tools/export/simplicity/slsproj.tmpl similarity index 100% rename from tools/export/simplicityv3_slsproj.tmpl rename to tools/export/simplicity/slsproj.tmpl From 4a08fd51128f10cbf1d43457d1e1a689c0f0c72d Mon Sep 17 00:00:00 2001 From: Jimmy Brisson Date: Tue, 17 Jan 2017 12:31:56 -0600 Subject: [PATCH 20/45] Move sw4stm32 into its own dir --- tools/export/{sw4stm32.py => sw4stm32/__init__.py} | 8 ++++---- .../cproject_common.tmpl} | 0 .../language_settings_commom.tmpl} | 0 .../project_common.tmpl} | 0 4 files changed, 4 insertions(+), 4 deletions(-) rename tools/export/{sw4stm32.py => sw4stm32/__init__.py} (96%) rename tools/export/{sw4stm32_cproject_common.tmpl => sw4stm32/cproject_common.tmpl} (100%) rename tools/export/{sw4stm32_language_settings_commom.tmpl => sw4stm32/language_settings_commom.tmpl} (100%) rename tools/export/{sw4stm32_project_common.tmpl => sw4stm32/project_common.tmpl} (100%) diff --git a/tools/export/sw4stm32.py b/tools/export/sw4stm32/__init__.py similarity index 96% rename from tools/export/sw4stm32.py rename to tools/export/sw4stm32/__init__.py index c23979a29d..9b046c72ae 100644 --- a/tools/export/sw4stm32.py +++ b/tools/export/sw4stm32/__init__.py @@ -14,10 +14,10 @@ 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 tools.utils import mkdir +from tools.export.exporters import Exporter class Sw4STM32(Exporter): @@ -114,6 +114,6 @@ class Sw4STM32(Exporter): } 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') + 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/tools/export/sw4stm32_cproject_common.tmpl b/tools/export/sw4stm32/cproject_common.tmpl similarity index 100% rename from tools/export/sw4stm32_cproject_common.tmpl rename to tools/export/sw4stm32/cproject_common.tmpl diff --git a/tools/export/sw4stm32_language_settings_commom.tmpl b/tools/export/sw4stm32/language_settings_commom.tmpl similarity index 100% rename from tools/export/sw4stm32_language_settings_commom.tmpl rename to tools/export/sw4stm32/language_settings_commom.tmpl diff --git a/tools/export/sw4stm32_project_common.tmpl b/tools/export/sw4stm32/project_common.tmpl similarity index 100% rename from tools/export/sw4stm32_project_common.tmpl rename to tools/export/sw4stm32/project_common.tmpl From c09857acb8d0b3b985db551c353f3cb04ba94046 Mon Sep 17 00:00:00 2001 From: Amanda Butler Date: Tue, 17 Jan 2017 16:39:30 -0600 Subject: [PATCH 21/45] Delete testing_mbed_OS_5.md Delete page because duplicate page exists in Handbook --- docs/testing_mbed_OS_5.md | 201 -------------------------------------- 1 file changed, 201 deletions(-) delete mode 100644 docs/testing_mbed_OS_5.md diff --git a/docs/testing_mbed_OS_5.md b/docs/testing_mbed_OS_5.md deleted file mode 100644 index d119f745bc..0000000000 --- a/docs/testing_mbed_OS_5.md +++ /dev/null @@ -1,201 +0,0 @@ -# Testing in mbed OS 5 - -The way tests are run and compiled in mbed OS 5 is substantially different from previous versions of mbed. Previously, tests were located in one known location and a python file (`tools/tests.py`) kept track of their dependencies, capabilities, and configurations. mbed OS 5 has adopted a more distributed approach to testing. Test code lives alongside the application code, and which is dynamically discovered by the test tools. - -## Table of Contents - -- [Using tests](#using-tests) - - [Test code structure](#test-code-structure) - - [Test discovery](#test-discovery) - - [Test names](#test-names) - - [Building tests](#building-tests) - - [Building process](#building-process) - - [App config](#app-config) - - [Running tests](#running-tests) - - [Writing tests](#writing-tests) -- [Debugging tests](#debugging-tests) - - [Exporting tests](#exporting-tests) - - [Running a test while debugging](#running-a-test-while-debugging) -- [Known issues](#known-issues) - -## Using tests - -### Test code structure - -Tests can exist throughout mbed OS and your project's code. They are located under a special directory called `TESTS` (case is important!). - -Placing code under this directory means it will be ignored when building applications and libraries. This code is only ever used when building tests. This is important since all tests require a `main()` function, and building it with your application would cause multiple `main()` functions to be defined. - -In addition to being placed under a `TESTS` directory, test sources must exist under two other directories: a test group directory and a test case directory. The following are an examples of this structure: -``` -myproject/TESTS/test_group/test_case_1 -``` - -In this example, `myproject` is the project root and all the source files under the `test_case_1` directory will be included in the test. Any other source files from the OS, libraries, and your project that apply to your target's configuration will also be included in the build of your test. - -**Note:** Both the test group and test case directory can be named anything you like. However, the `TESTS` directory **must** be named `TESTS` for the tools to detect the test cases correctly. - -#### Test discovery - -Since test cases can exist throughout a project, the tools must find them in your project's file structure before building them. This is done by searching for paths that match the pattern detailed above in the [Test code structure](#test-code-structure) section. - -Test discovery also obeys the same rules that are used when building your project. This means that tests that are placed under a directory with a prefix like `TARGET_`, `TOOLCHAIN_`, or `FEATURE_` will only be discovered, built, and run if your current configuration matches this prefix. - -For example, if you place a test under the directory `FEATURE_BLE` with the following path: - -``` -myproject/mbed-os/features/FEATURE_BLE/TESTS/ble_tests/unit_test -``` - -This test case will only be discovered if the target being testing supports the BLE feature. Otherwise, the test will be ignored. - -Generally, a test should not be placed under a `TARGET_` or `TOOLCHAIN_` directory, since most tests should be designed to work for all target and toolchain configurations. - -Tests can also be completely ignored by using the `.mbedignore` file described [here](../ignoring_files_from_build.md) - -#### Test names - -A test case is named from its position in your project's file structure. For instance, in the above example, a test case with the path `myproject/TESTS/test_group/test_case_1` would be named `tests-test_group-test_case_1`. You will notice that the name is created by joining the directories that make up the path to the test case with a "dash" (`-`) character. This will be a unique name to identify the test case. You will see this name used throughout the build and testing process. - -### Building tests - -Tests can be built easily through mbed CLI. For information on using mbed CLI, please see its [documentation](https://github.com/ARMmbed/mbed-cli). - -When tests are built for a target and a given toolchain, the available tests are first discovered, then built in series. You can also create a "test specification" file, which can be used by our testing tools to run automated hardware tests. For more information on the test specification file, please see the documentation [here](https://github.com/ARMmbed/greentea#test-specification-json-formatted-input). - -#### Building process - -The process for building tests is handled by the `test.py` script (not to be confused with `tests.py`) located under the `tools` directory. This handles the discovery and building of all test cases for a given target and toolchain. - -The full build process is: - -1. Build the non-test code (all code not under a `TESTS` folder), but do not link it. The resulting object files are placed in the build directory. -1. Find all tests that match the given target and toolchain. -1. For each discovered test, build all of its source files and link it with the non-test code that was built in step 1. -1. If specified, create a test specification file and place it in the given directory for use by testing tools. This is placed in the build directory by default when using mbed CLI. - -#### App config - -When building an mbed application, the presence of a `mbed_app.json` file allows you to set or override different config settings from libraries and targets. However, because the tests share a common build, this can cause issues when tests have different configurations that affect the OS. - -The build system will look for an `mbed_app.json` file in your shared project files (any directory not inside of a `TESTS` folder). If this is found, this configuration file will be used for both the non-test code as well as each test case inside your project's source tree. If there is more than one `mbed_app.json` files in the source tree, the config system will error. - -If you need to test with multiple configurations, then you can use the `--app-config` option. This will override the search for an `mbed_app.json` file and use the config file you specify for the build. - -### Running tests - -Automated tests can be run easily through mbed CLI. For information on using mbed CLI, please see its documentation. - -The testing process requires that the tests are built and that a test specification JSON file exists that describes these available tests. The test specification format is detailed [here](https://github.com/ARMmbed/greentea#test-specification-json-formatted-input). - -The actual testing process is handled by the Greentea tool. To read more about this tool, please visit its [GitHub repository](https://github.com/ARMmbed/greentea). - -### Writing tests - -You can write tests for your own project, or add more tests to mbed OS. Tests are written using the [Greentea client](https://github.com/ARMmbed/mbed-os/tree/master/features/frameworks/greentea-client), [UNITY](https://github.com/ARMmbed/mbed-os/tree/master/features/frameworks/unity), and [utest](https://github.com/ARMmbed/mbed-os/tree/master/features/frameworks/utest) frameworks, located in `/features/frameworks`. Below is an example test that uses all of these frameworks: - -```c++ -#include "mbed.h" -#include "greentea-client/test_env.h" -#include "unity.h" -#include "utest.h" -#include "rtos.h" - -using namespace utest::v1; - -// A test that returns successfully is considered successful -void test_success() { - TEST_ASSERT(true); -} - -// Tests that assert are considered failing -void test_failure() { - TEST_ASSERT(false); -} - -utest::v1::status_t test_setup(const size_t number_of_cases) { - // Setup Greentea using a reasonable timeout in seconds - GREENTEA_SETUP(40, "default_auto"); - return verbose_test_setup_handler(number_of_cases); -} - -// Test cases -Case cases[] = { - Case("Testing success test", test_success), - Case("Testing failure test", test_failure), -}; - -Specification specification(test_setup, cases); - -// Entry point into the tests -int main() { - return !Harness::run(specification); -} -``` - -This test will first run a case that succeeds, then a case that fails. This is a good template to use when creating tests. For more complex testing examples, please see the documentation for [utest](https://github.com/ARMmbed/mbed-os/tree/master/features/frameworks/utest). - -## Debugging tests - -Debugging tests is a crucial part of the development and porting process. This section will cover exporting the test, then driving the test with the test tools while the target is attached to a debugger. - -### Exporting tests - -Currently, the easiest way to export a test is to copy the test's source code from its test directory to your project's root. This way it will be treated like a normal application by the tools. - -You can find the path to the test you wish to export by running the following command: - -``` -mbed test --compile-list -n -``` - -Once you've copied all of the test's source files to your project root, go ahead and export your project: - -``` -mbed export -i -``` - -Your exported project should now be in `projectfiles/_`. Go ahead and open this project in your IDE. - -### Running a test while debugging - -Assuming your test was exported correctly to your IDE, go ahead and build the project and load it onto your target via your debugger. - -Bring the target out of reset and run the program. Your target will now be waiting for a synchronizing character string to be sent from the test tools over the serial port. Do not run the `mbed test` commands, because that will attempt to flash the device, which you've already done with your IDE. - -Instead, the underlying test tools can be used to drive the test. [htrun](https://github.com/ARMmbed/htrun) is the tool that needs to be used in this case. This is installed when you install the requirements for mbed OS. However, if you do not have it installed you can do this by running `pip install mbed-host-tests`. - -First, find your target's serial port by running the following command: - -``` -$ mbed detect - -[mbed] Detected KL46Z, port COM270, mounted D: - -... -``` - -From the output, take note of your target's serial port (in this case, it's `COM270`). - -Run the following command when your device is running the test in your debugger: - -``` -mbedhtrun --skip-flashing --skip-reset -p :9600 -``` - -Replace `` with the serial port you found by running `mbed detect` above. - -So for the example above, the command would be: - -``` -mbedhtrun --skip-flashing --skip-reset -p COM270:9600 -``` - -This detects your attached target and drives the test. At this point the test will proceed and allow you to debug it. If you need to rerun the test, simply reset the device with your debugger, run the program, and run the same command. - -For an explanation of the arguments used in this command, please run `mbedhtrun --help`. - -## Known issues - -- There cannot be a `main()` function outside of a `TESTS` directory when building and running tests. This is because this function will be included in the non-test code build as described in the [Building process](#building-process) section. When the test code is compiled and linked with the non-test code build, a linker error will occur due to their being multiple `main()` functions defined. For this reason, please either rename your main application file if you need to build and run tests or use a different project. - - **NOTE:** This does not affect building projects or applications, just building and running tests. \ No newline at end of file From 8a29f54ae440b07c756852deda7c804b81acf880 Mon Sep 17 00:00:00 2001 From: Brian Daniels Date: Tue, 17 Jan 2017 17:27:41 -0600 Subject: [PATCH 22/45] Renaming test_env.cpp in greentea to avoid warning --- .../source/{test_env.cpp => greentea_test_env.cpp} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename features/frameworks/greentea-client/source/{test_env.cpp => greentea_test_env.cpp} (100%) diff --git a/features/frameworks/greentea-client/source/test_env.cpp b/features/frameworks/greentea-client/source/greentea_test_env.cpp similarity index 100% rename from features/frameworks/greentea-client/source/test_env.cpp rename to features/frameworks/greentea-client/source/greentea_test_env.cpp From ef26a4c0e77834f36cd1ad4b3db04f020537a555 Mon Sep 17 00:00:00 2001 From: TsungtaWu Date: Wed, 18 Jan 2017 11:01:48 +0800 Subject: [PATCH 23/45] Add DELTA_DFCM_NNN50 platform greentea tests are all passing mbedgt: test case results: 175 OK Please kindly review this PR --- .../TARGET_DELTA_DFCM_NNN50/PinNames.h | 181 ++++++++++++++++++ .../TARGET_DELTA_DFCM_NNN50/device.h | 38 ++++ .../TARGET_DELTA_DFCM_NNN50/mbed_overrides.c | 47 +++++ targets/targets.json | 18 ++ 4 files changed, 284 insertions(+) create mode 100644 targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF51822_UNIFIED/TARGET_DELTA_DFCM_NNN50/PinNames.h create mode 100644 targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF51822_UNIFIED/TARGET_DELTA_DFCM_NNN50/device.h create mode 100644 targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF51822_UNIFIED/TARGET_DELTA_DFCM_NNN50/mbed_overrides.c diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF51822_UNIFIED/TARGET_DELTA_DFCM_NNN50/PinNames.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF51822_UNIFIED/TARGET_DELTA_DFCM_NNN50/PinNames.h new file mode 100644 index 0000000000..443256790b --- /dev/null +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF51822_UNIFIED/TARGET_DELTA_DFCM_NNN50/PinNames.h @@ -0,0 +1,181 @@ +/* mbed Microcontroller Library + * Copyright (c) 2017 Nordic Semiconductor + * + * 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. + */ +#ifndef MBED_PINNAMES_H +#define MBED_PINNAMES_H + +#include "cmsis.h" + +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { + PIN_INPUT, + PIN_OUTPUT +} PinDirection; + +#define PORT_SHIFT 3 + +typedef enum { + p0 = 0, + p1 = 1, + p2 = 2, + p3 = 3, + p4 = 4, + p5 = 5, + p6 = 6, + p7 = 7, + p8 = 8, + p9 = 9, + p10 = 10, + p11 = 11, + p12 = 12, + p13 = 13, + p14 = 14, + p15 = 15, + p16 = 16, + p17 = 17, + p18 = 18, + p19 = 19, + p20 = 20, + p21 = 21, + p22 = 22, + p23 = 23, + p24 = 24, + p25 = 25, + p26 = 26, + p27 = 27, + p28 = 28, + p29 = 29, + p30 = 30, + p31 = 31, + + //NORMAL PINS... + P0_0 = p0, + P0_1 = p1, + P0_2 = p2, + P0_3 = p3, + P0_4 = p4, + P0_5 = p5, + P0_6 = p6, + P0_7 = p7, + + P0_8 = p8, + P0_9 = p9, + P0_10 = p10, + P0_11 = p11, + P0_12 = p12, + P0_13 = p13, + P0_14 = p14, + P0_15 = p15, + + P0_16 = p16, + P0_17 = p17, + P0_18 = p18, + P0_19 = p19, + P0_20 = p20, + P0_21 = p21, + P0_22 = p22, + P0_23 = p23, + + P0_24 = p24, + P0_25 = p25, + P0_26 = p26, + P0_27 = p27, + P0_28 = p28, + P0_29 = p29, + P0_30 = p30, + P0_31 = p31, + + LED1 = p13, + LED2 = p23, + LED3 = p24, + LED4 = p25, + + BUTTON1 = p20, + BUTTON2 = p21, + BUTTON3 = p22, + BUTTON4 = p0, + + RX_PIN_NUMBER = p16, + TX_PIN_NUMBER = p17, + CTS_PIN_NUMBER = p20, + RTS_PIN_NUMBER = p21, + + // mBed interface Pins + USBTX = TX_PIN_NUMBER, + USBRX = RX_PIN_NUMBER, + + SPI_PSELMOSI0 = p15, + SPI_PSELMISO0 = p9, + SPI_PSELSS0 = p29, + SPI_PSELSCK0 = p11, + + SPI_PSELMOSI1 = p17, + SPI_PSELMISO1 = p20, + SPI_PSELSS1 = p16, + SPI_PSELSCK1 = p21, + + SPIS_PSELMOSI = p17, + SPIS_PSELMISO = p20, + SPIS_PSELSS = p16, + SPIS_PSELSCK = p21, + + I2C_SDA0 = p31, + I2C_SCL0 = p30, + + D0 = p16, + D1 = p17, + D2 = p20, + D3 = p21, + D4 = p22, + D5 = p0, + D6 = p13, + D7 = p23, + + D8 = p24, + D9 = p25, + D10 = p29, + D11 = p15, + D12 = p9, + D13 = p11, + + D14 = p30, + D15 = p31, + + A0 = p3, + A1 = p4, + A2 = p5, + A3 = p6, + A4 = p26, + A5 = p27, + + // Not connected + NC = (int)0xFFFFFFFF +} PinName; + +typedef enum { + PullNone = 0, + PullDown = 1, + PullUp = 3, + PullDefault = PullUp +} PinMode; + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF51822_UNIFIED/TARGET_DELTA_DFCM_NNN50/device.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF51822_UNIFIED/TARGET_DELTA_DFCM_NNN50/device.h new file mode 100644 index 0000000000..b926c1c649 --- /dev/null +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF51822_UNIFIED/TARGET_DELTA_DFCM_NNN50/device.h @@ -0,0 +1,38 @@ +// The 'features' section in 'target.json' is now used to create the device's hardware preprocessor switches. +// Check the 'features' section of the target description in 'targets.json' for more details. +/* mbed Microcontroller Library + * Copyright (c) 2006-2017 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. + */ +#ifndef MBED_DEVICE_H +#define MBED_DEVICE_H + + + + + + + + + + + + + + + + +#include "objects.h" + +#endif diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF51822_UNIFIED/TARGET_DELTA_DFCM_NNN50/mbed_overrides.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF51822_UNIFIED/TARGET_DELTA_DFCM_NNN50/mbed_overrides.c new file mode 100644 index 0000000000..bbde12b569 --- /dev/null +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF51822_UNIFIED/TARGET_DELTA_DFCM_NNN50/mbed_overrides.c @@ -0,0 +1,47 @@ +/* mbed Microcontroller Library + * Copyright (c) 2006-2017 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. + */ + +#include "cmsis.h" + +void mbed_sdk_init() +{ + char* debug_date = __DATE__; + char* debug_time = __TIME__; + + // Default RF switch setting, pull p19 to low and p28 to high for turning antenna switch to BLE radiated path + NRF_GPIO->PIN_CNF[19] = (GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) + | (GPIO_PIN_CNF_DRIVE_S0S1 << GPIO_PIN_CNF_DRIVE_Pos) + | (GPIO_PIN_CNF_PULL_Disabled << GPIO_PIN_CNF_PULL_Pos) + | (GPIO_PIN_CNF_INPUT_Disconnect << GPIO_PIN_CNF_INPUT_Pos) + | (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos); + NRF_GPIO->PIN_CNF[28] = (GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) + | (GPIO_PIN_CNF_DRIVE_S0S1 << GPIO_PIN_CNF_DRIVE_Pos) + | (GPIO_PIN_CNF_PULL_Disabled << GPIO_PIN_CNF_PULL_Pos) + | (GPIO_PIN_CNF_INPUT_Disconnect << GPIO_PIN_CNF_INPUT_Pos) + | (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos); + + NRF_GPIO->OUTCLR = (GPIO_OUTCLR_PIN19_Clear << GPIO_OUTCLR_PIN19_Pos); + NRF_GPIO->OUTSET = (GPIO_OUTCLR_PIN28_High << GPIO_OUTCLR_PIN28_Pos); + + // Config External Crystal to 32MHz + NRF_CLOCK->XTALFREQ = 0x00; + NRF_CLOCK->EVENTS_HFCLKSTARTED = 0; + NRF_CLOCK->TASKS_HFCLKSTART = 1; + while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0) + {// Do nothing. + } + +} diff --git a/targets/targets.json b/targets/targets.json index ae2ff703fc..57a0386c05 100644 --- a/targets/targets.json +++ b/targets/targets.json @@ -1626,6 +1626,24 @@ "extra_labels_add": ["DELTA_DFCM_NNN40"], "macros_add": ["TARGET_DELTA_DFCM_NNN40", "TARGET_NRF_LFCLK_RC"] }, + "DELTA_DFCM_NNN50": { + "supported_form_factors": ["ARDUINO"], + "inherits": ["MCU_NRF51_32K_UNIFIED"], + "device_has": ["ANALOGIN", "ERROR_PATTERN", "I2C", "I2C_ASYNCH", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", "SLEEP", "SPI", "SPI_ASYNCH", "SPISLAVE"], + "device_name": "nRF51822_xxAC" + }, + "DELTA_DFCM_NNN50_BOOT": { + "supported_form_factors": ["ARDUINO"], + "inherits": ["MCU_NRF51_32K_BOOT"], + "extra_labels_add": ["DELTA_DFCM_NNN50"], + "macros_add": ["TARGET_DELTA_DFCM_NNN50"] + }, + "DELTA_DFCM_NNN50_OTA": { + "supported_form_factors": ["ARDUINO"], + "inherits": ["MCU_NRF51_32K_OTA"], + "extra_labels_add": ["DELTA_DFCM_NNN50"], + "macros_add": ["TARGET_DELTA_DFCM_NNN50"] + }, "NRF51_DK_LEGACY": { "supported_form_factors": ["ARDUINO"], "inherits": ["MCU_NRF51_32K"], From 36de50d28a746c7cdac29a058c4bd6dd5d14cd27 Mon Sep 17 00:00:00 2001 From: Liviu Ionescu Date: Wed, 18 Jan 2017 19:31:59 +0200 Subject: [PATCH 24/45] Exporters: make jinja engine strict - configure the jinja Environment to raise exception when substitution variables are not defined - trim spaces and lines, to avoid empty lines in generated files --- tools/export/exporters.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/export/exporters.py b/tools/export/exporters.py index 25bec756bf..1b727ce256 100644 --- a/tools/export/exporters.py +++ b/tools/export/exporters.py @@ -4,7 +4,7 @@ from abc import abstractmethod, ABCMeta import logging from os.path import join, dirname, relpath, basename, realpath, normpath from itertools import groupby -from jinja2 import FileSystemLoader +from jinja2 import FileSystemLoader, StrictUndefined from jinja2.environment import Environment import copy @@ -115,7 +115,7 @@ class Exporter(object): """Generates a project file from a template using jinja""" jinja_loader = FileSystemLoader( os.path.dirname(os.path.abspath(__file__))) - jinja_environment = Environment(loader=jinja_loader) + jinja_environment = Environment(loader=jinja_loader, undefined=StrictUndefined, trim_blocks=True, lstrip_blocks=True) template = jinja_environment.get_template(template_file) target_text = template.render(data) From c6e0b9c20ed2a1d13c98625ecbbd730f2db760f5 Mon Sep 17 00:00:00 2001 From: TsungtaWu Date: Thu, 19 Jan 2017 17:20:46 +0800 Subject: [PATCH 25/45] Revise to improve readability Delete the blank line. Use Marcos rather than magic numbers Put brace at end of the while line --- .../TARGET_DELTA_DFCM_NNN50/device.h | 15 --------------- .../TARGET_DELTA_DFCM_NNN50/mbed_overrides.c | 9 +++++---- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF51822_UNIFIED/TARGET_DELTA_DFCM_NNN50/device.h b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF51822_UNIFIED/TARGET_DELTA_DFCM_NNN50/device.h index b926c1c649..c3f7b82761 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF51822_UNIFIED/TARGET_DELTA_DFCM_NNN50/device.h +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF51822_UNIFIED/TARGET_DELTA_DFCM_NNN50/device.h @@ -18,21 +18,6 @@ #ifndef MBED_DEVICE_H #define MBED_DEVICE_H - - - - - - - - - - - - - - - #include "objects.h" #endif diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF51822_UNIFIED/TARGET_DELTA_DFCM_NNN50/mbed_overrides.c b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF51822_UNIFIED/TARGET_DELTA_DFCM_NNN50/mbed_overrides.c index bbde12b569..862723c888 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF51822_UNIFIED/TARGET_DELTA_DFCM_NNN50/mbed_overrides.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5/TARGET_MCU_NRF51822_UNIFIED/TARGET_DELTA_DFCM_NNN50/mbed_overrides.c @@ -15,6 +15,7 @@ */ #include "cmsis.h" +#include "PinNames.h" void mbed_sdk_init() { @@ -22,12 +23,12 @@ void mbed_sdk_init() char* debug_time = __TIME__; // Default RF switch setting, pull p19 to low and p28 to high for turning antenna switch to BLE radiated path - NRF_GPIO->PIN_CNF[19] = (GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) + NRF_GPIO->PIN_CNF[p19] = (GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) | (GPIO_PIN_CNF_DRIVE_S0S1 << GPIO_PIN_CNF_DRIVE_Pos) | (GPIO_PIN_CNF_PULL_Disabled << GPIO_PIN_CNF_PULL_Pos) | (GPIO_PIN_CNF_INPUT_Disconnect << GPIO_PIN_CNF_INPUT_Pos) | (GPIO_PIN_CNF_DIR_Output << GPIO_PIN_CNF_DIR_Pos); - NRF_GPIO->PIN_CNF[28] = (GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) + NRF_GPIO->PIN_CNF[p28] = (GPIO_PIN_CNF_SENSE_Disabled << GPIO_PIN_CNF_SENSE_Pos) | (GPIO_PIN_CNF_DRIVE_S0S1 << GPIO_PIN_CNF_DRIVE_Pos) | (GPIO_PIN_CNF_PULL_Disabled << GPIO_PIN_CNF_PULL_Pos) | (GPIO_PIN_CNF_INPUT_Disconnect << GPIO_PIN_CNF_INPUT_Pos) @@ -40,8 +41,8 @@ void mbed_sdk_init() NRF_CLOCK->XTALFREQ = 0x00; NRF_CLOCK->EVENTS_HFCLKSTARTED = 0; NRF_CLOCK->TASKS_HFCLKSTART = 1; - while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0) - {// Do nothing. + while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0) { + // Do nothing. } } From 6a045a49a9df90dd2121afc37d3b16340a7a6660 Mon Sep 17 00:00:00 2001 From: Bartek Szatkowski Date: Wed, 18 Jan 2017 13:56:36 +0000 Subject: [PATCH 26/45] Platform: Add sleep/deepsleep user facing functions Add sleep/deepsleep functions to platform layer which are replacing HAL functions with the same name, rename existing symbols in HAL layer to hal_sleep/hal_deepsleep. This way sleep functions are always available, even if target doesn't implement them, which makes the code using sleep clearer. It also enables us to make decision on in which builds (debug/release) the sleep will be enabled. --- .../TARGET_MCU_NRF51822/hal_patch/sleep.c | 4 +- hal/sleep_api.h | 4 +- mbed.h | 1 + platform/sleep.h | 93 +++++++++++++++++++ targets/TARGET_ARM_SSG/TARGET_BEETLE/sleep.c | 4 +- .../TARGET_SAM_CortexM0P/sleep_api.c | 4 +- .../TARGET_SAM_CortexM4/sleep_api.c | 6 +- targets/TARGET_Freescale/TARGET_K20XX/sleep.c | 4 +- targets/TARGET_Freescale/TARGET_KLXX/sleep.c | 4 +- .../TARGET_MCUXpresso_MCUS/api/sleep.c | 4 +- targets/TARGET_Maxim/TARGET_MAX32600/sleep.c | 4 +- targets/TARGET_Maxim/TARGET_MAX32610/sleep.c | 4 +- targets/TARGET_Maxim/TARGET_MAX32620/sleep.c | 4 +- targets/TARGET_Maxim/TARGET_MAX32625/sleep.c | 6 +- .../TARGET_NORDIC/TARGET_MCU_NRF51822/sleep.c | 6 +- targets/TARGET_NORDIC/TARGET_NRF5/sleep.c | 6 +- targets/TARGET_NUVOTON/TARGET_M451/sleep.c | 4 +- targets/TARGET_NUVOTON/TARGET_NUC472/sleep.c | 4 +- targets/TARGET_NXP/TARGET_LPC11U6X/sleep.c | 4 +- targets/TARGET_NXP/TARGET_LPC11UXX/sleep.c | 4 +- .../TARGET_NXP/TARGET_LPC11XX_11CXX/sleep.c | 4 +- targets/TARGET_NXP/TARGET_LPC13XX/sleep.c | 4 +- targets/TARGET_NXP/TARGET_LPC176X/sleep.c | 6 +- targets/TARGET_NXP/TARGET_LPC408X/sleep.c | 6 +- targets/TARGET_NXP/TARGET_LPC43XX/sleep.c | 6 +- targets/TARGET_NXP/TARGET_LPC81X/sleep.c | 6 +- targets/TARGET_NXP/TARGET_LPC82X/sleep.c | 4 +- targets/TARGET_STM/sleep.c | 4 +- .../TARGET_Silicon_Labs/TARGET_EFM32/sleep.c | 4 +- targets/TARGET_WIZNET/TARGET_W7500x/sleep.c | 4 +- targets/TARGET_ublox/TARGET_HI2110/sleep.c | 6 +- 31 files changed, 161 insertions(+), 67 deletions(-) create mode 100644 platform/sleep.h diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/hal_patch/sleep.c b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/hal_patch/sleep.c index efb46699ee..7c178188a5 100644 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/hal_patch/sleep.c +++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/hal_patch/sleep.c @@ -23,7 +23,7 @@ // In this case, bits which are equal to 0 are the bits reserved in this register #define SCB_ICSR_RESERVED_BITS_MASK 0x9E43F03F -void sleep(void) +void hal_sleep(void) { // ensure debug is disconnected if semihost is enabled.... @@ -64,7 +64,7 @@ void sleep(void) } } -void deepsleep(void) +void hal_deepsleep(void) { sleep(); // NRF_POWER->SYSTEMOFF=1; diff --git a/hal/sleep_api.h b/hal/sleep_api.h index 25a7b2a6ed..8747459cb9 100644 --- a/hal/sleep_api.h +++ b/hal/sleep_api.h @@ -41,7 +41,7 @@ extern "C" { * Flash re-programming and the USB serial port will remain active, but the mbed program will no longer be * able to access the LocalFileSystem */ -void sleep(void); +void hal_sleep(void); /** Send the microcontroller to deep sleep * @@ -56,7 +56,7 @@ void sleep(void); * Flash re-programming and the USB serial port will remain active, but the mbed program will no longer be * able to access the LocalFileSystem */ -void deepsleep(void); +void hal_deepsleep(void); #ifdef __cplusplus } diff --git a/mbed.h b/mbed.h index 0ee12dc76f..0e71670a0d 100644 --- a/mbed.h +++ b/mbed.h @@ -92,6 +92,7 @@ #include "drivers/InterruptIn.h" #include "platform/wait_api.h" #include "hal/sleep_api.h" +#include "platform/sleep.h" #include "platform/rtc_time.h" // mbed Non-hardware components diff --git a/platform/sleep.h b/platform/sleep.h new file mode 100644 index 0000000000..5964871101 --- /dev/null +++ b/platform/sleep.h @@ -0,0 +1,93 @@ + +/** \addtogroup platform */ +/** @{*/ +/* mbed Microcontroller Library + * Copyright (c) 2006-2017 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. + */ +#ifndef MBED_SLEEP_H +#define MBED_SLEEP_H + +#include "sleep_api.h" + +#if !DEVICE_SLEEP +#warning Sleep is not supported on this platform. +#else /* DEVICE_SLEEP */ +#ifndef NDEBUG +#warning Sleep is disabled for debug builds. +#endif /* NDEBUG */ +#endif /* DEVICE_SLEEP */ + +#ifdef __cplusplus +extern "C" { +#endif + +/** Send the microcontroller to sleep + * + * @note This function can be a noop if not implemented by the platform. + * @note This function will only put device to sleep in release mode (small profile or when NDEBUG is defined). + * + * The processor is setup ready for sleep, and sent to sleep using __WFI(). In this mode, the + * system clock to the core is stopped until a reset or an interrupt occurs. This eliminates + * dynamic power used by the processor, memory systems and buses. The processor, peripheral and + * memory state are maintained, and the peripherals continue to work and can generate interrupts. + * + * The processor can be woken up by any internal peripheral interrupt or external pin interrupt. + * + * @note + * The mbed interface semihosting is disconnected as part of going to sleep, and can not be restored. + * Flash re-programming and the USB serial port will remain active, but the mbed program will no longer be + * able to access the LocalFileSystem + */ +__INLINE void sleep(void) +{ +#ifdef NDEBUG +#if DEVICE_SLEEP + hal_sleep(); +#endif /* DEVICE_SLEEP */ +#endif /* NDEBUG */ +} + +/** Send the microcontroller to deep sleep + * + * @note This function can be a noop if not implemented by the platform. + * @note This function will only put device to sleep in release mode (small profile or when NDEBUG is defined). + * + * This processor is setup ready for deep sleep, and sent to sleep using __WFI(). This mode + * has the same sleep features as sleep plus it powers down peripherals and clocks. All state + * is still maintained. + * + * The processor can only be woken up by an external interrupt on a pin or a watchdog timer. + * + * @note + * The mbed interface semihosting is disconnected as part of going to sleep, and can not be restored. + * Flash re-programming and the USB serial port will remain active, but the mbed program will no longer be + * able to access the LocalFileSystem + */ +__INLINE void deepsleep(void) +{ +#ifdef NDEBUG +#if DEVICE_SLEEP + hal_deepsleep(); +#endif /* DEVICE_SLEEP */ +#endif /* NDEBUG */ +} + +#ifdef __cplusplus +} +#endif + +#endif + +/** @}*/ diff --git a/targets/TARGET_ARM_SSG/TARGET_BEETLE/sleep.c b/targets/TARGET_ARM_SSG/TARGET_BEETLE/sleep.c index b2b007542c..d6a64362b7 100644 --- a/targets/TARGET_ARM_SSG/TARGET_BEETLE/sleep.c +++ b/targets/TARGET_ARM_SSG/TARGET_BEETLE/sleep.c @@ -16,13 +16,13 @@ #include "sleep_api.h" #include "cmsis.h" - void sleep(void) + void hal_sleep(void) { SystemPowerSuspend(POWER_MODE_SLEEP); SystemPowerResume(POWER_MODE_SLEEP); } -void deepsleep(void) +void hal_deepsleep(void) { SystemPowerSuspend(POWER_MODE_DEEP_SLEEP); SystemPowerResume(POWER_MODE_DEEP_SLEEP); diff --git a/targets/TARGET_Atmel/TARGET_SAM_CortexM0P/sleep_api.c b/targets/TARGET_Atmel/TARGET_SAM_CortexM0P/sleep_api.c index bc26c0439f..c683431179 100644 --- a/targets/TARGET_Atmel/TARGET_SAM_CortexM0P/sleep_api.c +++ b/targets/TARGET_Atmel/TARGET_SAM_CortexM0P/sleep_api.c @@ -25,7 +25,7 @@ * @param[void] void * @return void */ -void sleep(void) +void hal_sleep(void) { #if (SAMD21) || (SAMR21) system_set_sleepmode(SYSTEM_SLEEPMODE_IDLE_2); @@ -43,7 +43,7 @@ void sleep(void) * @param[void] void * @return void */ -void deepsleep(void) +void hal_deepsleep(void) { system_set_sleepmode(SYSTEM_SLEEPMODE_STANDBY); system_sleep(); diff --git a/targets/TARGET_Atmel/TARGET_SAM_CortexM4/sleep_api.c b/targets/TARGET_Atmel/TARGET_SAM_CortexM4/sleep_api.c index 384269a911..b21209f743 100644 --- a/targets/TARGET_Atmel/TARGET_SAM_CortexM4/sleep_api.c +++ b/targets/TARGET_Atmel/TARGET_SAM_CortexM4/sleep_api.c @@ -24,7 +24,7 @@ * @param[void] void * @return void */ -void sleep(void) +void hal_sleep(void) { enum sleepmgr_mode sleep_mode; @@ -40,10 +40,10 @@ void sleep(void) * @param[void] void * @return void */ -void deepsleep(void) +void hal_deepsleep(void) { enum sleepmgr_mode sleep_mode; sleep_mode = SLEEPMGR_SLEEP_WFE; sleepmgr_sleep(sleep_mode); -} \ No newline at end of file +} diff --git a/targets/TARGET_Freescale/TARGET_K20XX/sleep.c b/targets/TARGET_Freescale/TARGET_K20XX/sleep.c index 4a7dced648..fca8ff3c64 100644 --- a/targets/TARGET_Freescale/TARGET_K20XX/sleep.c +++ b/targets/TARGET_Freescale/TARGET_K20XX/sleep.c @@ -17,7 +17,7 @@ #include "cmsis.h" //Normal wait mode -void sleep(void) +void hal_sleep(void) { SMC->PMPROT = SMC_PMPROT_AVLLS_MASK | SMC_PMPROT_ALLS_MASK | SMC_PMPROT_AVLP_MASK; @@ -27,7 +27,7 @@ void sleep(void) } //Very low-power stop mode -void deepsleep(void) +void hal_deepsleep(void) { //Check if ADC is enabled and HS mode is set, if yes disable it (lowers power consumption by 60uA) uint8_t ADC_HSC = 0; diff --git a/targets/TARGET_Freescale/TARGET_KLXX/sleep.c b/targets/TARGET_Freescale/TARGET_KLXX/sleep.c index c3ea772007..a3bb82a109 100644 --- a/targets/TARGET_Freescale/TARGET_KLXX/sleep.c +++ b/targets/TARGET_Freescale/TARGET_KLXX/sleep.c @@ -18,7 +18,7 @@ #include "PeripheralPins.h" //Normal wait mode -void sleep(void) +void hal_sleep(void) { SMC->PMPROT = SMC_PMPROT_AVLLS_MASK | SMC_PMPROT_ALLS_MASK | SMC_PMPROT_AVLP_MASK; @@ -28,7 +28,7 @@ void sleep(void) } //Very low-power stop mode -void deepsleep(void) +void hal_deepsleep(void) { //Check if ADC is enabled and HS mode is set, if yes disable it (lowers power consumption by 60uA) uint8_t ADC_HSC = 0; diff --git a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/api/sleep.c b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/api/sleep.c index d00bb7b371..08f32b8691 100644 --- a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/api/sleep.c +++ b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/api/sleep.c @@ -18,14 +18,14 @@ #include "fsl_smc.h" #include "fsl_clock_config.h" -void sleep(void) +void hal_sleep(void) { SMC_SetPowerModeProtection(SMC, kSMC_AllowPowerModeAll); SMC_SetPowerModeWait(SMC); } -void deepsleep(void) +void hal_deepsleep(void) { #if (defined(FSL_FEATURE_SOC_MCG_COUNT) && FSL_FEATURE_SOC_MCG_COUNT) mcg_mode_t mode = CLOCK_GetMode(); diff --git a/targets/TARGET_Maxim/TARGET_MAX32600/sleep.c b/targets/TARGET_Maxim/TARGET_MAX32600/sleep.c index 4d26c53573..5d47900ff9 100644 --- a/targets/TARGET_Maxim/TARGET_MAX32600/sleep.c +++ b/targets/TARGET_Maxim/TARGET_MAX32600/sleep.c @@ -41,7 +41,7 @@ static mxc_uart_regs_t *stdio_uart = (mxc_uart_regs_t*)STDIO_UART; // Normal wait mode -void sleep(void) +void hal_sleep(void) { // Normal sleep mode for ARM core SCB->SCR = 0; @@ -70,7 +70,7 @@ static void clearAllGPIOWUD(void) } // Low-power stop mode -void deepsleep(void) +void hal_deepsleep(void) { __disable_irq(); diff --git a/targets/TARGET_Maxim/TARGET_MAX32610/sleep.c b/targets/TARGET_Maxim/TARGET_MAX32610/sleep.c index 4d26c53573..5d47900ff9 100644 --- a/targets/TARGET_Maxim/TARGET_MAX32610/sleep.c +++ b/targets/TARGET_Maxim/TARGET_MAX32610/sleep.c @@ -41,7 +41,7 @@ static mxc_uart_regs_t *stdio_uart = (mxc_uart_regs_t*)STDIO_UART; // Normal wait mode -void sleep(void) +void hal_sleep(void) { // Normal sleep mode for ARM core SCB->SCR = 0; @@ -70,7 +70,7 @@ static void clearAllGPIOWUD(void) } // Low-power stop mode -void deepsleep(void) +void hal_deepsleep(void) { __disable_irq(); diff --git a/targets/TARGET_Maxim/TARGET_MAX32620/sleep.c b/targets/TARGET_Maxim/TARGET_MAX32620/sleep.c index 81874b0f2a..2d531e35f6 100644 --- a/targets/TARGET_Maxim/TARGET_MAX32620/sleep.c +++ b/targets/TARGET_Maxim/TARGET_MAX32620/sleep.c @@ -54,7 +54,7 @@ static mxc_uart_regs_t *stdio_uart = (mxc_uart_regs_t*)STDIO_UART; static int restore_usb; static usb_state_t usb_state; -void sleep(void) +void hal_sleep(void) { // Normal sleep mode for ARM core SCB->SCR = 0; @@ -109,7 +109,7 @@ static void usb_wakeup(void) } // Low-power stop mode -void deepsleep(void) +void hal_deepsleep(void) { unsigned int part_rev = MXC_PWRMAN->mask_id0 & MXC_F_PWRMAN_MASK_ID0_REVISION_ID; diff --git a/targets/TARGET_Maxim/TARGET_MAX32625/sleep.c b/targets/TARGET_Maxim/TARGET_MAX32625/sleep.c index 560a440929..3984b4aca3 100644 --- a/targets/TARGET_Maxim/TARGET_MAX32625/sleep.c +++ b/targets/TARGET_Maxim/TARGET_MAX32625/sleep.c @@ -34,13 +34,13 @@ #include "sleep_api.h" #include "lp.h" -void sleep(void) +void hal_sleep(void) { LP_EnterLP2(); } // Low-power stop mode -void deepsleep(void) +void hal_deepsleep(void) { - sleep(); + hal_sleep(); } diff --git a/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/sleep.c b/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/sleep.c index be8d69d1e8..c1a54f6db0 100644 --- a/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/sleep.c +++ b/targets/TARGET_NORDIC/TARGET_MCU_NRF51822/sleep.c @@ -18,7 +18,7 @@ #include "mbed_interface.h" #include "toolchain.h" -MBED_WEAK void sleep(void) +MBED_WEAK void hal_sleep(void) { // ensure debug is disconnected if semihost is enabled.... NRF_POWER->TASKS_LOWPWR = 1; @@ -26,8 +26,8 @@ MBED_WEAK void sleep(void) __WFE(); } -MBED_WEAK void deepsleep(void) +MBED_WEAK void hal_deepsleep(void) { - sleep(); + hal_sleep(); // NRF_POWER->SYSTEMOFF=1; } diff --git a/targets/TARGET_NORDIC/TARGET_NRF5/sleep.c b/targets/TARGET_NORDIC/TARGET_NRF5/sleep.c index cb677400d1..29020dc934 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5/sleep.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5/sleep.c @@ -25,7 +25,7 @@ #define FPU_EXCEPTION_MASK 0x0000009F -void sleep(void) +void hal_sleep(void) { // ensure debug is disconnected if semihost is enabled.... @@ -73,8 +73,8 @@ void sleep(void) } } -void deepsleep(void) +void hal_deepsleep(void) { - sleep(); + hal_sleep(); // NRF_POWER->SYSTEMOFF=1; } diff --git a/targets/TARGET_NUVOTON/TARGET_M451/sleep.c b/targets/TARGET_NUVOTON/TARGET_M451/sleep.c index bd6f08fcd4..60117a9978 100644 --- a/targets/TARGET_NUVOTON/TARGET_M451/sleep.c +++ b/targets/TARGET_NUVOTON/TARGET_M451/sleep.c @@ -38,7 +38,7 @@ int pwmout_allow_powerdown(void); /** * Enter Idle mode. */ -void sleep(void) +void hal_sleep(void) { struct sleep_s sleep_obj; sleep_obj.powerdown = 0; @@ -49,7 +49,7 @@ void sleep(void) /** * Enter Power-down mode while no peripheral is active; otherwise, enter Idle mode. */ -void deepsleep(void) +void hal_deepsleep(void) { struct sleep_s sleep_obj; sleep_obj.powerdown = 1; diff --git a/targets/TARGET_NUVOTON/TARGET_NUC472/sleep.c b/targets/TARGET_NUVOTON/TARGET_NUC472/sleep.c index 4a51b10184..62fe06cd73 100644 --- a/targets/TARGET_NUVOTON/TARGET_NUC472/sleep.c +++ b/targets/TARGET_NUVOTON/TARGET_NUC472/sleep.c @@ -38,7 +38,7 @@ int pwmout_allow_powerdown(void); /** * Enter Idle mode. */ -void sleep(void) +void hal_sleep(void) { struct sleep_s sleep_obj; sleep_obj.powerdown = 0; @@ -49,7 +49,7 @@ void sleep(void) /** * Enter Power-down mode while no peripheral is active; otherwise, enter Idle mode. */ -void deepsleep(void) +void hal_deepsleep(void) { struct sleep_s sleep_obj; sleep_obj.powerdown = 1; diff --git a/targets/TARGET_NXP/TARGET_LPC11U6X/sleep.c b/targets/TARGET_NXP/TARGET_LPC11U6X/sleep.c index ede20f99dc..b6d4022812 100644 --- a/targets/TARGET_NXP/TARGET_LPC11U6X/sleep.c +++ b/targets/TARGET_NXP/TARGET_LPC11U6X/sleep.c @@ -19,7 +19,7 @@ #if DEVICE_SLEEP -void sleep(void) { +void hal_sleep(void) { #if (DEVICE_SEMIHOST == 1) // ensure debug is disconnected @@ -37,7 +37,7 @@ void sleep(void) { } -void deepsleep(void) { +void hal_deepsleep(void) { #if (DEVICE_SEMIHOST == 1) // ensure debug is disconnected diff --git a/targets/TARGET_NXP/TARGET_LPC11UXX/sleep.c b/targets/TARGET_NXP/TARGET_LPC11UXX/sleep.c index b7b979326b..261e140871 100644 --- a/targets/TARGET_NXP/TARGET_LPC11UXX/sleep.c +++ b/targets/TARGET_NXP/TARGET_LPC11UXX/sleep.c @@ -17,7 +17,7 @@ #include "cmsis.h" #include "mbed_interface.h" -void sleep(void) { +void hal_sleep(void) { // ensure debug is disconnected #if DEVICE_SEMIHOST mbed_interface_disconnect(); @@ -59,7 +59,7 @@ void sleep(void) { * We treat a deepsleep() as a normal sleep(). */ -void deepsleep(void) { +void hal_deepsleep(void) { // ensure debug is disconnected #if DEVICE_SEMIHOST mbed_interface_disconnect(); diff --git a/targets/TARGET_NXP/TARGET_LPC11XX_11CXX/sleep.c b/targets/TARGET_NXP/TARGET_LPC11XX_11CXX/sleep.c index 8507cc5a75..0eee902fd2 100644 --- a/targets/TARGET_NXP/TARGET_LPC11XX_11CXX/sleep.c +++ b/targets/TARGET_NXP/TARGET_LPC11XX_11CXX/sleep.c @@ -17,7 +17,7 @@ #include "cmsis.h" #include "mbed_interface.h" -void sleep(void) { +void hal_sleep(void) { // PCON[DPDEN] set to sleep LPC_PMU->PCON = 0x0; @@ -29,7 +29,7 @@ void sleep(void) { __WFI(); } -void deepsleep(void) { +void hal_deepsleep(void) { // PCON[DPDEN] set to deepsleep LPC_PMU->PCON = 0; diff --git a/targets/TARGET_NXP/TARGET_LPC13XX/sleep.c b/targets/TARGET_NXP/TARGET_LPC13XX/sleep.c index 1515891d1e..50e242ff1c 100644 --- a/targets/TARGET_NXP/TARGET_LPC13XX/sleep.c +++ b/targets/TARGET_NXP/TARGET_LPC13XX/sleep.c @@ -17,7 +17,7 @@ #include "cmsis.h" #include "mbed_interface.h" -void sleep(void) { +void hal_sleep(void) { // PCON[PD] set to sleep LPC_PMU->PCON = 0x0; @@ -28,7 +28,7 @@ void sleep(void) { __WFI(); } -void deepsleep(void) { +void hal_deepsleep(void) { // PCON[PD] set to deepsleep LPC_PMU->PCON = 0x1; diff --git a/targets/TARGET_NXP/TARGET_LPC176X/sleep.c b/targets/TARGET_NXP/TARGET_LPC176X/sleep.c index e8b734324d..c9f6ad4145 100644 --- a/targets/TARGET_NXP/TARGET_LPC176X/sleep.c +++ b/targets/TARGET_NXP/TARGET_LPC176X/sleep.c @@ -17,7 +17,7 @@ #include "cmsis.h" #include "mbed_interface.h" -void sleep(void) { +void hal_sleep(void) { #if (DEVICE_SEMIHOST == 1) // ensure debug is disconnected @@ -60,7 +60,7 @@ void sleep(void) { * We treat a deepsleep() as a normal sleep(). */ -void deepsleep(void) { +void hal_deepsleep(void) { #if (DEVICE_SEMIHOST == 1) // ensure debug is disconnected @@ -68,5 +68,5 @@ void deepsleep(void) { #endif // PCON[PD] set to deepsleep - sleep(); + hal_sleep(); } diff --git a/targets/TARGET_NXP/TARGET_LPC408X/sleep.c b/targets/TARGET_NXP/TARGET_LPC408X/sleep.c index ac48218690..298573b9ad 100644 --- a/targets/TARGET_NXP/TARGET_LPC408X/sleep.c +++ b/targets/TARGET_NXP/TARGET_LPC408X/sleep.c @@ -17,7 +17,7 @@ #include "cmsis.h" #include "mbed_interface.h" -void sleep(void) { +void hal_sleep(void) { LPC_SC->PCON = 0x0; // SRC[SLEEPDEEP] set to 0 = sleep @@ -52,6 +52,6 @@ void sleep(void) { * * We treat a deepsleep() as a normal sleep(). */ -void deepsleep(void) { - sleep(); +void hal_deepsleep(void) { + hal_sleep(); } diff --git a/targets/TARGET_NXP/TARGET_LPC43XX/sleep.c b/targets/TARGET_NXP/TARGET_LPC43XX/sleep.c index dd6949f75d..deafdb50db 100644 --- a/targets/TARGET_NXP/TARGET_LPC43XX/sleep.c +++ b/targets/TARGET_NXP/TARGET_LPC43XX/sleep.c @@ -19,7 +19,7 @@ #include "cmsis.h" #include "mbed_interface.h" -void sleep(void) { +void hal_sleep(void) { // SRC[SLEEPDEEP] set to 0 = sleep SCB->SCR &= ~SCB_SCR_SLEEPDEEP_Msk; @@ -31,6 +31,6 @@ void sleep(void) { /* * ToDo: Implement deepsleep() */ -void deepsleep(void) { - sleep(); +void hal_deepsleep(void) { + hal_sleep(); } diff --git a/targets/TARGET_NXP/TARGET_LPC81X/sleep.c b/targets/TARGET_NXP/TARGET_LPC81X/sleep.c index 4d2232a86d..e0c1aa5208 100644 --- a/targets/TARGET_NXP/TARGET_LPC81X/sleep.c +++ b/targets/TARGET_NXP/TARGET_LPC81X/sleep.c @@ -20,7 +20,7 @@ //#define DEEPSLEEP #define POWERDOWN -void sleep(void) { +void hal_sleep(void) { //Normal sleep mode for PCON: LPC_PMU->PCON &= ~0x03; @@ -36,7 +36,7 @@ void sleep(void) { //Deepsleep/powerdown modes assume the device is configured to use its internal RC oscillator directly #ifdef DEEPSLEEP -void deepsleep(void) { +void hal_deepsleep(void) { //Deep sleep in PCON LPC_PMU->PCON &= ~0x03; LPC_PMU->PCON |= 0x01; @@ -59,7 +59,7 @@ void deepsleep(void) { #endif #ifdef POWERDOWN -void deepsleep(void) { +void hal_deepsleep(void) { //Powerdown in PCON LPC_PMU->PCON &= ~0x03; LPC_PMU->PCON |= 0x02; diff --git a/targets/TARGET_NXP/TARGET_LPC82X/sleep.c b/targets/TARGET_NXP/TARGET_LPC82X/sleep.c index 64115a2055..9f6deb51f8 100644 --- a/targets/TARGET_NXP/TARGET_LPC82X/sleep.c +++ b/targets/TARGET_NXP/TARGET_LPC82X/sleep.c @@ -20,7 +20,7 @@ //#define DEEPSLEEP #define POWERDOWN -void sleep(void) +void hal_sleep(void) { //Normal sleep mode for PCON: LPC_PMU->PCON &= ~0x03; @@ -34,7 +34,7 @@ void sleep(void) // Deepsleep/powerdown modes assume the device is configured to use its internal RC oscillator directly -void deepsleep(void) +void hal_deepsleep(void) { //Deep sleep in PCON LPC_PMU->PCON &= ~0x03; diff --git a/targets/TARGET_STM/sleep.c b/targets/TARGET_STM/sleep.c index 540b6b4e2f..acb4b1999a 100644 --- a/targets/TARGET_STM/sleep.c +++ b/targets/TARGET_STM/sleep.c @@ -35,7 +35,7 @@ #include "cmsis.h" -void sleep(void) +void hal_sleep(void) { // Stop HAL systick HAL_SuspendTick(); @@ -45,7 +45,7 @@ void sleep(void) HAL_ResumeTick(); } -void deepsleep(void) +void hal_deepsleep(void) { // Stop HAL systick HAL_SuspendTick(); diff --git a/targets/TARGET_Silicon_Labs/TARGET_EFM32/sleep.c b/targets/TARGET_Silicon_Labs/TARGET_EFM32/sleep.c index 12721ead25..951ec13447 100644 --- a/targets/TARGET_Silicon_Labs/TARGET_EFM32/sleep.c +++ b/targets/TARGET_Silicon_Labs/TARGET_EFM32/sleep.c @@ -35,7 +35,7 @@ uint32_t sleep_block_counter[NUM_SLEEP_MODES] = {0}; * Sleep mode. * Enter the lowest possible sleep mode that is not blocked by ongoing activity. */ -void sleep(void) +void hal_sleep(void) { if (sleep_block_counter[0] > 0) { /* Blocked everything below EM0, so just return */ @@ -64,7 +64,7 @@ void sleep(void) * consumption as low as 1.1 μA with RTC enabled. Power-on Reset, Brown-out * Detection and full RAM and CPU retention is also included. */ -void deepsleep(void) +void hal_deepsleep(void) { EMU_EnterEM2(true); } diff --git a/targets/TARGET_WIZNET/TARGET_W7500x/sleep.c b/targets/TARGET_WIZNET/TARGET_W7500x/sleep.c index 30a8716736..acd0030bce 100644 --- a/targets/TARGET_WIZNET/TARGET_W7500x/sleep.c +++ b/targets/TARGET_WIZNET/TARGET_W7500x/sleep.c @@ -31,12 +31,12 @@ #include "cmsis.h" #include "mbed_interface.h" -void sleep(void) +void hal_sleep(void) { // To Do } -void deepsleep(void) +void hal_deepsleep(void) { // To Do } diff --git a/targets/TARGET_ublox/TARGET_HI2110/sleep.c b/targets/TARGET_ublox/TARGET_HI2110/sleep.c index 9a5eb80950..e919d49bd6 100644 --- a/targets/TARGET_ublox/TARGET_HI2110/sleep.c +++ b/targets/TARGET_ublox/TARGET_HI2110/sleep.c @@ -40,14 +40,14 @@ * MBED API CALLS * ----------------------------------------------------------------*/ -void sleep(void) +void hal_sleep(void) { __DSB(); __WFI(); __ISB(); } -void deepsleep() +void hal_deepsleep() { - sleep(); + hal_sleep(); } From 526e592de5ab48b45768ff863bcd1b1d4386a83d Mon Sep 17 00:00:00 2001 From: Jimmy Brisson Date: Thu, 19 Jan 2017 03:54:10 -0600 Subject: [PATCH 27/45] Fix all undefined key errors in iar exporter --- tools/export/iar/__init__.py | 2 ++ tools/export/iar/ewp.tmpl | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/export/iar/__init__.py b/tools/export/iar/__init__.py index 3951d915cd..b075c7c9e6 100644 --- a/tools/export/iar/__init__.py +++ b/tools/export/iar/__init__.py @@ -64,8 +64,10 @@ class IAR(Exporter): "GFPUCoreSlave": '', "GFPUCoreSlave2": 40, "GBECoreSlave": 35, + "GBECoreSlave2": '', "FPU2": 0, "NrRegs": 0, + "NEON": '', } iar_defaults.update(device_info) diff --git a/tools/export/iar/ewp.tmpl b/tools/export/iar/ewp.tmpl index 943c148cbc..cf5b7f0e6e 100644 --- a/tools/export/iar/ewp.tmpl +++ b/tools/export/iar/ewp.tmpl @@ -131,7 +131,7 @@