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

NRFX_*_ENABLED is not available.

I'm working in migration from nRF51 to nRF52 and nrfx drivers. But now stucking in the errors.
There are much errors, but all of that seem to be simulaly caused by the no availability of the NRFX_*_ENABLED definition in sdk_config.h.
My environment is:
  MDK Keil uVision V5.28.0.0
  nRF5 SDK v16.0.0
I defined NRFX UARTE ENABLED 1 in the sdk_config.h.
#define NRFX_UARTE_ENABLED 1
The compile errors occurred.
compiling nrf_log_backend_uart.c...
..\..\..\..\..\nRF_SDK16\integration\nrfx\legacy\nrf_drv_uart.h(122): error:  #20: identifier "nrf_uarte_baudrate_t" is undefined
..\..\..\..\..\nRF_SDK16\integration\nrfx\legacy\nrf_drv_uart.h(127): error:  #20: identifier "nrf_uarte_error_mask_t" is undefined
..\..\..\..\..\nRF_SDK16\integration\nrfx\legacy\nrf_drv_uart.h(130): error:  #20: identifier "nrf_uarte_hwfc_t" is undefined
..\..\..\..\..\nRF_SDK16\integration\nrfx\legacy\nrf_drv_uart.h(133): error:  #20: identifier "nrf_uarte_parity_t" is undefined
..\..\..\..\..\nRF_SDK16\integration\nrfx\legacy\nrf_drv_uart.h(134): error:  #20: identifier "nrf_uarte_task_t" is undefined
..\..\..\..\..\nRF_SDK16\integration\nrfx\legacy\nrf_drv_uart.h(135): error:  #20: identifier "nrf_uarte_event_t" is undefined
The structure type definitions are actually in "nrf_uarte.h".
This header file is included in "nrfx_uarte.h"
#include <hal/nrf_uarte.h>
And this "nrfx uarte.h" hopingly be included in "nrf_drv_uart.h".
#if defined(UARTE_PRESENT) && NRFX_CHECK(NRFX_UARTE_ENABLED)
    #define NRF_DRV_UART_WITH_UARTE
#endif
#if defined(UART_PRESENT) && NRFX_CHECK(NRFX_UART_ENABLED)
    #define NRF_DRV_UART_WITH_UART
#endif
#if defined(NRF_DRV_UART_WITH_UARTE)
    #include <nrfx_uarte.h>
    #define NRF_DRV_UART_CREATE_UARTE(id) \
        .uarte = NRFX_UARTE_INSTANCE(id),
#else
But now, it seems that this #include <nrfx_uarte.h> does not work.

In another case, defined in sdk_config.h,
#define LPCOMP_ENABLED 0
#define NRFX_LPCOMP_ENABLED 1
The apply_old_config.h works correctly, the if clause is false.
#if defined(LPCOMP_ENABLED)
#undef NRFX_LPCOMP_ENABLED
#define NRFX_LPCOMP_ENABLED  LPCOMP_ENABLED
But nrfx_lpcomp.c does not work, the if clause is also false.
#if NRFX_CHECK(NRFX_LPCOMP_ENABLED)
#include <nrfx_lpcomp.h>
#include "prs/nrfx_prs.h"

Why is NRFX_*_ENABLED not available, what should I check to solve this phenomenon?
Parents
  • Hi,

    Since you are using the legacy UART driver (nrf_drv_uart.h), you need to enable the module through the legacy config:

    // <e> UART_ENABLED - nrf_drv_uart - UART/UARTE peripheral driver - legacy layer
    //==========================================================
    #ifndef UART_ENABLED
    #define UART_ENABLED 1
    #endif

    If the legacy config is defined, NRFX_UARTE_ENABLED will be redefined in the file apply_old_config.h. Note that it is not enough to set the define to 0 to prevent apply_old_config.h, you need to remove the define completely. The "#if defined()" will be false regardless of the value of the defined symbol, even "#define LPCOMP_ENABLED" would make it true.

    Best regards,
    Jørgen

Reply
  • Hi,

    Since you are using the legacy UART driver (nrf_drv_uart.h), you need to enable the module through the legacy config:

    // <e> UART_ENABLED - nrf_drv_uart - UART/UARTE peripheral driver - legacy layer
    //==========================================================
    #ifndef UART_ENABLED
    #define UART_ENABLED 1
    #endif

    If the legacy config is defined, NRFX_UARTE_ENABLED will be redefined in the file apply_old_config.h. Note that it is not enough to set the define to 0 to prevent apply_old_config.h, you need to remove the define completely. The "#if defined()" will be false regardless of the value of the defined symbol, even "#define LPCOMP_ENABLED" would make it true.

    Best regards,
    Jørgen

Children
Related