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

Compile errors when calling NRFX_UARTE_INSTANCE

I am trying to develop a simple uart driver based on the nrfx_uarte driver but I get compiling errors (see below).

All I have is a simple uartOpen() function for now that is supposed to initiate the nrfx_uarte driver. I know the error source is the "NRFX_UARTE_INSTANCE(NRFX_UARTE0_INST_IDX)" call because if I comment it out the project build fine but I don't know why. I made sure that the UART/UARTE drivers are added/enabled in the std_config.h. I attached the file for your reference. Any help you can provide would be really useful bc this whole business with different examples having different std_config.h and the legacy driver / nrfx makes the setup a bit confusing. Thanks!

#include "uart.h"
#include "nrfx_uarte.h"
#include "nordic_common.h"
#include "sdk_errors.h"

bool uartOpen(void)
{
  nrfx_uarte_t * const uartInst = NRFX_UARTE_INSTANCE(NRFX_UARTE0_INST_IDX);
  nrfx_uarte_config_t config = NRFX_UARTE_DEFAULT_CONFIG;
  uint32_t err_code = nrfx_uarte_init(uartInst, &config, NULL);

  return true;
}

 sdk_config.h

Related