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

app_timer_t' has no member named 'handler' (I got this error after merge the I2c OLED project with ble_template example)

Hi.

I recently started work on some projects where I have to use I2c OLED and BLE. I used OLED to display time which is running on an internal RTC of nrf52832. 

Now I merge my Oled code with the ble_template example to advertise. But I got an error on app_timer2.c fie which is redirected some function to (drv_rtc.h). 

how I try to solve this problem but fail,..

Add the path of the file 

Enable timer

#ifndef APP_TIMER_ENABLED
#define APP_TIMER_ENABLED 1
#endif 

Error looks like:

from C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:41:
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:162:19: error: 'app_timer_t' has no member named 'handler'
2> ../../../../../../components/libraries/util/nrf_assert.h:106:9: note: in definition of macro 'ASSERT'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:165:67: error: 'app_timer_t' has no member named 'active'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:167:33: error: 'app_timer_t' has no member named 'end_val'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:169:24: error: 'app_timer_t' has no member named 'repeat_period'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:171:24: error: 'app_timer_t' has no member named 'active'
2> In file included from ../../../../../../components/libraries/log/nrf_log.h:81,
2>                  from C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:59:
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:183:75: error: 'app_timer_t' has no member named 'p_context'
2> ../../../../../../components/libraries/log/src/nrf_log_internal.h:145:70: note: in definition of macro 'LOG_INTERNAL_1'
2> ../../../../../../components/libraries/log/src/nrf_log_internal.h:138:33: note: in expansion of macro 'LOG_INTERNAL_X'
2> ../../../../../../components/libraries/log/src/nrf_log_internal.h:208:13: note: in expansion of macro 'LOG_INTERNAL'
2> ../../../../../../components/libraries/log/src/nrf_log_internal.h:280:9: note: in expansion of macro 'NRF_LOG_INTERNAL_MODULE'
2> ../../../../../../components/libraries/log/nrf_log.h:114:48: note: in expansion of macro 'NRF_LOG_INTERNAL_DEBUG'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:183:13: note: in expansion of macro 'NRF_LOG_DEBUG'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:184:20: error: 'app_timer_t' has no member named 'handler'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:184:37: error: 'app_timer_t' has no member named 'p_context'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:187:25: error: 'app_timer_t' has no member named 'repeat_period'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:187:53: error: 'app_timer_t' has no member named 'active'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:189:24: error: 'app_timer_t' has no member named 'end_val'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:189:44: error: 'app_timer_t' has no member named 'repeat_period'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:190:65: error: 'app_timer_t' has no member named 'list_item'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:196:61: error: 'app_timer_t' has no member named 'list_item'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:220:42: error: 'app_timer_t' has no member named 'end_val'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:224:74: error: 'app_timer_t' has no member named 'end_val'
2> In file included from C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer.h:71,
2>                  from C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:40:
2> ../../../../../../components/libraries/util/app_util.h:191:32: error: 'app_timer_t' has no member named 'list_item'
2> ../../../../../../components/libraries/util/app_util.h:430:32: note: in expansion of macro 'offsetof'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:254:26: note: in expansion of macro 'CONTAINER_OF'
2> ../../../../../../components/libraries/util/app_util.h:191:32: error: 'app_timer_t' has no member named 'list_item'
2> ../../../../../../components/libraries/util/app_util.h:430:32: note: in expansion of macro 'offsetof'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:260:26: note: in expansion of macro 'CONTAINER_OF'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:274:19: error: 'app_timer_t' has no member named 'active'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:340:28: error: 'app_timer_t' has no member named 'end_val'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:340:55: error: 'app_timer_t' has no member named 'end_val'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:345:36: error: 'app_timer_t' has no member named 'active'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:348:77: error: 'app_timer_t' has no member named 'list_item'
2> In file included from ../../../../../../components/libraries/log/nrf_log.h:81,
2>                  from C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:59:
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:356:91: error: 'app_timer_t' has no member named 'end_val'
2> ../../../../../../components/libraries/log/src/nrf_log_internal.h:147:70: note: in definition of macro 'LOG_INTERNAL_2'
2> ../../../../../../components/libraries/log/src/nrf_log_internal.h:138:33: note: in expansion of macro 'LOG_INTERNAL_X'
2> ../../../../../../components/libraries/log/src/nrf_log_internal.h:198:13: note: in expansion of macro 'LOG_INTERNAL'
2> ../../../../../../components/libraries/log/src/nrf_log_internal.h:277:9: note: in expansion of macro 'NRF_LOG_INTERNAL_INST'
2> ../../../../../../components/libraries/log/nrf_log.h:154:48: note: in expansion of macro 'NRF_LOG_INTERNAL_INST_DEBUG'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:356:17: note: in expansion of macro 'NRF_LOG_INST_DEBUG'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:356:108: error: 'app_timer_t' has no member named 'end_val'
2> ../../../../../../components/libraries/log/src/nrf_log_internal.h:148:24: note: in definition of macro 'LOG_INTERNAL_2'
2> ../../../../../../components/libraries/log/src/nrf_log_internal.h:138:33: note: in expansion of macro 'LOG_INTERNAL_X'
2> ../../../../../../components/libraries/log/src/nrf_log_internal.h:198:13: note: in expansion of macro 'LOG_INTERNAL'
2> ../../../../../../components/libraries/log/src/nrf_log_internal.h:277:9: note: in expansion of macro 'NRF_LOG_INTERNAL_INST'
2> ../../../../../../components/libraries/log/nrf_log.h:154:48: note: in expansion of macro 'NRF_LOG_INTERNAL_INST_DEBUG'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:356:17: note: in expansion of macro 'NRF_LOG_INST_DEBUG'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:410:36: error: 'app_timer_t' has no member named 'active'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:412:35: error: 'app_timer_t' has no member named 'active'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:413:77: error: 'app_timer_t' has no member named 'list_item'
2> In file included from ../../../../../../components/libraries/log/nrf_log.h:81,
2>                  from C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:59:
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:415:65: error: 'app_timer_t' has no member named 'end_val'
2> ../../../../../../components/libraries/log/src/nrf_log_internal.h:147:70: note: in definition of macro 'LOG_INTERNAL_2'
2> ../../../../../../components/libraries/log/src/nrf_log_internal.h:138:33: note: in expansion of macro 'LOG_INTERNAL_X'
2> ../../../../../../components/libraries/log/src/nrf_log_internal.h:198:13: note: in expansion of macro 'LOG_INTERNAL'
2> ../../../../../../components/libraries/log/src/nrf_log_internal.h:277:9: note: in expansion of macro 'NRF_LOG_INTERNAL_INST'
2> ../../../../../../components/libraries/log/nrf_log.h:154:48: note: in expansion of macro 'NRF_LOG_INTERNAL_INST_DEBUG'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:414:21: note: in expansion of macro 'NRF_LOG_INST_DEBUG'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:415:90: error: 'app_timer_t' has no member named 'end_val'
2> ../../../../../../components/libraries/log/src/nrf_log_internal.h:148:24: note: in definition of macro 'LOG_INTERNAL_2'
2> ../../../../../../components/libraries/log/src/nrf_log_internal.h:138:33: note: in expansion of macro 'LOG_INTERNAL_X'
2> ../../../../../../components/libraries/log/src/nrf_log_internal.h:198:13: note: in expansion of macro 'LOG_INTERNAL'
2> ../../../../../../components/libraries/log/src/nrf_log_internal.h:277:9: note: in expansion of macro 'NRF_LOG_INTERNAL_INST'
2> ../../../../../../components/libraries/log/nrf_log.h:154:48: note: in expansion of macro 'NRF_LOG_INTERNAL_INST_DEBUG'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:414:21: note: in expansion of macro 'NRF_LOG_INST_DEBUG'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:425:93: error: 'app_timer_t' has no member named 'list_item'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:567:8: error: 'app_timer_t' has no member named 'handler'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:568:8: error: 'app_timer_t' has no member named 'repeat_period'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:577:12: error: 'app_timer_t' has no member named 'active'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:582:8: error: 'app_timer_t' has no member named 'p_context'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:583:8: error: 'app_timer_t' has no member named 'end_val'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:585:12: error: 'app_timer_t' has no member named 'repeat_period'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:587:12: error: 'app_timer_t' has no member named 'repeat_period'
2> C:\nRF5_SDK_17.0.2_d674dde\components\libraries\timer\app_timer2.c:598:8: error: 'app_timer_t' has no member named 'active'
Build failed

