tfm_ns_fault_handler_callback is called when booting

Hi,

I have a problem where tfm_ns_fault_handler_callback is called when booting the system.

This results in arm_fault and k_sys_fatal_error_handler is called. The reason is 41.

I have upgraded to SDK v2.6.1

Custom board based on nrf9160-SIP

The project is based on a azure iot hub example.

This is the error log:

[00:00:00.422,271] <ESC><err> os: ***** SECURE FAULT *****<ESC><CR><LF>
[00:00:00.422,302] <ESC><err> os:   Address: 0x22<ESC><CR><LF>
[00:00:00.422,302] <ESC><err> os:   Attribution unit violation<ESC><CR><LF>
[00:00:00.422,332] <ESC><err> os: r0/a1:  0x00000000  r1/a2:  0x00000005  r2/a3:  0x0006620c<ESC><CR><LF>
[00:00:00.422,332] <ESC><err> os: r3/a4:  0x2001d599 r12/ip:  0x200103f2 r14/lr:  0x00055723<ESC><CR><LF>
[00:00:00.422,363] <ESC><err> os:  xpsr:  0x61000000<ESC><CR><LF>
[00:00:00.422,363] <ESC><err> os: Faulting instruction address (r15/pc): 0x00056080<ESC><CR><LF>
[00:00:00.422,393] <ESC><err> os: >>> ZEPHYR FATAL ERROR 41: Unknown error on CPU 0<ESC><CR><LF>
[00:00:00.422,424] <ESC><err> os: Current thread: 0x200104a0 (unknown)<ESC><CR><LF>
[00:00:01.177,398] <ESC><err> fatal_error: Resetting system<ESC><CR>


Please feel free to contact me, if more information is needed.

BR Replay

