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

Failed to include app_button library to my project

Hi,

I recently started to work with the nRF52 DK (PCA10040).

I'm trying to do some experiments with PWM, so I toke the pwn library as a base and tried to add the button support by including the app_button library in to the project.

However I'm falling to do that successfully.

I tried to use the CMSIS as described here: https://www.youtube.com/watch?v=b0MxWaAjMco&index=4&list=PLx_tBuQ_KSqGHmzdEL2GWEOeix-S5rgTV , and used the code I got here: http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk5.v15.0.0%2Fsdk_config.html

However, when I open CMSIS I don't see the app_button library:



And if I try to manually add the app_button.c or app_button.h it shows empty:


I added manually the file app_button.c to the project, but it also didn't work. When I open the file it shows like this:

And I get the errors when building:

  • Hi Paulo, 

      It seems that you did not include the app_button library correct.

    (you cannot open app_button.h directly with CMIS, you have to add what you need in sdk_config.h to make it visible in CMIS)

    Please follow what is described in this Youtube tutorial instead.

  • Hello Martin,

    Thanks for your reply.

    I looked at the video tutorial. I added the files to the project:

    I edited the sdk_config.h:

    Still app_button.c shows like this:

    However, it gave me a different error when building:

    I added then the app_time.c as I did before for the app_button and edited again sdk_configh:

    Similar to app_button, the app_timer.c looks like this:



    Then, when I try to Build I get several error related with app_timer.c:



  • Hi Paulo,

     If you are having trouble adding certain things, I would recommend you to use the "Template_project" as a starting point. (found in the ["SDK\examples\peripheral\template_project"] folder.)

    It already has the libraries and drivers included, so the only thing you need to do is add:

     

     

    (if you are getting an compiling error with "micro_ecc_lib_nrf52.lib" check this thread)