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

NRF52832 MESH with UART

want to add UART communication to nRF52832 with mesh enable.

I have added,

  • nrf_drv_uart.c
  • nrfc_prs.c
  • nrfc_uart.c
  • nrfc_uarte.c

files into nRF_Drivers folder in project and added User include directories for them and also I have added

  • app_fifo.c
  • app_uart_fifo.c
  • retarget.c

files into nRF_Libraries folder in project and added User include directories also for them

In sdk_config.h I have made following settings,

  • NRFX_UARTE_ENABLED 1
  • NRFX_UARTE0_ENABLED 1
  • NRFX_UART_ENABLED 1
  • NRFX_UART0_ENABLED 1
  • NRFX_PRS_ENABLED 1
  • NRFX_PRS_BOX_4_ENABLED 1

and

  • UART_EASY_DMA_SUPPORT 1
  • UART_LEGACY_SUPPORT 1

And project also compiled after setting above configurations.

Code I made as follow (Modified version on light switch server )


Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "app_uart.h"
#if defined (UART_PRESENT)
#include "nrf_uart.h"
#endif
#if defined (UARTE_PRESENT)
#include "nrf_uarte.h"
#endif
#define UART_TX_BUF_SIZE 256 /**< UART TX buffer size. */
#define UART_RX_BUF_SIZE 256
/*
other functions same as light switch server example
*/
void uart_event_handle(app_uart_evt_t * p_event)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Following result got through debugging,

Fullscreen
1
2
3
4
5
6
7
<t: 0>, main.c, 438, ----- BLE Mesh Light Switch Server Demo -----
<t: 13810>, main.c, 380, Initializing and adding models
<t: 13813>, main.c, 224, App OnOff Model Handle: 2
<t: 18763>, main.c, 479, Device UUID : 005955AA00000000E5F8D4197B5E9BA2
<t: 245432>, main.c, 308, Handler
<t: 245433>, main.c, 331, Communication ERROR
<t: 245436>, app_error_weak.c, 119, Mesh error 4 at 0x00000000 (:0)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

according to above result once development board receive a signal through RX pin uart_event_handler function calls as expected, and inside that handler I got APP_UART_COMMUNICATION_ERROR

So what would be the cause for this error.

Is there any .c file missing or something with the code