This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Logging in secure_bootloader example

Hi,

I'm using Secure_Bootloader example of SDK 15.0.0 and I can't get the Logger module to work. I set NRF_LOG_ENABLED to 1, increased memory regions in make file, so the bootloader fits to that.

But I'm getting errors from the linker:

undefined refernce to nrf_log_frontend_std_0

and other functions

Compiler: GCC 7.2.1

Someone has a glue, what's wrong?

Kind regards

Sascha Schmidt

  • Hi,

    You need a few additional files in the Makefile as well as adjusting the memory regions in the linker settings. We already provide this in the pca10040_ble_debug project which you can find next to the "normal" pca10040_ble project in the SDK. For the nRF52 DK GCC project the differences are the following:

    1c1
    < PROJECT_NAME     := secure_bootloader_ble_s132_pca10040
    ---
    > PROJECT_NAME     := secure_bootloader_ble_s132_pca10040_debug
    14a15,19
    >   $(SDK_ROOT)/components/libraries/experimental_log/src/nrf_log_backend_rtt.c \
    >   $(SDK_ROOT)/components/libraries/experimental_log/src/nrf_log_backend_serial.c \
    >   $(SDK_ROOT)/components/libraries/experimental_log/src/nrf_log_default_backends.c \
    >   $(SDK_ROOT)/components/libraries/experimental_log/src/nrf_log_frontend.c \
    >   $(SDK_ROOT)/components/libraries/experimental_log/src/nrf_log_str_formatter.c \
    25a31,32
    >   $(SDK_ROOT)/external/fprintf/nrf_fprintf.c \
    >   $(SDK_ROOT)/external/fprintf/nrf_fprintf_format.c \
    28a36
    >   $(SDK_ROOT)/components/libraries/experimental_memobj/nrf_memobj.c \
    46c54,56
    <   $(SDK_ROOT)/components/ble/common/ble_srv_common.c \
    ---
    >   $(SDK_ROOT)/external/segger_rtt/SEGGER_RTT.c \
    >   $(SDK_ROOT)/external/segger_rtt/SEGGER_RTT_Syscalls_GCC.c \
    >   $(SDK_ROOT)/external/segger_rtt/SEGGER_RTT_printf.c \
    49a60
    >   $(SDK_ROOT)/components/ble/common/ble_srv_common.c \
    107a119
    >   $(SDK_ROOT)/external/fprintf \
    110a123
    >   $(SDK_ROOT)/external/segger_rtt \
    142a156
    > CFLAGS += -DDEBUG_NRF
    146a161
    > CFLAGS += -DNRF_DFU_DEBUG_VERSION
    178a194
    > ASMFLAGS += -DDEBUG_NRF
    182a199
    > ASMFLAGS += -DNRF_DFU_DEBUG_VERSION
    

     

    8c8
    <   FLASH (rx) : ORIGIN = 0x78000, LENGTH = 0x6000
    ---
    >   FLASH (rx) : ORIGIN = 0x72000, LENGTH = 0xc000
    76,81d75
    <   .log_const_data :
    <   {
    <     PROVIDE(__start_log_const_data = .);
    <     KEEP(*(SORT(.log_const_data*)))
    <     PROVIDE(__stop_log_const_data = .);
    <   } > FLASH
    93a88,93
    >   .log_const_data :
    >   {
    >     PROVIDE(__start_log_const_data = .);
    >     KEEP(*(SORT(.log_const_data*)))
    >     PROVIDE(__stop_log_const_data = .);
    >   } > FLASH
    

Related