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

UART Logging on NRF52832

Hi everyone,

I'm currently trying to the get UART logging running on the NRF52832, but fail to get the SDK working.

My settings are as follows:

#define NRFX_UARTE_ENABLED 1
#define NRFX_UARTE0_ENABLED 0
#define NRFX_UART_ENABLED 1
#define NRFX_UART0_ENABLED 0
#define UART_ENABLED 1
#define UART0_ENABLED 1
#define NRF_LOG_ENABLED 1
#define NRF_LOG_BACKEND_UART_ENABLED 1
#define NRF_LOG_BACKEND_UART_TX_PIN 32
#define NRF_LOG_BACKEND_UART_BAUDRATE 10289152
#define NRF_LOG_BACKEND_UART_TEMP_BUFFER_SIZE 512

My code looks as follows:

#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>

#include "nordic_common.h"

#include "app_error.h"

#include "nrf_log.h"
#include "nrf_log_ctrl.h"
#include "nrf_log_default_backends.h"

int main() {
  ret_code_t err_code = NRF_LOG_INIT(NULL);
  APP_ERROR_CHECK(err_code);

  NRF_LOG_DEFAULT_BACKENDS_INIT();

  for (;;) {
    NRF_LOG_PROCESS();
  }

  return 0;
}

With this, I get the following error:

/opt/tools/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld: CMakeFiles/nrf5_nrfx_uart.dir/opt/tools/nrf/sdks/16.0.0/modules/nrfx/drivers/src/nrfx_uart.c.obj: in function `UARTE0_UART0_IRQHandler':
nrfx_uart.c:(.text.UARTE0_UART0_IRQHandler+0x0): multiple definition of `UARTE0_UART0_IRQHandler'; CMakeFiles/nrf5_nrfx_uarte.dir/opt/tools/nrf/sdks/16.0.0/modules/nrfx/drivers/src/nrfx_uarte.c.obj:nrfx_uarte.c:(.text.UARTE0_UART0_IRQHandler+0x0): first defined here
collect2: error: ld returned 1 exit status

I've also tried multiple settings, but nothing works. Actually, I am not even sure what UART driver I'll need (UART, NRFX_UART or NRFX_UARTE).

Thanks in advance and best regards!

Related