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

In our application we need to receive data from two uart together

Dear Sir,
we are developing an application on the nRF52840 kit with SDK 15.0.0. We are using Keil as compiler. In our application we need to receive data from two uart together. If we use only one uart the application work fine, but if we add the second uart the firmware have a strange behavior: one of the two uart after a certain time stops to work. The time and the uart that stops are not always the same, it seems casual.
What can happen?
Attached you can find the files main.c, the nrf_serial library and the file sdk_config.h.
Please, help us because we are very worry, we need to complete the project soon.


Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include "nrf.h"
#include "nrf_drv_clock.h"
#include "nrf_gpio.h"
#include "nrf_delay.h"
#include "nrf_log.h"
#include "nrf_log_ctrl.h"
#include "nrf_drv_power.h"
#include "nrf_serial.h"
#include "app_timer.h"
#include "app_error.h"
#include "app_util.h"
#include "boards.h"
/** @file
* @defgroup nrf_serial_example main.c
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
/*$$$LICENCE_NORDIC_STANDARD<2016>$$$*/
#include "sdk_common.h"
#if NRF_MODULE_ENABLED(NRF_SERIAL)
#include "nrf_serial.h"
#if defined (UART_PRESENT)
static void event_handler(nrf_serial_t const * p_serial,
nrf_serial_event_t event)
{
if (p_serial->p_ctx->p_config->ev_handler)
{
p_serial->p_ctx->p_config->ev_handler(p_serial, event);
}
}
static void sleep_handler(nrf_serial_t const * p_serial)
{
if (p_serial->p_ctx->p_config->mode == NRF_SERIAL_MODE_POLLING)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
nrf_serial.hsdk_config.h