Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

error[li005] while adding PWM to BLE project

hi, im new to to work on nrf52 ,

i took the BLE example and complied it - it works. i tried adding PWM to the project from examples. i also added the app_pwm files from the C/C++ compiler Preproccessor.

when i compile i get errors that there is no definition but when i look for the definition it opens the app_pwm.c file and marks it.

what am i doing wrong?

  • Hello,

    What SDK are you using, and into what example are you trying to include it?

    Have you enabled PWM from sdk_config.h?

    You have to look for #define APP_PWM_ENABLED 0 in sdk_config.h, and change it to #define APP_PWM_ENABLED 1

    If you can't find APP_PWM_ENABLED in sdk_config.h it may have been stripped from that example. If you check the example located in SDK\examples\ble_peripheral\ble_app_template\... you will find all the defines in sdk_config.h, and you can copy the ones you need from there.

    The reason you need this enabled is, as you see in the top of app_pwm.c, it checks for 

    #if NRF_MODULE_ENABLED(APP_PWM)
    So if APP_PWM_ENABLED is not 1, everything between 
    #if NRF_MODULE_ENABLED(APP_PWM)
    ...
    #endif
    will not be included when the project is compiled, which is basically the entire app_pwm.c file.
    regards,
    Edvin
  • thanks Edvin.

    i found the PWM_ENABLED and activated it with "1", but now im getting many more errors that have the same problem

    any suggestions ?

  • They are all similar issues. I see that many of them refer to the nrf timer driver.

    It means that you have to do the same for the variables that the linker can't find. First make sure that you have all the .c and .h files that it requires. If you still get the error, check if there is an #ifdef near the top of the .c files. If there is, you should add it in your sdk_config.h file.

    If you are unsure in what file the variable or function it is missing is decleared, check in the PWM example, as it should have them included already.

    As I mentioned in the previous reply, note that some of the defines may not be included in sdk_config.h. If that is the case, copy paste it from the PWM project, or the ble_app_template project.

Related