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

Merging pwm and app timer gives error

Hello,

Following is my development environment

IDE: Segger
SDK: 16
SoftDevice: S132

Right now, we are trying to merge the following two examples.

- examples/peripheral/nrf5-application-timer-tutorial-master (This is the custom default project, I am uploading its file over here for your reference)


- examples/peripheral/pwm_library (This is the default example which we are using)

- This is the merged project which we are using (Please download it here)

Have made the essential changes by enabling the timer in config file as under:

#define TIMER_ENABLED 1
#define TIMER0_ENABLED 1


Now, the PWM is getting initialized using

APP_PWM_INSTANCE(PWM1, 1);          // Create the instance "PWM1" using TIMER1.


But when I try to enable the pwm for buzzer by using the following code:

app_pwm_init( &PWM1, & pwm1_cfg, pwm_ready_callback);


It gives the following errors:

Output/app_timer_tutorial_pca10040_s132 Release/Obj/app_pwm.o: In function `app_pwm_enable':
undefined reference to `nrfx_timer_clear'
undefined reference to `nrfx_timer_enable'

Can you please let me know what mistake am I doing or how do I fix this one?

Parents
  • Hi,

    The "undefined reference to" errors means that the functions with this error have not been compiled. This could be either because they were removed by the preprocessor, typically because of an incorrect sdk_config.h configuration, or that the file that implements them is not added to the project. The latter is the case here, and you can fix the issue by adding nrfx_timer.c (from <SDK>\modules\nrfx\drivers\src\) to the project.

Reply
  • Hi,

    The "undefined reference to" errors means that the functions with this error have not been compiled. This could be either because they were removed by the preprocessor, typically because of an incorrect sdk_config.h configuration, or that the file that implements them is not added to the project. The latter is the case here, and you can fix the issue by adding nrfx_timer.c (from <SDK>\modules\nrfx\drivers\src\) to the project.

Children
No Data
Related