From d1ba9b230103fd177f4005fe87267c3f161a68e6 Mon Sep 17 00:00:00 2001 From: Robert Lubos Date: Mon, 20 May 2024 14:12:57 +0200 Subject: [PATCH] lib: fatal_error: Don't enable fatal handler by default globally Enabling custom fatal error handler globally can be problematic for sdk-zephyr samples built in NCS context, as they may define their own handlers, causing linker error. As there's no elegant way to handle that on the sample side, other than noup patches in sdk-zephyr, disable the RESET_ON_FATAL_ERROR config by default. As an alternative for NCS, the config will now be implied by NCS_SAMPLES_DEFAULTS config, which is exclusive for NCS samples only. Signed-off-by: Robert Lubos --- lib/fatal_error/Kconfig | 1 - samples/Kconfig | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/fatal_error/Kconfig b/lib/fatal_error/Kconfig index bb79590d3713..6b6ae61315b4 100644 --- a/lib/fatal_error/Kconfig +++ b/lib/fatal_error/Kconfig @@ -6,7 +6,6 @@ menuconfig RESET_ON_FATAL_ERROR bool "Reset on fatal error" - default y if !DEBUG && !BOARD_NATIVE_POSIX && !QEMU_TARGET && !TEST select REBOOT help Enable using the fatal error handler defined for Nordic DKs. diff --git a/samples/Kconfig b/samples/Kconfig index 0a82ff1ecc32..8ebec34b1070 100644 --- a/samples/Kconfig +++ b/samples/Kconfig @@ -13,6 +13,7 @@ config NCS_SAMPLES_DEFAULTS imply ASSERT_NO_COND_INFO imply ASSERT_NO_MSG_INFO imply HW_STACK_PROTECTION if ARCH_HAS_STACK_PROTECTION + imply RESET_ON_FATAL_ERROR if !DEBUG && !BOARD_NATIVE_POSIX && !QEMU_TARGET && !TEST help Use the default configuration for NCS samples.