2 uart dma in nrf52833 not working in a program

Hi i am developing a project on custom board with mcu as nRF52833 module. This board needs to communicate with GPS module and Sim Module, so I need to use 2 UART ports to communicate with them. I used UART DMA with 2 functions uart_event_handler and uart_config then i can communicate with my GPS module but when i duplicate these 2 functions and edit pins TX, RX => (uart_event_handler2 and uart_config2) give second UART port to communicate with sim module but I am not able to communicate with any device. I only communicate with GPS or Sim Module when enable either uart_config function in main (uart_config for GPS, uart_config2 for sim module), it wont work with any device if i enable both configuration. add here my code. please help me. I've been stuck with this problem for a week :((((. Thank you very much

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
void uart_event_handler(app_uart_evt_t * p_event)
{
static uint8_t data_array[100];
static uint8_t index = 0;
//uint8_t index = 0;
uint32_t err_code;
switch (p_event->evt_type)
{
case APP_UART_DATA_READY:
app_uart_get(&data_array[index]);
index++;
if ((data_array[index - 1] == '\n') || (data_array[index - 1] == '\r') )
{
if (index > 1)
{
printf("received %s\n",data_array);
memset(data_array, 0, sizeof(data_array));
}
index = 0;
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX