Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

Error when  i changed NRF_LOG_ENABLED from 0 to 1

Hi,

When i changed NRF_LOG_ENABLED from 0 to 1  in file sdk_config.h returns the following error

1> Linking tdoa_tag.elf
1> E:/gcc/arm-none-eabi/bin/ld: Output/Debug/Obj/tdoa_tag/app_error_weak.o: in function `app_error_fault_handler':
1> F:\VIVEK\Test Area\DWM1001C_TDoA_Tag\components\libraries\util/app_error_weak.c:59: undefined reference to `nrf_log_panic'
1> E:/gcc/arm-none-eabi/bin/ld: F:\VIVEK\Test Area\DWM1001C_TDoA_Tag\components\libraries\util/app_error_weak.c:59: undefined reference to `nrf_log_frontend_dequeue'
1> E:/gcc/arm-none-eabi/bin/ld: F:\VIVEK\Test Area\DWM1001C_TDoA_Tag\components\libraries\util/app_error_weak.c:77: undefined reference to `nrf_log_frontend_std_2'
1> E:/gcc/arm-none-eabi/bin/ld: F:\VIVEK\Test Area\DWM1001C_TDoA_Tag\components\libraries\util/app_error_weak.c:85: undefined reference to `nrf_log_frontend_std_5'
1> E:/gcc/arm-none-eabi/bin/ld: F:\VIVEK\Test Area\DWM1001C_TDoA_Tag\components\libraries\util/app_error_weak.c:91: undefined reference to `nrf_log_frontend_std_0'
1> E:/gcc/arm-none-eabi/bin/ld: F:\VIVEK\Test Area\DWM1001C_TDoA_Tag\components\libraries\util/app_error_weak.c:95: undefined reference to `nrf_log_frontend_std_1'
1> E:/gcc/arm-none-eabi/bin/ld: F:\VIVEK\Test Area\DWM1001C_TDoA_Tag\components\libraries\util/app_error_weak.c:109: undefined reference to `m_nrf_log_app_logs_data_const'
Build failed
Parents
  • my main.c  i added 

    \#include "nrf_log.h"
    #include "nrf_log_ctrl.h"
    #include "nrf_log_default_backends.h"

     APP_ERROR_CHECK(NRF_LOG_INIT(NULL));

     NRF_LOG_DEFAULT_BACKENDS_INIT();
    APP_ERROR_CHECK(NRF_LOG_INIT(NULL));
    NRF_LOG_INFO("TWI scanner.\r\n");
     NRF_LOG_FLUSH();

    still error there , so i deleted these and build same error

  • Hi,

    You must also add the files to the project as well, and not just include them in main.c. What are you using to build the project? 

    For SES you must do the following:

    • Source files: Under the project name in the Project Explorer find the directory you want to add the source file to. Right click on the directory and select Add Existing File, and find the source file to add.
    • Include files: For this you must add the path to the include file in the preprocessor definitions. Right click on your project and select Edit Options Preprocessor User Include Directories and add the path to the directory containing the header file there. Please note that this must be the correct path seen from where the project file is located, with multiple ../ in front.

    For gcc:

    • Open the Makefile
    • Add the source file to SRC_FILES
    • Add the include folder to INC_FOLDERS

    Best regards,

    Marte

Reply
  • Hi,

    You must also add the files to the project as well, and not just include them in main.c. What are you using to build the project? 

    For SES you must do the following:

    • Source files: Under the project name in the Project Explorer find the directory you want to add the source file to. Right click on the directory and select Add Existing File, and find the source file to add.
    • Include files: For this you must add the path to the include file in the preprocessor definitions. Right click on your project and select Edit Options Preprocessor User Include Directories and add the path to the directory containing the header file there. Please note that this must be the correct path seen from where the project file is located, with multiple ../ in front.

    For gcc:

    • Open the Makefile
    • Add the source file to SRC_FILES
    • Add the include folder to INC_FOLDERS

    Best regards,

    Marte

Children
No Data
Related