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

NRF52 SDK 15.0 issue: legacy driver layer upgrade to new nrfx driver layer

Hi,

I have some problems changing from the legacy driver to the new nrfx driver structure.

I have done the following:

1) Opened pwm example in SDK 15.0.

2) Renamed the pwm functions to nrfx_pwm from nrf_drv_pwm, likewise with relevant data structures.

3) Since I only want to run the new nrfx driver, and not the old legacy driver interface, I have made a change in the sdk_config.h: NRFX_PWM_ENABLED =1, so left it unchanged. PWM_ENABLED=1 (only for legacy driver??), and have changed it to 0.

4) Compiled the project and then get lots of compile errors, mostly that nrfx_pwm_xx functions and data structures is undeclared.

Is the intention to use both NRFX_PWM_ENABLED=1 and PWM_ENABLED=1, to use the new drivers?

I would have guessed that PWM_ENABLED=0 would disable the legacy driver layer.

If this is not your intention, I solution could be:

A) For here and now, just have PWM_ENABLED=1, even if not using legacy driver.

B) In the file apply_old_config.h, the line '#if defined(PWM_ENABLED)' could be changed to '#if PWM_ENABLED'.

Then, also consider doing this for all other relevant peripherial drivers.

Parents Reply Children
No Data
Related