I use app_timer2.c file in library folder to 

please give some suggestions to solve this issue

  • Hello,

    Could you confirm for me that you have also added the drv_rtc.c file to your project as well, and that you have defined APP_TIMER_V2 in your project preprocessor defines, like detailed in the Migration note?

    Best regards,
    Karl

  • Thanks for the answer I just added the path and enable App_time and now it's working but I have another issue now :( 

    Combine ble_app_template example with clock code which is nearly run separately.  After combining

    Code is compiled properly .. but the clock is not working, 

    When I debug the program nrf52832 kit reset when it reached the clock code. 

     bool erase_bonds;
    
        // Initialize.
        log_init();
        timers_init();
        //buttons_leds_init(&erase_bonds);
        power_management_init();
        ble_stack_init();
        gap_params_init();
        gatt_init();
        advertising_init();
        services_init();
        conn_params_init();
        peer_manager_init();
    
        // Start execution.
        NRF_LOG_INFO("Template example started.");
        application_timers_start();
    
        advertising_start(erase_bonds);
    
         //Enter main loop.
        //for (;;)
        //{
        //    idle_state_handle();
        //}
    
    
    ret_code_t err_code;
    
    //////log_init();
    APP_ERROR_CHECK(err_code);
    //clocks_start();
    gpio_init();  ///init interrupt on button 1
    
    
    ///////////oled init ////
    uint8_t address;
    uint8_t sample_data;
    bool detected_device = false;
    
    ////APP_ERROR_CHECK(NRF_LOG_INIT(NULL));
    ////NRF_LOG_DEFAULT_BACKENDS_INIT();
    
    ssd1306_init_i2c(SSD1306_CONFIG_SCL_PIN, SSD1306_CONFIG_SDA_PIN);
    ssd1306_begin(SSD1306_SWITCHCAPVCC, SSD1306_I2C_ADDRESS, false);
    
    
    NRF_LOG_INFO("TWI scanner started.");
    
    //////////////////////////
    
    //////clcok//
    
    
    
    NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;
    NRF_CLOCK->TASKS_HFCLKSTART = 1;
    while(NRF_CLOCK->EVENTS_HFCLKSTARTED == 0);
    
    
    nrf_cal_init();
    nrf_cal_set_callback(calendar_updated, 4);
    //////////////////
    
    ssd1306_clear_display();
    ssd1306_set_textsize(2);
    ssd1306_set_textcolor(WHITE);
    ssd1306_set_cursor(8, 20);
    
    
    ssd1306_putstring( "Ble_watch");
    
    ssd1306_display();
    
    nrf_delay_ms(2000);
    
    ssd1306_clear_display();
    

  • luqman said:
    Thanks for the answer I just added the path and enable App_time and now it's working

    I am happy to hear that it resolved the issue, great!

    luqman said:
    When I debug the program nrf52832 kit reset when it reached the clock code. 

    That sounds like a non-NRF_SUCCESS error code being passed to an APP_ERROR_CHECK. Please make sure to have DEBUG defined in your preprocessor defines, like shown in the included image.
      
    This will make the logger output a detailed error message whenever a non-NRF_SUCCESS error code is passed to an APP_ERROR_CHECK. Check the error code in this error message against the API Reference of the function that returned it, to see why it generated the error.

    Best regards,
    Karl

  • thanks for the answer Karl.

    I added that the the debug window shows this 

    <info> app_timer: RTC: initialized.
    <info> app: Template example started.
    <info> app: Fast advertising.
    <error> app: Fatal error

    when the code redirects to the advertising mode function this makes reset the microcontroller I don't understand.

    I use RTC0 for clock count is there any possibility that the ble advertising conflict with the RTC or maybe some thing else 

  • luqman said:
    thanks for the answer Karl.

    No problem at all, I am happy to help!

    luqman said:
    when the code redirects to the advertising mode function this makes reset the microcontroller I don't understand.

    If the microcontroller resets that usually means that a non-NRF_SUCCESS error code has been passed to an APP_ERROR_CHECK, like mentioned in my previous reply.
    Rebooting the device is the default error handling, when no specific error handling has been implemented.

    luqman said:
    I use RTC0 for clock count is there any possibility that the ble advertising conflict with the RTC or maybe some thing else 

    Yes, RTC0 is blocked by the SoftDevice. You will have to use another RTC instance.
    Try this, and let me know if it resolves your issue.

    Best regards,
    Karl

Related