Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > Flakey Debug Messages over UART

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



Flakey Debug Messages over UART
Moderator:
RSKV

Post Reply
Follow this topic



Flakey Debug Messages over UART

oliverks posted on 02 Nov 2011 4:46 PM PST
Senior Member
12 Forum Posts

 We are using the standard UART debug facility.  However we have disabled the preample.

 

    CyU3PDebugPreamble(CyFalse);

 
We have found that makes things work better.  We are connecting to the UART over a USB to Serial converter.  Sometimes when we download our code the UART seems to work, and sometimes we get partial or garbled messages.

 

Has anyone else seen this problem?

 

We are seeing this on 2 different boards, so we don't think it is hardware related.  Does anyone have any suggests as to why this might be failing.  We see different behavior just download the code to the board a few times, without any rebuilds or changes.

 

Oliver

 

 




Re: Flakey Debug Messages over UART

aasi posted on 02 Nov 2011 05:37 PM PST
Cypress Employee
1073 Forum Posts

 Hi Oliver,

Rephrasing your above post,

UART print doesn't seem to work right all the time. Garbled messages and partial messages are seen from time to time. If the preamble is disabled everything works fine. Is my understanding right?

Have you tried using it with a dedicated serial port rather than through a USB to serial converter? Just wanted to isolate the issue rather than having unknown variables in the equation.

Regards,

Anand



Re: Flakey Debug Messages over UART

Sil posted on 03 Nov 2011 08:40 AM PST
Top Contributor
93 Forum Posts

On my DevBoard the RTS and CTS connections were wrong. Maybe this also your problem.

 

-Silvio



Re: Flakey Debug Messages over UART

oliverks posted on 04 Nov 2011 11:34 AM PST
Senior Member
12 Forum Posts

We don't have any USB 3.0 computers with UARTs on them these days.  We have used 3 different brands of serial convertors, but they might all be based on variants of the FTDI chip.

 

Disabling the preamble seems to help (but that might be confirmation bias) but it certainly does not fix the problem.

 

We are setting up the UART with these options

    /* Set UART Configuration */

    uartConfig.baudRate = CY_U3P_UART_BAUDRATE_115200;

    uartConfig.stopBit = CY_U3P_UART_ONE_STOP_BIT;

    uartConfig.parity = CY_U3P_UART_NO_PARITY;

    uartConfig.txEnable = CyTrue;

    uartConfig.rxEnable = CyFalse;

    uartConfig.flowCtrl = CyFalse;

    uartConfig.isDma = CyTrue;

 
So I think the CTS and RTS should not be an issue.
 
 
We have noticed some other things. If we only have occasional prints this seems to help.  Adding sleeps sometimes helps after calling CyU3PDebugPrint.
 
 
My suspcion is the debug print runs at a very low prioirty and screws up if it does not get serviced enough.
 
 
Oliver



Re: Flakey Debug Messages over UART

Sil posted on 04 Nov 2011 02:53 PM PST
Top Contributor
93 Forum Posts

I am also using a USB to Serial converter and my symtoms where very similar to yours. Since RTS and CTS signals where connected wrong, the Host was driving against the FX3 board and the RS232 converter on the FX3 board got disturbed. It's easy enough to check: Just hook up a scope on the RTS and CTS lines.

-Silvio



Re: Flakey Debug Messages over UART

DamL posted on 30 Jan 2012 05:22 AM PST
Senior Member
18 Forum Posts

Hi,

I experience same problem. With former versions of SDK, no problem I could see debug messages correctly.

I don't know if this is related to, but ARM GCC version was 4.4.1 and SDK was 466 to 540.

With newer version of SDK (630), it is impossible to see any debug message although debug string are present in the .img file. I have pined the input of the serial to usb converter : there is nothing sent from FX3 so this is not related to some problem with RTS/CTS.

I've tested the simplest examples from firmware example (such as GpioApp) that were perfectly working with former SDK versions but now it is not possible to get such a simple out as "hello world\n".

I'm working in 16 bits mode (exactly as in GpioApp example) and I'm waiting for a solution to solve this.

Best Regards.



Re: Flakey Debug Messages over UART

RobK posted on 31 Jan 2012 07:46 AM PST
Top Contributor
56 Forum Posts

Hi oliverks,

I saw the same issues (incomplete debug messages) and used the same workaround to add some sleeps before printing debug-messages. Seem to be a (maybe interrupt?) priority-issue of FX3's- hardware?!

Regards,
Rob

 






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.