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

mesh sdk examples/enable uart logging

app_config.h

#define NRF_LOG_ENABLED 1
------------------
/home/shubin/electronic/firmware/nrf/nrf5_SDK_for_Mesh_v4.2.0_src/../nRF5_SDK_16.0.0_98a08e2/components/libraries/log/nrf_log_backend_interface.h:54:10: fatal error: nrf_memobj.h: No such file or directory
 #include "nrf_memobj.h"

CMakeLists:
set(LOG_INCLUDE
"${SDK_ROOT}/components/libraries/memobj"
"${SDK_ROOT}/components/libraries/balloc"
"${SDK_ROOT}/components/libraries/ringbuf"
"${SDK_ROOT}/external/fprintf"
"${SDK_ROOT}/integration/nrfx/legacy"
"${SDK_ROOT}/components/libraries/log"
"${SDK_ROOT}/modules/nrfx/drivers/include"
)
target_include_directories(${target} PUBLIC
"${LOG_INCLUDE}"
"${CMAKE_CURRENT_SOURCE_DIR}/include"

------------------
CMakeFiles/test_application_nrf52840_xxAA_s140_7.0.1.dir/home/shubin/electronic/firmware/nrf/nRF5_SDK_16.0.0_98a08e2/components/softdevice/common/nrf_sdh_ble.c.obj: In function `nrf_sdh_ble_default_cfg_set':
/home/shubin/electronic/firmware/nrf/nRF5_SDK_16.0.0_98a08e2/components/softdevice/common/nrf_sdh_ble.c:197: undefined reference to `nrf_strerror_get'
/home/shubin/electronic/firmware/nrf/nRF5_SDK_16.0.0_98a08e2/components/softdevice/common/nrf_sdh_ble.c:197: undefined reference to `nrf_log_frontend_std_1'
/home/shubin/electronic/firmware/nrf/nRF5_SDK_16.0.0_98a08e2/components/softdevice/common/nrf_sdh_ble.c:186: undefined reference to `nrf_strerror_get'
/home/shubin/electronic/firmware/nrf/nRF5_SDK_16.0.0_98a08e2/components/softdevice/common/nrf_sdh_ble.c:186: undefined reference to `nrf_log_frontend_std_1'
/home/shubin/electronic/firmware/nrf/nRF5_SDK_16.0.0_98a08e2/components/softdevice/common/nrf_sdh_ble.c:175: undefined reference to `nrf_strerror_get'
/home/shubin/electronic/firmware/nrf/nRF5_SDK_16.0.0_98a08e2/components/softdevice/common/nrf_sdh_ble.c:175: undefined reference to `nrf_log_frontend_std_1'
/home/shubin/electronic/firmware/nrf/nRF5_SDK_16.0.0_98a08e2/components/softdevice/common/nrf_sdh_ble.c:162: undefined reference to `nrf_strerror_get'
/home/shubin/electronic/firmware/nrf/nRF5_SDK_16.0.0_98a08e2/components/softdevice/common/nrf_sdh_ble.c:162: undefined reference to `nrf_log_frontend_std_1'
/home/shubin/electronic/firmware/nrf/nRF5_SDK_16.0.0_98a08e2/components/softdevice/common/nrf_sdh_ble.c:149: undefined reference to `nrf_strerror_get'
/home/shubin/electronic/firmware/nrf/nRF5_SDK_16.0.0_98a08e2/components/softdevice/common/nrf_sdh_ble.c:149: undefined reference to `nrf_log_frontend_std_1'
/home/shubin/electronic/firmware/nrf/nRF5_SDK_16.0.0_98a08e2/components/softdevice/common/nrf_sdh_ble.c:133: undefined reference to `nrf_strerror_get'
/home/shubin/electronic/firmware/nrf/nRF5_SDK_16.0.0_98a08e2/components/softdevice/common/nrf_sdh_ble.c:133: undefined reference to `nrf_log_frontend_std_1'
CMakeFiles/test_application_nrf52840_xxAA_s140_7.0.1.dir/home/shubin/electronic/firmware/nrf/nRF5_SDK_16.0.0_98a08e2/components/softdevice/common/nrf_sdh_ble.c.obj: In function `nrf_sdh_ble_enable':
/home/shubin/electronic/firmware/nrf/nRF5_SDK_16.0.0_98a08e2/components/softdevice/common/nrf_sdh_ble.c:229: undefined reference to `nrf_log_frontend_std_0'
/home/shubin/electronic/firmware/nrf/nRF5_SDK_16.0.0_98a08e2/components/softdevice/common/nrf_sdh_ble.c:231: undefined reference to `nrf_log_frontend_std_2'
/home/shubin/electronic/firmware/nrf/nRF5_SDK_16.0.0_98a08e2/components/softdevice/common/nrf_sdh_ble.c:233: undefined reference to `nrf_log_frontend_std_1'
/home/shubin/electronic/firmware/nrf/nRF5_SDK_16.0.0_98a08e2/components/softdevice/common/nrf_sdh_ble.c:254: undefined reference to `nrf_strerror_get'
/home/shubin/electronic/firmware/nrf/nRF5_SDK_16.0.0_98a08e2/components/softdevice/common/nrf_sdh_ble.c:254: undefined reference to `nrf_log_frontend_std_1'


CMakeLists:
set(LOG_ADD_EXECUTABLE
"${SDK_ROOT}/components/libraries/log/src/nrf_log_default_backends.c"
"${SDK_ROOT}/components/libraries/strerror/nrf_strerror.c"
"${SDK_ROOT}/components/libraries/log/src/nrf_log_frontend.c"
"${SDK_ROOT}/components/libraries/memobj/nrf_memobj.c"
"${SDK_ROOT}/components/libraries/balloc/nrf_balloc.c"
"${SDK_ROOT}/components/libraries/log/src/nrf_log_backend_uart.c"
"${SDK_ROOT}/modules/nrfx/drivers/src/nrfx_uarte.c"
"${SDK_ROOT}/integration/nrfx/legacy/nrf_drv_uart.c"
)
add_executable(${target}
"${CMAKE_CURRENT_SOURCE_DIR}/src/main.c"
"${LOG_ADD_EXECUTABLE}"
-----------------------------------
CMakeFiles/test_application_nrf52840_xxAA_s140_7.0.1.dir/home/shubin/electronic/firmware/nrf/nRF5_SDK_16.0.0_98a08e2/components/libraries/log/src/nrf_log_backend_uart.c.obj: In function `nrf_drv_uart_uninit':
/home/shubin/electronic/firmware/nrf/nrf5_SDK_for_Mesh_v4.2.0_src/../nRF5_SDK_16.0.0_98a08e2/integration/nrfx/legacy/nrf_drv_uart.h:470: undefined reference to `nrfx_uarte_uninit'
CMakeFiles/test_application_nrf52840_xxAA_s140_7.0.1.dir/home/shubin/electronic/firmware/nrf/nRF5_SDK_16.0.0_98a08e2/components/libraries/log/src/nrf_log_backend_uart.c.obj: In function `nrf_log_backend_uart_put':
/home/shubin/electronic/firmware/nrf/nRF5_SDK_16.0.0_98a08e2/components/libraries/log/src/nrf_log_backend_uart.c:95: undefined reference to `nrf_log_backend_serial_put'
CMakeFiles/test_application_nrf52840_xxAA_s140_7.0.1.dir/home/shubin/electronic/firmware/nrf/nRF5_SDK_16.0.0_98a08e2/components/libraries/log/src/nrf_log_backend_uart.c.obj: In function `nrf_drv_uart_tx':
/home/shubin/electronic/firmware/nrf/nrf5_SDK_for_Mesh_v4.2.0_src/../nRF5_SDK_16.0.0_98a08e2/integration/nrfx/legacy/nrf_drv_uart.h:520: undefined reference to `nrfx_uarte_tx'
CMakeFiles/test_application_nrf52840_xxAA_s140_7.0.1.dir/home/shubin/electronic/firmware/nrf/nRF5_SDK_16.0.0_98a08e2/integration/nrfx/legacy/nrf_drv_uart.c.obj: In function `nrf_drv_uart_init':
/home/shubin/electronic/firmware/nrf/nRF5_SDK_16.0.0_98a08e2/integration/nrfx/legacy/nrf_drv_uart.c:130: undefined reference to `nrfx_uarte_init'
collect2: error: ld returned 1 exit status


app_config.h

#define NRF_LOG_ENABLED 1
#define NRF_LOG_BACKEND_UART_ENABLED 1
#define UART_ENABLED 1
#define NRF_DRV_UART_WITH_UARTE 1
#define APP_UART_ENABLED 1
#define UART0_CONFIG_USE_EASY_DMA 1
#define APP_UART_DRIVER_INSTANCE 0
#define APP_FIFO_ENABLED 0
#define NRF_LOG_BACKEND_UART_TEMP_BUFFER_SIZE 64
#define NRF_LOG_BACKEND_UART_BAUDRATE 115200
#define NRF_LOG_BACKEND_UART_TX_PIN 4
#define NRFX_UARTE0_INST_IDX 1


---------------------------------------------------------

Nothing changed, compile error. What is wrong? Please, help.
Also i tried attach uart like SDK16 sample, i can't link neaded libraries.
Parents
  • Hello,

     

    Also i tried attach uart like SDK16 sample, i can't link neaded libraries.

     Does that mean that the examples doesn't compile even if you don't modify them?

    Let's take one of the errors:

    /home/shubin/electronic/firmware/nrf/nRF5_SDK_16.0.0_98a08e2/components/softdevice/common/nrf_sdh_ble.c:133: undefined reference to `nrf_strerror_get'

    This is defined in SDK16\components\libraries\strerror\nrf_strerror.c

    and it is "protected" by 

    #if NRF_MODULE_ENABLED(NRF_STRERROR)

    which is a macro saying:

    #if ((defined(NRF_STRERROR_ENABLED) && (NRF_STRERROR_ENABLED) == 1)

    So,

    1: Is nrf_strerror.c included in your project?

    2: What is NRF_STRERROR_ENABLED in your sdk_config.h file set to?

  • all examples compiles and working with no changed sources.

    But i want see logs via uart in mesh sdk examples.

    Please See the first message:

    Set option NRF_LOG_ENABLED 1 => error No such file or directory #include "nrf_memobj.h"

    CMakeLists was modified by attach needed sources including nrf_strerror.c => new error.

    You can reproduce error if try to do that with clear installed sdk.

  • You need to include the files that it is asking for. Does it work when you do the same with the "new error"?

Reply Children
Related