Forums - csr1010 debug interface vs uart communication

2 posts / 0 new
Last post
csr1010 debug interface vs uart communication
tarun14
Join Date: 4 Jul 16
Posts: 4
Posted: Tue, 2016-08-30 04:43

Hello.

I have been developing a BLE based application on CSR1010 board. So far I was using 'DebugWriteStrings' and other related APIs to print messages on terminal application for debug purpose. But now as a project requirement, the device need to talk to an other device via Uart, for which I use 'UartWrite' and receive data in 'uartRxDataCallback' function.

I observed that now if I keep using 'DebugWritexxxxx' function calls, the other device doesn't respond for 'UartWrite' commands. Although, if I remove Debug related calls, and only use 'UartWrite' that too only to send command to that device, the device responds as per expectation. I do believe that since 'DebugWritexxx' functions also sends data via same Rx pin, I may only be able to use either of them (DebugWritexxx or UartWrite) in application. My questions are following:

1. Can we use both 'UartWrite' and 'DebugWritexxxx' related calls in same application, if yes then how should I initialize Uart? via DebugInit() by mentioning my 'uartrxDataCallback' function as uart_data_in_fn, or via UartInit() and printing my debug strings by UartWrite() api? or any other required approach?

2. If we can't use both, I will have to go with UartWrite() api and only to send command to my device. In that case, Is there any other way to print debug strings for debugging purspose (or to generate a log file). If not, any other way to debug my code? As the development is still undergoing and the issues arising are timing related, I will have to find some 'free running' way for debugging (i.e in addition to breakpoints approach).

Thanks.

  • Up0
  • Down0
tarun14
Join Date: 4 Jul 16
Posts: 4
Posted: Mon, 2016-09-12 04:36

Hello,

After trying for some time I was able to find atleast one approach (without using DebugWrite related APIs, or UartWrite) through which I was able to print data (or strings) into global variable (a big size array) that I would read using 'watch' functionality soon the code stop at added breakpoint.

I was also able to store time stamps of required events by modifying 'printCurrentTime' and 'writeASCIICodedNumber' APIs such that instead of printing data via 'DebugWritexxx' related APIs, those would store data into my global string array (for very first time stamp, copied time string into global variable using StrNCopy. then for later readings, used StrChr to search for '\0' and then StrNCopy to copy new data at that location). I even modified 'printCurrentTime' to also print time value in milliseconds, as application ran very fast and using only 'seconds' granularity wouldn't solve our purpose.

By this approach I was able to map the code flow and find the bug. Thought this would help somebody, someday so shared here. I would still like to hear from other people here, that are there any other approaches available? and suggestions on the 1. part of above comment.

 

Thanks.

  • Up0
  • Down0
or Register

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.