debug: ASSERT_VERBOSE depends on PRINTK

When both PRINTK and ASSERT are disabled, the firmware image will still
contain a symbol for assert_print function which increases the memory
footprint by 14 bytes. In this case the function doesn't do anything and
so these 14 bytes are not useful.

This change also reduces the memory footprint elsewhere such as in the
bluetooth subsystem which implements BT_ASSERT_VERBOSE. Now it will be
nop. On nRF52832 this is on the order of 300 - 400 bytes when configured
for peripheral only (just as an example).

Signed-off-by: Guðni Már Gilbert <gudni.m.g@gmail.com>
This commit is contained in:
Guðni Már Gilbert 2025-05-11 10:41:35 +00:00 committed by Fabio Baltieri
commit f32223aac5

View file

@ -228,6 +228,7 @@ config FORCE_NO_ASSERT
config ASSERT_VERBOSE
bool "Verbose assertions"
default y
depends on PRINTK
help
This option enables printing an assert message with information about
the assertion that occurred. This includes printing the location,