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

sdk_config.h inconsistency

Can a single sdk_config file that has all possible macros definitions to use with an SDK

(1) be provided ?

(2) so that an identical sdk_config file be inserted in all examples - so it is easy for customers to merge different examples to make their projects easily. 

What we have now is scrambled sdk macros spread in different examples. [This means example projects does not have all the sdk_config parameters which defeats the purpose of having and sdk_config. altogether].

A huge amount of time is wasted just trying to identify and getting a working sdk_config file. This can be avoided with a single sdk_config that has all parameters. 

using: SDK V15

Secondly:

The aspect of config for logging.

config for logging doesn't have to be mixed with SDK config - which now bloats the sdk_config.h file.

My suggestion is to consider a separate log_config.h to be provided.

Actually this separation is better, configuring logging has nothing to do with configuring SDK.

Then why should logging parameters be mixed in same config file making unnecessary development time spent to clarify clutter by customer?

Parents
  • Hi,

    (1) There are sdk_config.h template files in SDK 15, found at <sdk folder>/config/<nrf variant>/config/sdk_config.h.

    (2) Our goal is that all the examples have all the options in their sdk_config.h. If not then it is a bug. Note however that what those settings are set to will differ, depending on the needs of the particular example. If you merge functionality from separate examples, or add a module to the project, you must change the settings accordingly.

    I will register the suggestion of putting log configuration in a separate file, although one might argue that it would defeat the purpose of having one configuration file for the project. Note that you can do this separation manually if you set the USE_APP_CONFIG flag and put log related settings in app_config.h. (All of the settings in sdk_config.h can be overridden, either by adding the setting as a project flag/define, or by the method of setting USE_APP_CONFIG and using an app_config.h file.)

    Regards,
    Terje

  • (I know this is old, but it just came up as a 'Related' topic)

    Our goal is that all the examples have all the options in their sdk_config.h.

    They most certainly do not:

    https://devzone.nordicsemi.com/f/nordic-q-a/45366/missing-defines-in-generic-sdk_config-h

Reply Children
  • Hi,

    Thank you for the pointer to the new thread. We are aware of the situation, and hopefully we can sort it out sooner rather than later. Our intention is that at least the generic sdk_config.h contains the full set of defines, and that should preferably be the case also for the ones used in the examples.

    Regards,
    Terje

  • Hi,

    I think with SDK 16 this is still inconsistent, which is very irritating and confusing. I am just trying to find a "full" sdk_config.h for a new project, but already the ble_app_template for pca10040 (=nrf52832) has a different one compared to top level config for nrf52832. See nRF5_SDK_16.0.0_98a08e2\examples\ble_peripheral\ble_app_template\pca10040\s132\config\sdk_config.h vs. nRF5_SDK_16.0.0_98a08e2\config\nrf52832\config\sdk_config.h. The first contains additionally e.g. NRF_BLE_CONN_PARAMS_ENABLED, NRF_BLE_GATT_ENABLED and NRFX_*, nRF_Segger_RTT blocks, the latter has a lot of ANT blocks and misses some NFC settings.

    When will this be cleaned up, so that all examples and "top level" sdk_config.h are content-wise really "full" i.e. complete regards all possibilities (with default=off) and diff-able (same content, keep same order)? This would make comparing and merging examples much much more easier ...

    Can you name me the actual "full" sdk_config.h for nrf52832 and S132 (if this makes a difference) I should use for a new project?

  • Hi,

    The file at <SDK root folder>/config/<device>/config/sdk_config.h should contain all settings.

    Regarding what is (and is not) included in the various examples, as well as the point on ordering, I will tell the developers.

    Regards,
    Terje

  • Please fix this sooner rather than later. It's obviously been an issue for a long time, and is still a mess in version 16.

    The 'generic' sdk_config.h is far from comprehensive, and has duplicates (`grep "#define" sdk_config.h | sort | wc -l` vs `grep "#define" sdk_config.h | sort | uniq | wc -l`). 

    The 'generic' sdk_config.h for the nRF52840 has 1149 unique defines. The 'template' (examples/peripherals/template) sdk_config.h has 968 unique defines. Together, they have a combined 1318 unique defines. Adding in ble_app_template/../sdk_config.h brings the total to 1352 unique defines.

    Across all the config files for the nRF 52840 DK, it appears there are 1735 defined parameters:

    $ find . -path '*/pca10056/*' -name sdk_config.h -exec grep "#define" {} + | cut -d ' ' -f 2 | sort | uniq | wc -l
    > 1735

    Also, FWIW, roughly 1/3 of that is logging:

    $ grep -v -e LOG -e DEBUG_COLOR -e INFO_COLOR nrf52840_sdk_config.h | wc -l
    > 1169
    $ grep -e LOG -e DEBUG_COLOR -e INFO_COLOR nrf52840_sdk_config.h | wc -l
    > 566

    For the nRF52 DK there are 1815 defined parameters in total, but only 1254 in the 'generic' sdk_config.h

    Now I recognize that the 'generic' config might not contain parameters specific to the DK boards intentionally, but then please update the 'template' examples appropriately, as they are most definitely targeting the dev kits.

  • Hi,

    Thank you for the detailed reporting. I have notified the developers.

    Regards,
    Terje

Related