Skip to content

Commit

Permalink
lib: fatal_error: Don't enable fatal handler by default globally
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
rlubos committed May 20, 2024
1 parent eb6ef9b commit d1ba9b2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 1 deletion.
1 change: 0 additions & 1 deletion lib/fatal_error/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
1 change: 1 addition & 0 deletions samples/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit d1ba9b2

Please sign in to comment.