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

Fails to use NRFX modules

Hi

I try to use the NRFX drivers for some GPIOTE pins and uses SDK15.2. I see a lot of posts about problems with the NRFX drivers, but I can't seem to find a conclusion.

The problem is I enable NRFX_GPIOTE_ENABLED in sdk_config.h, but it always get overwritten in the apply_old_config.h file. What is the idea with the apply_old_config.h file - it seems like it undefines everything and tries to redefine everything, but fails?

Are people not using the NFRX drivers - it seems there are a lot of probles and extra work in order to get them to work.

  • Drivers from this project is much better written.  You can configure everything at runtime. Unlike the SDK, It doesn't have thousands of conditional compilation defines.   It also supports both C & C++ code optimized and more performance than the SDK.

  • In SDK 15 the pheriperal drivers are using NRFX, however it may seem like the legacy driver are still used since the legacy API is used. E.g. in the main file of the GPIOTE example, the function nrf_drv_gpiote_init() is used, however this is remapped to the new NRX function nrfx_gpiote_init().

    In the sdk_config.h file, both of the legacy definitions and the NRFX definitions are apparent. The way I would go about this (the easy way), is to ignore the NRFX definitions and use the old legacy definitions. In the same way the legacy funtions are remapped to the NRFX functions, the legacy definitions are remapped to the NRFX definitions. For example if you set GPIOTE_ENABLED to 1 and NRFX_GPIOTE_ENABLED to 0. You will end up with NRFX_GPIOTE_ENABLED being equal to 1, due to this line in apply_old_config.h:

    #if defined(GPIOTE_ENABLED)
    
    #undef NRFX_GPIOTE_ENABLED
    #define NRFX_GPIOTE_ENABLED  GPIOTE_ENABLED

    Does this make sense, or are you even more confused? Please ask if so.

    Best regards,

    Simon

Related