I was trying to create my own sdk_config based on "$NRF_SDK/config/nrf52840/config/sdk_config.h".
I noticed it contains both the "NRFX" config and "Legacy" configs.
For example, both NRFX_RTC_ENABLED and RTC_ENABLED.
I thought that NRFX_RTC_ENABLED shall have precedence over the "legacy" one so I only defined the NRFX ones.
To my surprise the compiled .o file is empty. Then I traced to "nrfx_glue.h" and "apply_old_config.h". I noticed the legacy settings wil override the NRFX settings.
Why do you put to settings in the same file?
For example:
#if defined(RTC_ENABLED)
#undef NRFX_RTC_ENABLED
#define NRFX_RTC_ENABLED RTC_ENABLED
#if defined(RTC0_ENABLED)
#undef NRFX_RTC0_ENABLED
#define NRFX_RTC0_ENABLED RTC0_ENABLED
#endif
#if defined(RTC1_ENABLED)
#undef NRFX_RTC1_ENABLED
#define NRFX_RTC1_ENABLED RTC1_ENABLED
#endif
#if defined(RTC2_ENABLED)
#undef NRFX_RTC2_ENABLED
#define NRFX_RTC2_ENABLED RTC2_ENABLED
#endif