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

  • good, thats cleared all errors and warning .(SES). But Nothing showing in Debug Terminal . similar questions i found in this site tried still no output

    #include <stdbool.h>
    #include <stdint.h>
    #include "nrf_delay.h"
    #include "nrf_log.h"
    #include "nrf_log_ctrl.h"
    #include "nrf_log_default_backends.h"
    
    int main(void)
    {
        /* Initializing Log */
        ret_code_t err_code;
        err_code = NRF_LOG_INIT(NULL);
        NRF_LOG_DEFAULT_BACKENDS_INIT();
    
        while (true)
        {
            for (int i = 0; i < 5; i++)
            {
                NRF_LOG_INFO("BLINK");
                nrf_delay_ms(500);
            }
        }
    }

  • Hi,

    Have you enabled the following in sdk_config.h as well?

    • Log backend, either UART (NRF_LOG_BACKEND_UART_ENABLED) or RTT (NRF_LOG_BACKEND_RTT_ENABLED)
    • NRF_LOG_DEFAULT_LEVEL, this should be set to 3 for INFO

    Does NRF_LOG_INIT return NRF_SUCCESS or an error code? You can check by adding the following line after calling the init:

    APP_ERROR_CHECK(err_code);

    Best regards,

    Marte

Reply Children
No Data
Related