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

SDK13 can not find sdk_config.h

Hi,

I am trying to add saadc sample code to ble_blinky sample code. But I faced a problem. It seems that the sdk_config.h file is not recognized by the sample code. and I got this errors:

"TIMER_DEFAULT_CONFIG_FREQUENCY" is undefined "TIMER_DEFAULT_CONFIG_MODE" is undefined "TIMER_DEFAULT_CONFIG_BIT_WIDTH" is undefined "TIMER_DEFAULT_CONFIG_IRQ_PRIORITY" is undefined

I am using SDK13 sample codes, on nRF52840-PDK.

Could you please let me know about possible ways to solve the problem?

Thank you, Leila

  • Did you enable the TIMER module in sdk_config.h in the ble_blinky example by setting #define TIMER_ENABLED 1?

  • Yes, Thank you. That was the problem. Now I got another problem with Linking:

    Error[Li005]: no definition for "nrf_drv_power_init" [referenced from C:\Users\admin\Desktop\Essentim\Nordic\Downloads\SDK\SamplenRF5_SDK_13.0.0_04a0bfd\examples\ble_peripheral\experimental_ble_app_blinky\pca10056\s140\iar\_build\main.o] 
    

    Could you please let me know how it could be solved?

  • Did you enable the power peripheral driver in sdk_config.h by setting #define POWER_ENABLED 1? You also need to include the source file in your project:

    [SDK_ROOT]\components\drivers_nrf\power\nrf_drv_power.c
    
  • Thank you. The problem is solved. Another question regarding to add saadc sample code to ble_blinky; do they have the same resource? I mean they both use the same timer or so on?

    Because finally I could Make it without any errors but doesn't work efficiently. It stocks at saadc_sampling_event_init() function and get me back ":ERROE:Fatal" on serial port.

    int main(void)
    {
        // Initialize.
        leds_init();
        timers_init();
        log_init();
        buttons_init();
        ble_stack_init();
        gap_params_init();
        gatt_init();
        services_init();
        advertising_init();
        conn_params_init();
          //*
        //---------SAADC----------
        //uint32_t err_code;
    //    err_code = nrf_drv_power_init(NULL);
    //    APP_ERROR_CHECK(err_code);
    
    //    ret_code_t ret_code = nrf_pwr_mgmt_init();
    //    APP_ERROR_CHECK(ret_code);
    
        NRF_LOG_INFO("SAADC HAL simple example.\r\n");
        saadc_init();
        saadc_sampling_event_init();
        saadc_sampling_event_enable();
        ////---------SAADC----------
        //*/
        // Start execution.
        NRF_LOG_INFO("Blinky BLE_ADC example started.\r\n");
        advertising_start();
    
        // Enter main loop.
        for (;;)
        {
          
            ///---------SAADC----------
          //*
            if(m_saadc_calibrate == true)
            {
                NRF_LOG_INFO("SAADC calibration starting...  \r\n");    //Print on UART
                while(nrf_drv_saadc_calibrate_offset() != NRF_SUCCESS); //Trigger calibration task
                m_saadc_calibrate = false;
            }
            //*/
    //        nrf_pwr_mgmt_run();
    //        NRF_LOG_FLUSH();
          
            ////---------SAADC----------
            
            if (NRF_LOG_PROCESS() == false)
            {
                power_manage();
            }
        }
    }
    
  • Yes, the softdevice use TIMER0 peripheral and will block access to this for the application. You need to enable another TIMER in sdk_config.h and initialize the timer using NRF_DRV_TIMER_INSTANCE(1);.

Related