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

Enable PWM in SDK Mesh 2.1.1 light_switch_example (server)

Hi,

I'm having troubles adding PWM in light_switch_proxy_server example in Mesh SDK v. 2.1.1.

It seems that the PWM driver and instances are not correctly enabled, looking at the nrfx_pwm.h:





And also looking at the nrfx_pwm.c, where everything looks disabled:



Steps I have done:

1. Included header file "nrf_drv_pwm.h" in main.c

2. Edited Project Options -> Preprocessor with the path to the needed header files:

$(SDK_ROOT:../../../../nRF5_SDK_15.0.0_a53641a)/integration/nrfx/legacy

$(SDK_ROOT:../../../../nRF5_SDK_15.0.0_a53641a)/modules/nrfx/drivers/include

3. Added to the project (into the folder nRF5 SDK) the file "nrfx_pwm.c"

4. Enabled the PWM peripheral driver and PWM0 instance in the sdk_config.h:

#ifndef NRFX_PWM_ENABLED
#define NRFX_PWM_ENABLED 1
#endif

#ifndef NRFX_PWM0_ENABLED
#define NRFX_PWM0_ENABLED 1

I have done the same steps successfully for the light_switch_server (NO proxy) in Mesh 2.0.1, so I don't know what I'm missing now...

Is there any other file that needs to be edited to enable PWM?

Or there is any way to find out which file NRFX_CHECK() is looking at?


Regards,
Paulo Zacarias

Parents Reply
  • I finally found the solution here.

    I completely removed code section that as the reference to the legacy driver, PWM_ENABLED, in sdk_config:

    // <e> PWM_ENABLED - nrf_drv_pwm - PWM peripheral driver - legacy layer
    //==========================================================
    #ifndef PWM_ENABLED
    #define PWM_ENABLED 0
    #endif

    It seems that for some reason sdk_config.h  doesn't show up in the dependencies of main.c on Mesh SDK 2.0.1 proxy_server example:



    But it does for 2.1.1 and 2.2.0, maybe that's the reason why this issue only showed up in this newer releases.

    BR,
    Paulo Zacarias

Children
Related