Forums - CSR UartRead Additional Bytes

1 post / 0 new
CSR UartRead Additional Bytes
Join Date: 7 Nov 16
Posts: 3
Posted: Mon, 2016-11-07 18:32


In my project, data is continuously sent to the UART in packets of 6 bytes and I am reading these 6 bytes by using UartRead(6,0). Now sometimes, I am expecting a special string of data to arrive at the UART. In order to differentiate this special string from the usual 6 byte data, I need to check the first 6 bytes, which is simply accomplish with by same UartRead(6,0) as mentioned above. 

My problem is when I try to get the rest of the data - after the first 6 bytes - from that special string, the data is random and is not what I expect. Is there a way to retreive the correct data? I am using the UartRead(data_length, 0) which does not accomplish what I want. And I had also tried using the *p_additional_req_data_length (found in the uartRxDataCallback) to specify any additional bytes I want to read. This also does not give me the data I desire.

Is the problem due to the UartRead(6,0) call? Does this function store the first 6 bytes of the special string then discard the rest of the data in the UART? Is this why I get random data when I call UartRead() again or use *p_additional_req_data_length?

How should I go about retrieving the data after detecting the special string with UartRead(6,0) and given that I know the length of the data from those 6 bytes I have?


  • Up0
  • Down0

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.