This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

cause UART to crash by transmit data continuously

Our project use 51822 and another MCU stm32 to transmit heart rate data by uart. then 51822 SPP heart rate to smart phone APP. Now, We meet a issue that 51822 UART will crash if coninuously transmit data over several minutes (i.e over 5 minutes) between STM32 and 51822. STM32 UART can send data to 51822 but 51822 UART can't receive it and send ACK to STM32. Even through we re-initialization 51822 UART but it take no effect. if transmit data time less than 3 Minutes the UART seem ok. we call your callback to init UART as below:

 const app_uart_comm_params_t comm_params =
    {
        RX_PIN_NUMBER,
        TX_PIN_NUMBER,
        RTS_PIN_NUMBER,
        CTS_PIN_NUMBER,
        APP_UART_FLOW_CONTROL_DISABLED, //APP_UART_FLOW_CONTROL_ENABLED
        false,
        UART_BAUDRATE_BAUDRATE_Baud57600  
    };
APP_UART_FIFO_INIT( &comm_params,
                       256,     
                       256,     
                       uart_event_handle,
                       APP_IRQ_PRIORITY_LOW,
                       err_code);
 We try to  decrease to  baud rate 38400 from 57600 but it still not fixed it. Another, i find if increase connection interval by modfiy min and max interval range that can delay UART crash time as below:
#define MIN_CONN_INTERVAL               MSEC_TO_UNITS(8, UNIT_1_25_MS)
/*< Minimum acceptable connection interval (20 ms), Connection interval uses 1.25 ms units. */
#define MAX_CONN_INTERVAL               MSEC_TO_UNITS(10, UNIT_1_25_MS)

what cause 51822 UART crash?

  • The UART doesn't crash, it's a piece of hardware. And your last sentence doesn't really make any sense, you can't over-interrupt. The UART demonstrably works for a long time at high baud rates, the Nordic BLE sniffer for instance pumps data out at that kind of baud rate and runs for hours or days at a time.

    So you have a software issue and you need to go looking for it. Is APP_ERROR_HANDLER being called? I can't tell from what you wrote whether it is or whether it isn't. If it is, what's the error code, that will tall you what the error is.

  • Anyway, still thank you for your reply. The issue have be fixed.

  • Hi Leif,

    please let us know what and how you fixed it. This thread will be complete when others are able to read what the actual problem was and the solution for it. Thanks for your patience.

  • Hi Leif, I suppose to have the same problem with my uart on NRF51822 after a time (between 30 and 1H30), the nrf51 stop to receive frame on rx (without any error reported by the driver), the frame is sent every 5 minutes. The only way is to reset the chip by the STM32. I would like to know how you resolve your issue ?, because at current time, i've no idea what is the problem, thank you for your help.

Related