From ec3dc8c50ae9cf9595660766d7fa0f23c641a863 Mon Sep 17 00:00:00 2001 From: Kevin Townsend Date: Thu, 12 Jan 2023 16:52:59 +0100 Subject: [PATCH] tests: kernel: fatal: Catch EPSR reason code Adds a check for `K_ERR_ARM_USAGE_ILLEGAL_EPSR` as the reason code when running this test for `CONFIG_ARMV7_M_ARMV8_M_MAINLINE`. Signed-off-by: Kevin Townsend --- tests/kernel/fatal/no-multithreading/src/main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/kernel/fatal/no-multithreading/src/main.c b/tests/kernel/fatal/no-multithreading/src/main.c index f99f65e3f97..e34e33d3c3a 100644 --- a/tests/kernel/fatal/no-multithreading/src/main.c +++ b/tests/kernel/fatal/no-multithreading/src/main.c @@ -29,7 +29,11 @@ void k_sys_fatal_error_handler(unsigned int reason, const z_arch_esf_t *pEsf) static void entry_cpu_exception(void) { +#if defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE) + expected_reason = K_ERR_ARM_USAGE_ILLEGAL_EPSR; +#else expected_reason = K_ERR_CPU_EXCEPTION; +#endif TC_PRINT("cpu exception\n"); #if defined(CONFIG_X86)