From 90456c94f7f9cc464b325eea870759bb499901eb Mon Sep 17 00:00:00 2001 From: Daniel Leung Date: Sat, 8 Oct 2022 17:33:48 -0700 Subject: [PATCH] logging: workaround hard fault on Cortex-M0 with sys-t/catalog. For some reason, running sys-t with catalog message on Cortex-M0 would result in hard fault in mipi_catalog_formatter() if log_output_syst.c is complied before the backends (and weird enough, only with SIZE optimization). This new ordering was introduced in commit f5587552bb88fe6e57f3be1b30b8fb93fd3e0c32 as it was to group all backend source files under a single directory. Workaround the issue by compiling file later after backends as this issue is causing CI failures. Actual root-cause is TBD. Relates #50941 Signed-off-by: Daniel Leung --- subsys/logging/CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/subsys/logging/CMakeLists.txt b/subsys/logging/CMakeLists.txt index 4168148f852..07a591d5adb 100644 --- a/subsys/logging/CMakeLists.txt +++ b/subsys/logging/CMakeLists.txt @@ -47,13 +47,18 @@ if(NOT CONFIG_LOG_MODE_MINIMAL) log_output_dict.c ) + add_subdirectory(backends) + + # For some reason, running sys-t with catalog message on + # Cortex-M0 would result in hard fault in mipi_catalog_formatter() + # if this is complied before the backends (only with SIZE + # optimization). Workaround the issue by placing it here instead + # as this is causing CI failures. Actual root-cause is TBD. zephyr_sources_ifdef( CONFIG_LOG_MIPI_SYST_ENABLE log_output_syst.c ) - add_subdirectory(backends) - if(CONFIG_LOG_CUSTOM_FORMAT_SUPPORT) zephyr_sources(log_output_custom.c) endif()