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

Again messing with the nrfx drivers, glue and error headers.

Hello there,

I created a project a while ago with the SES and the SDK 15.x. For a new Project, we would like to move to PlatformIO. Right now I am evaluating where we will use some available frameworks/libraries or create local libraries.

I am trying to integrate the nrfx drivers into the project. So I downloaded the SDK and after about 10 minutes some horror memories came back to my mind :D

So what I have done:

Downloaded the SDK 16.0.0
Copied the modules\nrfx folder into the project
Copied the nrfx_config.h from modules\nrfx\templates\nRF52840
A tried to reuse my old glue and log headers but they seem to be different, so I went back to the Documentation and found that for the SDK the files from integration should be used
So I copied the nrfx_log.h nrfx_glue.h from the integration\nrfx folder into the project, I skipped the legacy folder in hope it will not be needed. (You should never hope, it is needed)
So i copied the legacy folder as well
I found that nrfx_common.h file includes nrf.h files from the MDK folder (I am a bit disappointed since I was hoping that all the needed sources are located in the modules\nrfx directory)
I included the MDK directory
Now I recognized the nrfx_glue.h includes the nrf_assert.h file from the components\libraries\util (At this point I am just adding includes paths out of disappointment)
Compiled again and found that "nrf_error.h" included from In file included from util/app_error.h:57:0,
from util/app_util_platform.h:60,
from include/nrfx_glue.h:182,
from nrfx/nrfx.h:46,
from src\nrfx\drivers\nrfx_adc.c:41:

At this point I gave up as the above way seems not to be the right way to use nrfx standalone.
How is it done? Thanks

Parents Reply Children
  • This issue has wasted untold hours for us, mostly due to migrating across versions from 14.2 to 15.2, 15.3 and 16.0. I monitor nRFx on github for updates, but sometimes a simple override helps. Here is an example (nRF52840 with SPI3, but nRF52832 is same general idea):

    // Example:
    // Add "FEATURE_REQUIRE_NRFX_SPIM3" to the project preprocessor definitions
    
    // Add this at the top of sdk_config.h:
    #if defined(FEATURE_REQUIRE_NRFX_SPIM3)
    #define SPIM_PRESENT               1
    #define NRF_SPI_ENABLED            1//0
    #define NRFX_SPI_ENABLED           1//0
    #define NRF_SPIM3_ENABLED          1//0
    #define NRFX_SPIM_ENABLED          1//0
    #define NRFX_SPIM3_ENABLED         1//0
    #define NRFX_SPIM_EXTENDED_ENABLED 1//0
    #endif

    There is also a _glue and _legacy header which might require using (in this case) FEATURE_REQUIRE_NRFX_SPIM3 as a conditional, I forget but will edit later if it comes to mind.

  • I think that is what i was missing! I will mark as solved as soon as i can test it, but it seems to be the way it did it with the last project in SES aswell.

    Thanks.

Related