AnsweredAssumed Answered

STM32F103 Uart 921600 System Hangup

Question asked by patel.pritesh on Oct 20, 2017
Latest reply on Oct 22, 2017 by Clive One

I am using STM32F103ZF with Keil RTX RTOS on it. I have a UART configured at 921600 baud. I am sending about 2000 bytes a second and receive about 200 bytes every 5 second. What I am observing is I can transmit fine for days without a problem but if I start receiving 200 bytes every 5 second, some time system locks up after a random period ranging from 5 min to few hours. Using the debugger I can see SysTickTimer not increment, tasks don't switch, no hard faults but ISRs (timers & uarts) triggering. If I do not receive any data on this uart, no lockups ever. I have narrow down issue to receiving any data on this uart.

Is there any issue with running uart at 921600 baud (1Mbit)?

Why would it stop System Tick Timer? and How do I restart without rebooting?

 

Here is the part of the code:

 

/**

 *

 */

#ifdef USART2

void USART2_IRQHandler(void)

{

  static uint8_t ChB;

 

  if(USART_GetITStatus(USART2, USART_IT_TXE) != RESET)

  {

    if (CBUF_Getch(&UsartBOutCBuf, &ChB))

    {

      USART_SendData(USART2, ChB);

    }

    else

    {      

      USART_ITConfig(USART2, USART_IT_TXE, DISABLE);

    }

  }

 

  if((USART_GetITStatus(USART2, USART_IT_RXNE) != RESET) ||

     (USART_GetITStatus(USART2, USART_IT_ORE) != RESET))

  {

    ChB = USART_ReceiveData(USART2);

    CBUF_Putch(&UsartBInCBuf, ChB);

  }

}

#endif

 

/**

 *

 */

__task void task_smpp(void)

{

    OS_RESULT result;

    uint16_t myTaskId;

 

    myTaskId = TASKID_SMPP;

 

    for (;;)

    {

        TASKCNT_SMPP++;

 

        SMPP_WriteFrame();

        SMPP_ReadFrame();            

        os_dly_msec(1000);

    }

}

 

I need to resolve this ASAP. I will appreciate any insight on this issue.

Outcomes