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

APP_TIMER in sdk v14 build errors when migrating from v12.3

Hello I am using PCA10040, nRF52832, and GCC toolchain

I have a project that was working good using sdk v12.3 but now I want to migrate to the latest and I am getting one particular error I have not been able to resolve.

error: 'APP_TIMER_USER_OP_SIZE' undeclared here (not in a function)

This constant does not appear in v12.3 and now in v14 it is not declared or used anywhere else in SDK v14 file structure.

What is the purpose of this? What should I set it to?

  • Hi,

    APP_TIMER_USER_OP_SIZE was used internally in the app timer library to calculate the required application timer buffer size(in bytes), based on the OP_QUEUE_SIZE that was used when initializing the app timer.

    APP_TIMER_INIT(PRESCALER, OP_QUEUE_SIZE, SCHEDULER_FUNC);
    

    In SDK 13 the static configuration of the app timer module was moved to sdk_config.h, and OP_QUEUE_SIZE was replaced with APP_TIMER_CONFIG_OP_QUEUE_SIZE (defined in sdk_config.h), and APP_TIMER_USER_OP_SIZE was no longer needed.

    The app timer is now initialized like this

    err_code = app_timer_init();
    

    Make sure that you are using both the updated app_timer.c and app_timer.h in your project.

    For more information about migrating the app timer see the migration note.

Related