From 41aff2422cce1b5da3d8426267948e392d08779a Mon Sep 17 00:00:00 2001 From: Jimmy Brisson Date: Wed, 1 Mar 2017 14:16:12 -0600 Subject: [PATCH 1/5] Add the FPU field to the tag it Keil Recently the Keil IDE has released version 5.23. This version requires the FPU to be set as part of the tag in the .uvprojx (XML project file). This patch adds the appropriate FPU settings based on the trailing F (FPU enabled) or FD (Double precesion FPU enabled) string of the core. --- tools/export/uvision/__init__.py | 17 ++++++++++++++--- tools/export/uvision/uvision.tmpl | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/tools/export/uvision/__init__.py b/tools/export/uvision/__init__.py index f571ebeaf8..154a56ca04 100644 --- a/tools/export/uvision/__init__.py +++ b/tools/export/uvision/__init__.py @@ -178,6 +178,16 @@ class Uvision(Exporter): key=lambda (_, __, name): name.lower()) return grouped + @staticmethod + def format_fpu(core): + """Generate a core's FPU string""" + if core.endswith("FD"): + return "FPU3(DFPU)" + elif core.endswith("F"): + return "FPU2" + else: + return "" + def generate(self): """Generate the .uvproj file""" cache = Cache(True, False) @@ -197,10 +207,11 @@ class Uvision(Exporter): 'include_paths': '; '.join(self.resources.inc_dirs).encode('utf-8'), 'device': DeviceUvision(self.target), } - ctx['cputype'] = ctx['device'].core.rstrip("FD") + core = ctx['device'].core + ctx['cputype'] = core.rstrip("FD") # Turn on FPU optimizations if the core has an FPU - ctx['fpu_setting'] = 1 if 'f' not in ctx['device'].core.lower() \ - or 'd' in ctx['device'].core.lower() else 2 + ctx['fpu_setting'] = 1 if 'F' not in core or 'D' in core else 2 + ctx['fputype'] = self.format_fpu(core) ctx.update(self.format_flags()) self.gen_file('uvision/uvision.tmpl', ctx, self.project_name+".uvprojx") self.gen_file('uvision/uvision_debug.tmpl', ctx, self.project_name + ".uvoptx") diff --git a/tools/export/uvision/uvision.tmpl b/tools/export/uvision/uvision.tmpl index b8524088cd..4ccb9a3228 100644 --- a/tools/export/uvision/uvision.tmpl +++ b/tools/export/uvision/uvision.tmpl @@ -16,7 +16,7 @@ {{device.dvendor}} {{device.pack_id}} {{device.pack_url}} - CPUTYPE("{{cputype}}") + CPUTYPE("{{cputype}}") {{fputype}} {{device.flash_dll}} From 2bb4d3a925ea5f2fc0a52fa133d98e64d26fbcc5 Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Wed, 1 Mar 2017 16:45:55 -0600 Subject: [PATCH 2/5] Updated includes of renamed platform header files --- drivers/FileLike.h | 2 +- features/TESTS/filesystem/fat_filesystem/main.cpp | 2 +- platform/mbed_retarget.cpp | 2 +- platform/{retarget.h => mbed_retarget.h} | 0 platform/platform.h | 4 ++-- 5 files changed, 5 insertions(+), 5 deletions(-) rename platform/{retarget.h => mbed_retarget.h} (100%) diff --git a/drivers/FileLike.h b/drivers/FileLike.h index e4f323918e..f213272021 100644 --- a/drivers/FileLike.h +++ b/drivers/FileLike.h @@ -16,7 +16,7 @@ #ifndef MBED_FILELIKE_H #define MBED_FILELIKE_H -#include "platform/toolchain.h" +#include "platform/mbed_toolchain.h" #include "drivers/FileBase.h" namespace mbed { diff --git a/features/TESTS/filesystem/fat_filesystem/main.cpp b/features/TESTS/filesystem/fat_filesystem/main.cpp index 717aa5990e..5ef12fb471 100644 --- a/features/TESTS/filesystem/fat_filesystem/main.cpp +++ b/features/TESTS/filesystem/fat_filesystem/main.cpp @@ -21,7 +21,7 @@ #include "HeapBlockDevice.h" #include "FATFileSystem.h" #include -#include "retarget.h" +#include "mbed_retarget.h" using namespace utest::v1; diff --git a/platform/mbed_retarget.cpp b/platform/mbed_retarget.cpp index e0cdbac640..bff1d59a69 100644 --- a/platform/mbed_retarget.cpp +++ b/platform/mbed_retarget.cpp @@ -34,7 +34,7 @@ #include #endif #include -#include "platform/retarget.h" +#include "platform/mbed_retarget.h" #if defined(__ARMCC_VERSION) diff --git a/platform/retarget.h b/platform/mbed_retarget.h similarity index 100% rename from platform/retarget.h rename to platform/mbed_retarget.h diff --git a/platform/platform.h b/platform/platform.h index 6e2996ae32..a5802ff655 100644 --- a/platform/platform.h +++ b/platform/platform.h @@ -24,8 +24,8 @@ #include #include -#include "platform/retarget.h" -#include "platform/toolchain.h" +#include "platform/mbed_retarget.h" +#include "platform/mbed_toolchain.h" #include "device.h" #include "PinNames.h" #include "PeripheralNames.h" From ee3e503c7743048a8d4317682000b7825510292b Mon Sep 17 00:00:00 2001 From: Martin Kojtal Date: Thu, 2 Mar 2017 12:52:35 +0000 Subject: [PATCH 3/5] Export: fix issue #3865 - cmsis-dap swd From JTAG to SWD by default. This was causing flashing error. --- tools/export/iar/ewd.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/export/iar/ewd.tmpl b/tools/export/iar/ewd.tmpl index b2daa91c76..c5b321dcb3 100644 --- a/tools/export/iar/ewd.tmpl +++ b/tools/export/iar/ewd.tmpl @@ -348,7 +348,7 @@