Quantcast
Channel: Forum - Recent Threads
Viewing all articles
Browse latest Browse all 5781

RE: Unexpected UART_EVENT_RX_CHAR and UART_EVENT_ERR_OVERFLOW

$
0
0

Hi Karol,

g_uart1.p_api->read is pointing to function R_SCI_UartRead and from the source code of R_SCI_UartRead, I find that it does nothing in async mode and non-transfer case.  Thus, g_uart1.p_api->read cannot pop out any bytes from driver-level buffer and I cannot resolve the overflow problem.

   if (g_sci_ctrl_blk[p_ctrl->channel].mode == SCI_MODE_ASYNC)

   {

       /** Read from SCI channel. */

       if (NULL != p_ctrl->p_transfer_rx)

       {

           uint32_t size = bytes / data_bytes;

           if(0xFFFF < size)

           {

               size = 0xFFFF;

           }

           /* Cast to a value acceptable by the transfer interface. */

           uint8_t const * p_src = (uint8_t const *) HW_SCI_ReadAddrGet(p_ctrl->channel, data_bytes);

           p_ctrl->rx_transfer_in_progress = true;

           err = p_ctrl->p_transfer_rx->p_api->reset(p_ctrl->p_transfer_rx->p_ctrl, p_src, (void *) p_dest, (uint16_t)size);

           SCI_UART_ERROR_RETURN(SSP_SUCCESS == err, err);

       }

       else

       {

           /** Do nothing in non-transfer case.  Bytes will come in through the callback. */

       }

   }


Viewing all articles
Browse latest Browse all 5781

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>