APP UART COMMUNICATION ERROR

Hi ..i'm using nRF52832  interfacing with BG95(QUECTEL) ..when i insert my sim in the module at the time uart receiver is not working..when i remove the sim at the time uart communication is working. could You help me for this.

Parents
  • Hi,thanks for reply,, i didn't share the pins to others..this is my UART pins like,

    12--RX

    23--TX

    before sim insert it was working fine..when i put the sim and get the network registration on the quectel, at the time only didn't receive the data..but at that time also Quectel was sending the data uart..but nRF only not receiving.

    static void uart_init(void)
    {
        uint32_t                     err_code;
        app_uart_comm_params_t const comm_params =
        {
            .rx_pin_no    = 12,
            .tx_pin_no    = 23,
            .rts_pin_no   = RTS_PIN_NUMBER,
            .cts_pin_no   = CTS_PIN_NUMBER,
            .flow_control = APP_UART_FLOW_CONTROL_DISABLED,
            .use_parity   = false,
    #if defined (UART_PRESENT)
            .baud_rate    = NRF_UART_BAUDRATE_115200
    #else
            .baud_rate    = NRF_UARTE_BAUDRATE_115200
    #endif
        };
    
        APP_UART_FIFO_INIT(&comm_params,
                           UART_RX_BUF_SIZE,
                           UART_TX_BUF_SIZE,
                           uart_event_handle,
                           APP_IRQ_PRIORITY_LOWEST,
                           err_code);
        APP_ERROR_CHECK(err_code);
    }

    this is my UART init..and

    void uart_event_handle(app_uart_evt_t * p_event)
    {
        static uint8_t data_array[500];
        static uint8_t index = 0;
        uint32_t       err_code;
    
         uint32_t uart_errorsrc_reg;
    
        uart_errorsrc_reg = NRF_UART0->ERRORSRC; 
      //  printf("%8x", uart_errorsrc_reg);
    
        switch (p_event->evt_type)
        {
               case APP_UART_DATA_READY:
                //UNUSED_VARIABLE(app_uart_get(&data_array[index]));
                while((app_uart_get(&data_array[index])==NRF_SUCCESS))
                {
                index++;
                }
                   
                if ((data_array[index - 1] == '\n') ||
                    (data_array[index - 1] == '\r'))
                {
           
           string_find1(data_array,"+CREG: 0,1");
           string_find2(data_array, "+QLBS: 0");
           string_find3(data_array, "+CBC:");
           string_find4(data_array, "+QTEMP:");
           string_find5(data_array, "$GNRMC");
           string_find6(data_array,"+QMTOPEN: 0,0");
    
                    index = 0;
                }
                break;
    
            case APP_UART_COMMUNICATION_ERROR:
            nrf_gpio_pin_set(27);
            nrf_delay_ms(500);
            nrf_gpio_pin_clear(27);
            //data_check(data_array);
              //  APP_ERROR_HANDLER(p_event->data.error_communication);
                break;
    
            //case APP_UART_FIFO_ERROR:
            //  //  APP_ERROR_HANDLER(p_event->data.error_code);
            //    break;
    
            default:
                break;
        }
    }

    this one is event handler..Please help me for this.. thank you..

  • when i put the sim in slot with network registration..at that time i get framing and break error in uart..

    if(p_event->data.error_communication & UART_ERRORSRC_OVERRUN_Msk)
        {
    printf("over run\n");
        }
           if(p_event->data.error_communication & UART_ERRORSRC_FRAMING_Msk)
        {
    printf("framing\n");
        }
           if(p_event->data.error_communication & UART_ERRORSRC_PARITY_Msk)
        {
    printf("parity\n");
        }
             if(p_event->data.error_communication & UART_ERRORSRC_BREAK_Msk)
        {
    printf("break\n");
        }

  • satish kumar said:
    when i put the sim in slot with network registration..at that time i get framing and break error in uart..

    Have you checked the UART pins with a scope? Does it look like the signals are more noisy when the sim is in the slot?

    Have you tried changing the UART pins, to see if the errors occur with other pins?

  • yes i tried different pins..but its same error occured..

    sometimes it working ..but most of the time i didn't receive the data..

  • Can you provide a logic trace and/or scope image of the UART RX pin when the issue occurs?

Reply Children
Related