From 8547f26872fab73a6becb02ef88bcb84117e01df Mon Sep 17 00:00:00 2001 From: deepikabhavnani Date: Fri, 4 Jan 2019 16:16:04 -0600 Subject: [PATCH 1/3] Add missing ARMC6 flags - MBED_DEBUG and MBED_TRAP_ERRORS_ENABLED --- tools/profiles/debug.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/profiles/debug.json b/tools/profiles/debug.json index b5c6dbec934..844d481011f 100644 --- a/tools/profiles/debug.json +++ b/tools/profiles/debug.json @@ -20,7 +20,8 @@ "-Wno-armcc-pragma-push-pop", "-Wno-armcc-pragma-anon-unions", "-DMULADDC_CANNOT_USE_R7", "-fdata-sections", "-fno-exceptions", "-MMD", "-D_LIBCPP_EXTERN_TEMPLATE(...)=", - "-fshort-enums", "-fshort-wchar" ], + "-fshort-enums", "-fshort-wchar", "-DMBED_DEBUG", + "-DMBED_TRAP_ERRORS_ENABLED=1"], "asm": [], "c": ["-D__ASSERT_MSG", "-std=gnu99"], "cxx": ["-fno-rtti", "-std=gnu++98"], From 30f18b67e551f7cae83c843cddefdd2735e6273b Mon Sep 17 00:00:00 2001 From: deepikabhavnani Date: Fri, 4 Jan 2019 16:19:32 -0600 Subject: [PATCH 2/3] Add flag "-DMBED_TRAP_ERRORS_ENABLED=1" to develop profile as well printf was called from ISR when sleep tracing was enabled. Issue was captured only in debug profile. Printf is not allowed from ISR context and issues like this should be trapped in case of debug profiles as well. --- tools/profiles/develop.json | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tools/profiles/develop.json b/tools/profiles/develop.json index c9a15a6a1e9..ff348b2a729 100644 --- a/tools/profiles/develop.json +++ b/tools/profiles/develop.json @@ -5,7 +5,7 @@ "-fmessage-length=0", "-fno-exceptions", "-fno-builtin", "-ffunction-sections", "-fdata-sections", "-funsigned-char", "-MMD", "-fno-delete-null-pointer-checks", - "-fomit-frame-pointer", "-Os", "-g1"], + "-fomit-frame-pointer", "-Os", "-g1", "-DMBED_TRAP_ERRORS_ENABLED=1"], "asm": ["-x", "assembler-with-cpp"], "c": ["-std=gnu99"], "cxx": ["-std=gnu++98", "-fno-rtti", "-Wvla"], @@ -19,7 +19,7 @@ "-Wno-armcc-pragma-push-pop", "-Wno-armcc-pragma-anon-unions", "-DMULADDC_CANNOT_USE_R7", "-fdata-sections", "-fno-exceptions", "-MMD", "-D_LIBCPP_EXTERN_TEMPLATE(...)=", - "-fshort-enums", "-fshort-wchar"], + "-fshort-enums", "-fshort-wchar", "-DMBED_TRAP_ERRORS_ENABLED=1"], "asm": [], "c": ["-D__ASSERT_MSG", "-std=gnu99"], "cxx": ["-fno-rtti", "-std=gnu++98"], @@ -28,7 +28,7 @@ "ARM": { "common": ["-c", "--gnu", "-Otime", "--split_sections", "--apcs=interwork", "--brief_diagnostics", "--restrict", - "--multibyte_chars", "-O3"], + "--multibyte_chars", "-O3", "-DMBED_TRAP_ERRORS_ENABLED=1"], "asm": [], "c": ["--md", "--no_depend_system_headers", "--c99", "-D__ASSERT_MSG"], "cxx": ["--cpp", "--no_rtti", "--no_vla"], @@ -38,7 +38,8 @@ "common": ["-c", "--gnu", "-Otime", "--split_sections", "--apcs=interwork", "--brief_diagnostics", "--restrict", "--multibyte_chars", "-O3", "-D__MICROLIB", - "--library_type=microlib", "-DMBED_RTOS_SINGLE_THREAD"], + "--library_type=microlib", "-DMBED_RTOS_SINGLE_THREAD", + "-DMBED_TRAP_ERRORS_ENABLED=1"], "asm": [], "c": ["--md", "--no_depend_system_headers", "--c99", "-D__ASSERT_MSG"], "cxx": ["--cpp", "--no_rtti", "--no_vla"], @@ -47,7 +48,8 @@ "IAR": { "common": [ "--no_wrap_diagnostics", "-e", - "--diag_suppress=Pa050,Pa084,Pa093,Pa082", "-Oh", "--enable_restrict"], + "--diag_suppress=Pa050,Pa084,Pa093,Pa082", "-Oh", "--enable_restrict", + "-DMBED_TRAP_ERRORS_ENABLED=1"], "asm": [], "c": ["--vla", "--diag_suppress=Pe546"], "cxx": ["--guard_calls", "--no_static_destruction"], From 7b37b4208058eb2353099cf358442f9974743784 Mon Sep 17 00:00:00 2001 From: deepikabhavnani Date: Tue, 22 Jan 2019 11:21:33 -0600 Subject: [PATCH 3/3] Add NDEBUG flag to release profile of ARMC6 --- tools/profiles/release.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/profiles/release.json b/tools/profiles/release.json index f17d2de426d..5f32f336417 100644 --- a/tools/profiles/release.json +++ b/tools/profiles/release.json @@ -19,7 +19,7 @@ "-Wno-armcc-pragma-push-pop", "-Wno-armcc-pragma-anon-unions", "-DMULADDC_CANNOT_USE_R7", "-fdata-sections", "-fno-exceptions", "-MMD", "-D_LIBCPP_EXTERN_TEMPLATE(...)=", - "-fshort-enums", "-fshort-wchar"], + "-fshort-enums", "-fshort-wchar", "-DNDEBUG"], "asm": [], "c": ["-D__ASSERT_MSG", "-std=gnu99"], "cxx": ["-fno-rtti", "-std=gnu++98"],