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?

Parents
  • 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
Reply
  • 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
Children
No Data
Related