Skip to content

Commit

Permalink
assert: add error message to sid_pal_assert
Browse files Browse the repository at this point in the history
Another assert has been discovered in the logs,
and it apears that it came from sid_assert.
There is no log for the location of the assert fail.
The CONFIG_ASSERT_NO_FILE_INFO is not set in the build
and CONFIG_ASSERT is enabled.
So the correct kernel assert has been called,
but it is not clear from the logs.

Added log message to make it more clear where issue happend.

Signed-off-by: Robert Gałat <[email protected]>
  • Loading branch information
RobertGalatNordic committed Jun 12, 2024
1 parent 1ff1c4b commit eeb119f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion subsys/sal/sid_pal/src/sid_assert.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@
*/

#include <sid_pal_assert_ifc.h>
#include <zephyr/sys/__assert.h>
#include <zephyr/kernel.h>
#include <zephyr/logging/log.h>

LOG_MODULE_REGISTER(sid_assert, LOG_LEVEL_ERR);

void sid_pal_assert(int line, const char *file)
{
LOG_ERR("PAL_ASSERT failed at line: %d, file: %s", line, file);
#if defined(CONFIG_ASSERT)
#if defined(CONFIG_ASSERT_NO_FILE_INFO)
ARG_UNUSED(line);
Expand Down

0 comments on commit eeb119f

Please sign in to comment.