From 4da23c5a37599e81a6f90da2d38e028138cf106b Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Thu, 3 Nov 2022 17:31:32 +0200 Subject: [PATCH 1/2] app: zephyr: enable CONFIG_ASSERT in debug overlay Enable CONFIG_ASSERT=y in SOF debug overlay. Also add a commented out list of additional useful Zephyr debugging tools to the overlay. These incur a higher runtime cost, so are left disabled by default. These are all debug tools that have been tested to work with SOF and found useful. Signed-off-by: Kai Vehmanen --- app/debug_overlay.conf | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/debug_overlay.conf b/app/debug_overlay.conf index 015a031f2410..439af1b67ea0 100644 --- a/app/debug_overlay.conf +++ b/app/debug_overlay.conf @@ -1 +1,11 @@ CONFIG_DEBUG=y +CONFIG_ASSERT=y + +# Following options can be enabled additionally, +# but will incur a higher runtime cost, so are thus +# disabled by default. +# +# CONFIG_STACK_SENTINEL=y +# CONFIG_SYS_HEAP_VALIDATE=y +# CONFIG_SPIN_VALIDATE=y +# CONFIG_SPIN_LOCK_TIME_LIMIT=50000 From dac1ef80b09a15b295db0ffe73e56610be69d8b4 Mon Sep 17 00:00:00 2001 From: Kai Vehmanen Date: Wed, 2 Nov 2022 12:11:28 +0200 Subject: [PATCH 2/2] [DO NOT MERGE] ipc4: deliberately hit an assert Cause an assert failure upon first SET_PIPELINE_STATE IPC message sent by host. Signed-off-by: Kai Vehmanen --- src/ipc/ipc4/handler.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ipc/ipc4/handler.c b/src/ipc/ipc4/handler.c index b81d74b06251..4d342dd1de85 100644 --- a/src/ipc/ipc4/handler.c +++ b/src/ipc/ipc4/handler.c @@ -397,6 +397,9 @@ static int ipc4_set_pipeline_state(struct ipc4_message_request *ipc4) int ret = 0; int i; + /* raise an assert on purpose for testing */ + assert(0); + state.primary.dat = ipc4->primary.dat; state.extension.dat = ipc4->extension.dat; cmd = state.primary.r.ppl_state;