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

Module dependencies

Hey guys,

With the new SDK15, I find myself looking at dependency problems over and over again. Right now, I am trying to setup a simple A/D conversion using nrfx_adc. Found the nrfx_adc module, found the documentation on the infocentre. I included nrfx_adc.h in my code and first compilation: *bam* another 135 errors. Lots of undefined macro's that seem to stem from an inclusion of nrf_adc.h, which out of the blue seems to be included from I don't know where.

Is there an overview of module / header dependencies? Please, please please, add necessary header inclusions in the API descriptions in the infocentre! It would save me days!

Whilst you are at this daughnting task... could you please provide clear "how-to's" on the use of the SDK. Examples are no how-to's if there's no description of what has been changed from defaults in sdk_config.h. I would forever be in your debt if you provided dependency information on what has been set and why. 

Thanks for listening. I'm gonna dive into the "find" and "grep" output again - please send rescue troops if I'm not back after the weekend (I just may be drowned in the SDK somewhere).

Parents
  • Hi,

    I have forwarded your request on more documentation of SDK module dependencies to our SDK team. 

    I'm not sure I understand what you mean is the issue with the SAADC_ENABLED/NRFX_SAADC_ENABLED configs. The legacy layer was provided as a simple way to migrate projects to the new SDK/nrfx driver library without having to update the whole API. If you enable the legacy driver in the sdk_config.h file (SAADC_ENABLED), it is assumed that this will be used. Since this is just a legacy layer running on top of the NRFX_SAADC driver, the apply_old_config.h file makes sure the NRFX driver is enabled, as this is required for the legacy layer to work. If you want to use the new NRFX drivers, you should remove the legacy configs from the sdk_config.h file. If you switch to using the new drivers instead of the legacy layer, you should not face debugging issues due to function renaming using defines. We will migrate more examples to use nrfx drivers in future SDKS.

    Not all examples requre all sdk_config parameters, and not every config is included in the sdk_config.h files. In the examples, only the modules that is used should be enabled. The sdk_config.h file found in config directory contains most config parameters. You should feel free to use this for your project and redefine your configs using app_config.h file.

    Best regards,
    Jørgen

  • I'm not sure I understand your point. It is no problem to use a mix of new nrfx drivers and legacy drivers. The configuration is only overwritten if you have the configuration for that specific legacy driver in your sdk_config.h file. If you only have nrfx driver configs, this will be used. If you have SAADC legacy driver configs and NRFX SPIM driver configs in sdk_config.h, only SAADC NRFX driver config will be overwritten by apply_old_config.h. It is not possible to use a mix of legacy SAADC driver functions and NRFX_SAADC driver function calls as this will cause driver issues.

    The thing I could agree on is that it should be clearified that the legacy configs need to be removed (not just set to 0) from sdk_config.h when switching to NRFX drivers. This could also have been resolved in apply_old_config.h by only overwriting the settings if the legacy drivers was enabled:

    #if defined(SAADC_ENABLED) && (SAADC_ENABLED == 1)
    
    #undef NRFX_SAADC_ENABLED
    #define NRFX_SAADC_ENABLED SAADC_ENABLED

Reply
  • I'm not sure I understand your point. It is no problem to use a mix of new nrfx drivers and legacy drivers. The configuration is only overwritten if you have the configuration for that specific legacy driver in your sdk_config.h file. If you only have nrfx driver configs, this will be used. If you have SAADC legacy driver configs and NRFX SPIM driver configs in sdk_config.h, only SAADC NRFX driver config will be overwritten by apply_old_config.h. It is not possible to use a mix of legacy SAADC driver functions and NRFX_SAADC driver function calls as this will cause driver issues.

    The thing I could agree on is that it should be clearified that the legacy configs need to be removed (not just set to 0) from sdk_config.h when switching to NRFX drivers. This could also have been resolved in apply_old_config.h by only overwriting the settings if the legacy drivers was enabled:

    #if defined(SAADC_ENABLED) && (SAADC_ENABLED == 1)
    
    #undef NRFX_SAADC_ENABLED
    #define NRFX_SAADC_ENABLED SAADC_ENABLED

Children
No Data
Related