Parents
  • Hi,

    The project is based on a azure iot hub example.

    Did the project ever work before?

    Regards,
    Sigurd Hellesvik

  • Hi,

    Yes without any problem.

    Here is the history:

    Starting the project using 2.0.0, encountered a sdk problem. upgraded to 2.2.0 to resolve the issue.

    Now using 2.2.0 without debugging enabled. A problem need more debugging information enabled.

    When debug was enabled enabled the program would not start. Found a devzone post (cannot find it again) where other did encounter problems with enabling debugging on 2.2.0, when I upgraded to 2.6.1 to solve the debugging issue I meet the issue described above.

    BR Replay

  • Hi again,

    Okay, I have narrowed it down to, when the config is changed from SIZE_OPTIMIZATION to DEBUG_OPTIMIZATION, the system will never run the main app.

    The TFM PM_PARTITION_SIZE changes as well:

    -CONFIG_PM_PARTITION_SIZE_TFM=0xC000 - With debug disabled.
    +CONFIG_PM_PARTITION_SIZE_TFM=0x10000 - With debug enabled.


    *** Booting Zephyr OS build v3.2.99-ncs1 ***<CR><LF>
    I: Starting bootloader<CR><LF>
    I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3<CR><LF>
    I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3<CR><LF>
    I: Boot source: none<CR><LF>
    I: Swap type: none<CR><LF>
    I: Bootloader chainload address offset: 0x10000<CR><LF>
    I: Jumping to the first image slot<CR><LF>

  • Good find.

    In this case, I have a guess:

    TF-M uses UART1 to log. So you need to disable UART1 in DTS for your custom board.
    If you have not disabled this, it may cause the errors you see.

  • Hi Sigurd,

    I'm sorry for jumping around with this post, but I'm desperate to find any solution.

    The main problem I rand into was enabling Seggers SystemView configs.

    I thought I need to enable debugging, due to some warnings and build errors.

    Now I'm convinced, that the warnings when enabling SystemView is due to the use of K_EVENT_DEFINE.

    Some of the building log - Sorry for bad formatting. The code insert would not work..

    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:49:9: warning: implicit declaration of function 'sys_port_trace_k_event_init'; did you mean 'sys_port_trace_k_queue_init'? [-Wimplicit-function-declaration]
       49 |         sys_port_trace_ ## name ## _init
          |         ^~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:171:62: note: in definition of macro 'sys_port_trace_type_mask_k_event'
      171 |         #define sys_port_trace_type_mask_k_event(trace_call) trace_call
          |                                                              ^~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:254:17: note: in expansion of macro 'SYS_PORT_TRACING_TYPE_MASK'
      254 |                 SYS_PORT_TRACING_TYPE_MASK(obj_type, \
          |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:255:25: note: in expansion of macro '_SYS_PORT_TRACING_OBJ_INIT'
      255 |                         _SYS_PORT_TRACING_OBJ_INIT(obj_type)(obj, ##__VA_ARGS__)); \
          |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/kernel/events.c:47:9: note: in expansion of macro 'SYS_PORT_TRACING_OBJ_INIT'
       47 |         SYS_PORT_TRACING_OBJ_INIT(k_event, event);
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:64:9: warning: implicit declaration of function 'sys_port_track_k_event_init'; did you mean 'sys_port_track_k_sem_init'? [-Wimplicit-function-declaration]
       64 |         sys_port_track_ ## name ## _init
          |         ^~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:171:62: note: in definition of macro 'sys_port_trace_type_mask_k_event'
      171 |         #define sys_port_trace_type_mask_k_event(trace_call) trace_call
          |                                                              ^~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:256:17: note: in expansion of macro 'SYS_PORT_TRACING_TYPE_MASK'
      256 |                 SYS_PORT_TRACING_TYPE_MASK(obj_type, \
          |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:257:25: note: in expansion of macro '_SYS_PORT_TRACKING_OBJ_INIT'
      257 |                         _SYS_PORT_TRACKING_OBJ_INIT(obj_type)(obj, ##__VA_ARGS__)); \
          |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/kernel/events.c:47:9: note: in expansion of macro 'SYS_PORT_TRACING_OBJ_INIT'
       47 |         SYS_PORT_TRACING_OBJ_INIT(k_event, event);
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/kernel/events.c: In function 'k_event_post_internal':
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:53:9: warning: implicit declaration of function 'sys_port_trace_k_event_post_enter'; did you mean 'sys_port_trace_k_msgq_put_enter'? [-Wimplicit-function-declaration]
       53 |         sys_port_trace_ ## name ## _ ## func ## _enter
          |         ^~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:171:62: note: in definition of macro 'sys_port_trace_type_mask_k_event'
      171 |         #define sys_port_trace_type_mask_k_event(trace_call) trace_call
          |                                                              ^~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:291:17: note: in expansion of macro 'SYS_PORT_TRACING_TYPE_MASK'
      291 |                 SYS_PORT_TRACING_TYPE_MASK(obj_type, \
          |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:292:25: note: in expansion of macro '_SYS_PORT_TRACING_OBJ_FUNC_ENTER'
      292 |                         _SYS_PORT_TRACING_OBJ_FUNC_ENTER(obj_type, func)(obj, ##__VA_ARGS__)); \
          |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/kernel/events.c:97:9: note: in expansion of macro 'SYS_PORT_TRACING_OBJ_FUNC_ENTER'
       97 |         SYS_PORT_TRACING_OBJ_FUNC_ENTER(k_event, post, event, events,
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:57:9: warning: implicit declaration of function 'sys_port_trace_k_event_post_exit'; did you mean 'sys_port_trace_k_msgq_put_exit'? [-Wimplicit-function-declaration]
       57 |         sys_port_trace_ ## name ## _ ## func ## _exit
          |         ^~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:171:62: note: in definition of macro 'sys_port_trace_type_mask_k_event'
      171 |         #define sys_port_trace_type_mask_k_event(trace_call) trace_call
          |                                                              ^~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:326:17: note: in expansion of macro 'SYS_PORT_TRACING_TYPE_MASK'
      326 |                 SYS_PORT_TRACING_TYPE_MASK(obj_type, \
          |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:327:25: note: in expansion of macro '_SYS_PORT_TRACING_OBJ_FUNC_EXIT'
      327 |                         _SYS_PORT_TRACING_OBJ_FUNC_EXIT(obj_type, func)(obj, ##__VA_ARGS__)); \
          |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/kernel/events.c:145:9: note: in expansion of macro 'SYS_PORT_TRACING_OBJ_FUNC_EXIT'
      145 |         SYS_PORT_TRACING_OBJ_FUNC_EXIT(k_event, post, event, events,
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/kernel/events.c: In function 'k_event_wait_internal':
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:53:9: warning: implicit declaration of function 'sys_port_trace_k_event_wait_enter'; did you mean 'sys_port_trace_k_condvar_wait_enter'? [-Wimplicit-function-declaration]
       53 |         sys_port_trace_ ## name ## _ ## func ## _enter
          |         ^~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:171:62: note: in definition of macro 'sys_port_trace_type_mask_k_event'
      171 |         #define sys_port_trace_type_mask_k_event(trace_call) trace_call
          |                                                              ^~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:291:17: note: in expansion of macro 'SYS_PORT_TRACING_TYPE_MASK'
      291 |                 SYS_PORT_TRACING_TYPE_MASK(obj_type, \
          |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:292:25: note: in expansion of macro '_SYS_PORT_TRACING_OBJ_FUNC_ENTER'
      292 |                         _SYS_PORT_TRACING_OBJ_FUNC_ENTER(obj_type, func)(obj, ##__VA_ARGS__)); \
          |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/kernel/events.c:203:9: note: in expansion of macro 'SYS_PORT_TRACING_OBJ_FUNC_ENTER'
      203 |         SYS_PORT_TRACING_OBJ_FUNC_ENTER(k_event, wait, event, events,
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:57:9: warning: implicit declaration of function 'sys_port_trace_k_event_wait_exit'; did you mean 'sys_port_trace_k_condvar_wait_exit'? [-Wimplicit-function-declaration]
       57 |         sys_port_trace_ ## name ## _ ## func ## _exit
          |         ^~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:171:62: note: in definition of macro 'sys_port_trace_type_mask_k_event'
      171 |         #define sys_port_trace_type_mask_k_event(trace_call) trace_call
          |                                                              ^~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:326:17: note: in expansion of macro 'SYS_PORT_TRACING_TYPE_MASK'
      326 |                 SYS_PORT_TRACING_TYPE_MASK(obj_type, \
          |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:327:25: note: in expansion of macro '_SYS_PORT_TRACING_OBJ_FUNC_EXIT'
      327 |                         _SYS_PORT_TRACING_OBJ_FUNC_EXIT(obj_type, func)(obj, ##__VA_ARGS__)); \
          |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/kernel/events.c:207:17: note: in expansion of macro 'SYS_PORT_TRACING_OBJ_FUNC_EXIT'
      207 |                 SYS_PORT_TRACING_OBJ_FUNC_EXIT(k_event, wait, event, events, 0);
          |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:55:9: warning: implicit declaration of function 'sys_port_trace_k_event_wait_blocking'; did you mean 'sys_port_trace_k_sem_take_blocking'? [-Wimplicit-function-declaration]
       55 |         sys_port_trace_ ## name ## _ ## func ## _blocking
          |         ^~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:171:62: note: in definition of macro 'sys_port_trace_type_mask_k_event'
      171 |         #define sys_port_trace_type_mask_k_event(trace_call) trace_call
          |                                                              ^~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:308:17: note: in expansion of macro 'SYS_PORT_TRACING_TYPE_MASK'
      308 |                 SYS_PORT_TRACING_TYPE_MASK(obj_type, \
          |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:309:25: note: in expansion of macro '_SYS_PORT_TRACING_OBJ_FUNC_BLOCKING'
      309 |                         _SYS_PORT_TRACING_OBJ_FUNC_BLOCKING(obj_type, func) \
          |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/kernel/events.c:244:9: note: in expansion of macro 'SYS_PORT_TRACING_OBJ_FUNC_BLOCKING'
      244 |         SYS_PORT_TRACING_OBJ_FUNC_BLOCKING(k_event, wait, event, events,
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    [566/586] Linking C static library zephyr\kernel\libkernel.a
    [567/586] Linking C static library modules\lvgl\lib..__modules__lib__gui__lvgl__zephyr.a
    [568/586] Linking C executable zephyr\zephyr_pre0.elf
    FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map
    cmd.exe /C "cd . && C:\ncs\toolchains\v2.2.0\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe  -gdwarf-4 @CMakeFiles\zephyr_pre0.rsp -o zephyr\zephyr_pre0.elf  && cmd.exe /C "cd /D C:\Projects\project\build\zephyr && C:\ncs\toolchains\v2.2.0\opt\bin\cmake.exe -E echo ""
    c:/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.exe: zephyr/kernel/libkernel.a(events.c.obj): in function `k_event_post_internal':
    C:/ncs/v2.2.0/zephyr/kernel/events.c:97: undefined reference to `sys_port_trace_k_event_post_enter'
    c:/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.exe: C:/ncs/v2.2.0/zephyr/kernel/events.c:145: undefined reference to `sys_port_trace_k_event_post_exit'
    c:/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.exe: zephyr/kernel/libkernel.a(events.c.obj): in function `k_event_wait_internal':
    C:/ncs/v2.2.0/zephyr/kernel/events.c:203: undefined reference to `sys_port_trace_k_event_wait_enter'
    c:/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.exe: C:/ncs/v2.2.0/zephyr/kernel/events.c:207: undefined reference to `sys_port_trace_k_event_wait_exit'
    c:/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.exe: C:/ncs/v2.2.0/zephyr/kernel/events.c:253: undefined reference to `sys_port_trace_k_event_wait_exit'
    c:/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.exe: C:/ncs/v2.2.0/zephyr/kernel/events.c:244: undefined reference to `sys_port_trace_k_event_wait_blocking'
    collect2.exe: error: ld returned 1 exit status
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\v2.2.0\opt\bin\cmake.EXE' --build 'c:\Projects\project\build'

     *  The terminal process terminated with exit code: 1.
     *  Terminal will be reused by tasks, press any key to close it.

  • Replay said:
    I thought I need to enable debugging, due to some warnings and build errors.

    So you no longer use DEBUG_OPTIMIZATION or?

    Replay said:
    Now I'm convinced, that the warnings when enabling SystemView is due to the use of K_EVENT_DEFINE.

    How do you enable this? I need specifics

  • How do you enable this? I need specifics

    # Enable Segger SystemView
    CONFIG_STDOUT_CONSOLE=y
    # enable to use thread names
    CONFIG_THREAD_NAME=y
    CONFIG_SEGGER_SYSTEMVIEW=y
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_TRACING=y
    # enable for post-mortem tracing
    CONFIG_SEGGER_SYSVIEW_POST_MORTEM_MODE=n


    So you no longer use DEBUG_OPTIMIZATION or?

    No, it seems not to be the issue.

    CONFIG_SIZE_OPTIMIZATIONS=y
    # CONFIG_SPEED_OPTIMIZATIONS is not set
    # CONFIG_DEBUG_OPTIMIZATIONS is not set
    # CONFIG_NO_OPTIMIZATIONS is not set

Reply Children
  • So if you build without those configurations, it works.
    And with them, it does not work.

    Right?

  • Yes if I build without these configurations, everything works fine.

    # Enable Segger SystemView
    CONFIG_STDOUT_CONSOLE=y
    # enable to use thread names
    CONFIG_THREAD_NAME=y
    CONFIG_SEGGER_SYSTEMVIEW=y
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_TRACING=y
    # enable for post-mortem tracing
    CONFIG_SEGGER_SYSVIEW_POST_MORTEM_MODE=n

    I think it is due to the project uses CONFIG_EVENTS.

    If I build with those configurations, I get build errors:

    Some of the building log - Sorry for bad formatting. The code insert would not work..

    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:49:9: warning: implicit declaration of function 'sys_port_trace_k_event_init'; did you mean 'sys_port_trace_k_queue_init'? [-Wimplicit-function-declaration]
       49 |         sys_port_trace_ ## name ## _init
          |         ^~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:171:62: note: in definition of macro 'sys_port_trace_type_mask_k_event'
      171 |         #define sys_port_trace_type_mask_k_event(trace_call) trace_call
          |                                                              ^~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:254:17: note: in expansion of macro 'SYS_PORT_TRACING_TYPE_MASK'
      254 |                 SYS_PORT_TRACING_TYPE_MASK(obj_type, \
          |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:255:25: note: in expansion of macro '_SYS_PORT_TRACING_OBJ_INIT'
      255 |                         _SYS_PORT_TRACING_OBJ_INIT(obj_type)(obj, ##__VA_ARGS__)); \
          |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/kernel/events.c:47:9: note: in expansion of macro 'SYS_PORT_TRACING_OBJ_INIT'
       47 |         SYS_PORT_TRACING_OBJ_INIT(k_event, event);
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:64:9: warning: implicit declaration of function 'sys_port_track_k_event_init'; did you mean 'sys_port_track_k_sem_init'? [-Wimplicit-function-declaration]
       64 |         sys_port_track_ ## name ## _init
          |         ^~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:171:62: note: in definition of macro 'sys_port_trace_type_mask_k_event'
      171 |         #define sys_port_trace_type_mask_k_event(trace_call) trace_call
          |                                                              ^~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:256:17: note: in expansion of macro 'SYS_PORT_TRACING_TYPE_MASK'
      256 |                 SYS_PORT_TRACING_TYPE_MASK(obj_type, \
          |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:257:25: note: in expansion of macro '_SYS_PORT_TRACKING_OBJ_INIT'
      257 |                         _SYS_PORT_TRACKING_OBJ_INIT(obj_type)(obj, ##__VA_ARGS__)); \
          |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/kernel/events.c:47:9: note: in expansion of macro 'SYS_PORT_TRACING_OBJ_INIT'
       47 |         SYS_PORT_TRACING_OBJ_INIT(k_event, event);
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/kernel/events.c: In function 'k_event_post_internal':
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:53:9: warning: implicit declaration of function 'sys_port_trace_k_event_post_enter'; did you mean 'sys_port_trace_k_msgq_put_enter'? [-Wimplicit-function-declaration]
       53 |         sys_port_trace_ ## name ## _ ## func ## _enter
          |         ^~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:171:62: note: in definition of macro 'sys_port_trace_type_mask_k_event'
      171 |         #define sys_port_trace_type_mask_k_event(trace_call) trace_call
          |                                                              ^~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:291:17: note: in expansion of macro 'SYS_PORT_TRACING_TYPE_MASK'
      291 |                 SYS_PORT_TRACING_TYPE_MASK(obj_type, \
          |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:292:25: note: in expansion of macro '_SYS_PORT_TRACING_OBJ_FUNC_ENTER'
      292 |                         _SYS_PORT_TRACING_OBJ_FUNC_ENTER(obj_type, func)(obj, ##__VA_ARGS__)); \
          |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/kernel/events.c:97:9: note: in expansion of macro 'SYS_PORT_TRACING_OBJ_FUNC_ENTER'
       97 |         SYS_PORT_TRACING_OBJ_FUNC_ENTER(k_event, post, event, events,
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:57:9: warning: implicit declaration of function 'sys_port_trace_k_event_post_exit'; did you mean 'sys_port_trace_k_msgq_put_exit'? [-Wimplicit-function-declaration]
       57 |         sys_port_trace_ ## name ## _ ## func ## _exit
          |         ^~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:171:62: note: in definition of macro 'sys_port_trace_type_mask_k_event'
      171 |         #define sys_port_trace_type_mask_k_event(trace_call) trace_call
          |                                                              ^~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:326:17: note: in expansion of macro 'SYS_PORT_TRACING_TYPE_MASK'
      326 |                 SYS_PORT_TRACING_TYPE_MASK(obj_type, \
          |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:327:25: note: in expansion of macro '_SYS_PORT_TRACING_OBJ_FUNC_EXIT'
      327 |                         _SYS_PORT_TRACING_OBJ_FUNC_EXIT(obj_type, func)(obj, ##__VA_ARGS__)); \
          |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/kernel/events.c:145:9: note: in expansion of macro 'SYS_PORT_TRACING_OBJ_FUNC_EXIT'
      145 |         SYS_PORT_TRACING_OBJ_FUNC_EXIT(k_event, post, event, events,
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/kernel/events.c: In function 'k_event_wait_internal':
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:53:9: warning: implicit declaration of function 'sys_port_trace_k_event_wait_enter'; did you mean 'sys_port_trace_k_condvar_wait_enter'? [-Wimplicit-function-declaration]
       53 |         sys_port_trace_ ## name ## _ ## func ## _enter
          |         ^~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:171:62: note: in definition of macro 'sys_port_trace_type_mask_k_event'
      171 |         #define sys_port_trace_type_mask_k_event(trace_call) trace_call
          |                                                              ^~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:291:17: note: in expansion of macro 'SYS_PORT_TRACING_TYPE_MASK'
      291 |                 SYS_PORT_TRACING_TYPE_MASK(obj_type, \
          |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:292:25: note: in expansion of macro '_SYS_PORT_TRACING_OBJ_FUNC_ENTER'
      292 |                         _SYS_PORT_TRACING_OBJ_FUNC_ENTER(obj_type, func)(obj, ##__VA_ARGS__)); \
          |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/kernel/events.c:203:9: note: in expansion of macro 'SYS_PORT_TRACING_OBJ_FUNC_ENTER'
      203 |         SYS_PORT_TRACING_OBJ_FUNC_ENTER(k_event, wait, event, events,
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:57:9: warning: implicit declaration of function 'sys_port_trace_k_event_wait_exit'; did you mean 'sys_port_trace_k_condvar_wait_exit'? [-Wimplicit-function-declaration]
       57 |         sys_port_trace_ ## name ## _ ## func ## _exit
          |         ^~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:171:62: note: in definition of macro 'sys_port_trace_type_mask_k_event'
      171 |         #define sys_port_trace_type_mask_k_event(trace_call) trace_call
          |                                                              ^~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:326:17: note: in expansion of macro 'SYS_PORT_TRACING_TYPE_MASK'
      326 |                 SYS_PORT_TRACING_TYPE_MASK(obj_type, \
          |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:327:25: note: in expansion of macro '_SYS_PORT_TRACING_OBJ_FUNC_EXIT'
      327 |                         _SYS_PORT_TRACING_OBJ_FUNC_EXIT(obj_type, func)(obj, ##__VA_ARGS__)); \
          |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/kernel/events.c:207:17: note: in expansion of macro 'SYS_PORT_TRACING_OBJ_FUNC_EXIT'
      207 |                 SYS_PORT_TRACING_OBJ_FUNC_EXIT(k_event, wait, event, events, 0);
          |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:55:9: warning: implicit declaration of function 'sys_port_trace_k_event_wait_blocking'; did you mean 'sys_port_trace_k_sem_take_blocking'? [-Wimplicit-function-declaration]
       55 |         sys_port_trace_ ## name ## _ ## func ## _blocking
          |         ^~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:171:62: note: in definition of macro 'sys_port_trace_type_mask_k_event'
      171 |         #define sys_port_trace_type_mask_k_event(trace_call) trace_call
          |                                                              ^~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:308:17: note: in expansion of macro 'SYS_PORT_TRACING_TYPE_MASK'
      308 |                 SYS_PORT_TRACING_TYPE_MASK(obj_type, \
          |                 ^~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/include/zephyr/tracing/tracing_macros.h:309:25: note: in expansion of macro '_SYS_PORT_TRACING_OBJ_FUNC_BLOCKING'
      309 |                         _SYS_PORT_TRACING_OBJ_FUNC_BLOCKING(obj_type, func) \
          |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.2.0/zephyr/kernel/events.c:244:9: note: in expansion of macro 'SYS_PORT_TRACING_OBJ_FUNC_BLOCKING'
      244 |         SYS_PORT_TRACING_OBJ_FUNC_BLOCKING(k_event, wait, event, events,
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    [566/586] Linking C static library zephyr\kernel\libkernel.a
    [567/586] Linking C static library modules\lvgl\lib..__modules__lib__gui__lvgl__zephyr.a
    [568/586] Linking C executable zephyr\zephyr_pre0.elf
    FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map
    cmd.exe /C "cd . && C:\ncs\toolchains\v2.2.0\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe  -gdwarf-4 @CMakeFiles\zephyr_pre0.rsp -o zephyr\zephyr_pre0.elf  && cmd.exe /C "cd /D C:\Projects\project\build\zephyr && C:\ncs\toolchains\v2.2.0\opt\bin\cmake.exe -E echo ""
    c:/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.exe: zephyr/kernel/libkernel.a(events.c.obj): in function `k_event_post_internal':
    C:/ncs/v2.2.0/zephyr/kernel/events.c:97: undefined reference to `sys_port_trace_k_event_post_enter'
    c:/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.exe: C:/ncs/v2.2.0/zephyr/kernel/events.c:145: undefined reference to `sys_port_trace_k_event_post_exit'
    c:/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.exe: zephyr/kernel/libkernel.a(events.c.obj): in function `k_event_wait_internal':
    C:/ncs/v2.2.0/zephyr/kernel/events.c:203: undefined reference to `sys_port_trace_k_event_wait_enter'
    c:/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.exe: C:/ncs/v2.2.0/zephyr/kernel/events.c:207: undefined reference to `sys_port_trace_k_event_wait_exit'
    c:/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.exe: C:/ncs/v2.2.0/zephyr/kernel/events.c:253: undefined reference to `sys_port_trace_k_event_wait_exit'
    c:/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.exe: C:/ncs/v2.2.0/zephyr/kernel/events.c:244: undefined reference to `sys_port_trace_k_event_wait_blocking'
    collect2.exe: error: ld returned 1 exit status
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\v2.2.0\opt\bin\cmake.EXE' --build 'c:\Projects\project\build'

     *  The terminal process terminated with exit code: 1.
     *  Terminal will be reused by tasks, press any key to close it.
  • With those configurations, are you able to build for the DK, or do you get the same error then?

    I am asking cause if you get the same for the DK I can try to reproduce.

  • If I create a new project using SDK version 2.2.0, and having this prj.config, with the target board nrf9160dk_nrf9160_ns, some build warnings will occur. The same as I get in my project.

    prj.conf

    CONFIG_EVENTS=y
    
    # Enable Segger SystemView
    CONFIG_STDOUT_CONSOLE=y
    # enable to use thread names
    CONFIG_THREAD_NAME=y
    CONFIG_SEGGER_SYSTEMVIEW=y
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_TRACING=y
    # enable for post-mortem tracing
    CONFIG_SEGGER_SYSVIEW_POST_MORTEM_MODE=n

  • I get build errors for that config in v2.2.0, but not in v2.4.2 or v2.6.1.

Related