Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > Debug with UART

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



Debug with UART
Moderator:
RSKV

Post Reply
Follow this topic



Debug with UART

clh23047 posted on 28 Jun 2012 2:28 AM PST
Top Contributor
65 Forum Posts

Hello, I want to debug the SlaveFifoAsync example with UART. I found the setting process for debugging with JTAG in the programming manual. How could I debug it with UART? Are there some documents about debugging FX3 with UART?

Thanks,
Lehua Chen



Re: Debug with UART

RSKV posted on 28 Jun 2012 02:47 AM PST
Cypress Employee
655 Forum Posts

Firmware is enabled to support UART debugging.

You can use " CyU3PDebugPrint" to print messages wherever you want.

Please make sure that your DVK has these jumpers (J101,102,103,104) between 1 and 2.

Regards,

sai krishna.



Re: Debug with UART

clh23047 posted on 28 Jun 2012 03:15 AM PST
Top Contributor
65 Forum Posts

I know the UART debugging is supported in the firmware and CyU3PDebugPrint is used to print messages. But I do not know how to set the Debug Configurations. On my DVK, the jumpers (J101, 102, 103, 104) are connected correctly. The UART port is connected to a USB port with a converter. But when I tried to debug, there are always errors (shown in the attached picture). I think I did not set the Debug Configurations in the right way.

But how?
Thanks,
Lehua Chen


Re: Debug with UART

RSKV posted on 28 Jun 2012 03:41 AM PST
Cypress Employee
655 Forum Posts

Hi Lehua Chen,

you don't have to do anything with the Eclipse IDE when you are debugging with UART.

Connect the UART cable between your DVK and PC.Open the HyperTerminal in your PC and configure it as follows:

115200 - 8 - None - 1 - None.

It is just that you add the print messages wherever you want in the firmware. And build the .img file and download into the FX3 DVK.

Then you will see the messages getting printed on the HyperTerminal as per the FX3s firmware execution.

Regards,

sai krishna.

 



Re: Debug with UART

clh23047 posted on 28 Jun 2012 04:29 AM PST
Top Contributor
65 Forum Posts

Thank you for your detailed information. I misunderstood the debug process with UART at the beginning. Now it is fine.

Lehua Chen



Re: Debug with UART

clh23047 posted on 01 Jul 2012 06:14 AM PST
Top Contributor
65 Forum Posts

I debugged the Asynchronous FIFO GPIF with UART. The hardware setting was as before.

When I downloaded the firmware to the RAM, “Data tracker: buffers received: 0, buffers sent: 0” was showed in the Hyper Terminal.
 
In the USB Control Center, when I chose the Bulk out endpoint (0x01) and transferred Data-OUT (1024 Bytes or 10Bytes), “BULK OUT transfer completed” appeared. In the Hyper Terminal, “Data tracker: buffers received: 1, buffers sent: 0” was got. With UART debugger, I found that the CyFxSlFifoUtoPDmaCallback( ) was called for one time. Then I clicked “Transfer Data-OUT” again in the USB Control Center, I got “Data tracker: buffers received: 2, buffers sent: 0” and the CyFxSlFifoUtoPDmaCallback( ) was called again. After that, I clicked “Transfer Data-OUT” for the third time or more, “BULK OUT transfer failed with Error Code:997” was in the USB Control Center.  The CyFxSlFifoUtoPDmaCallback( ) would be not called any more and the Hyper Terminal always showed got “Data tracker: buffers received: 2, buffers sent: 0”.
 
When I chose the Bulk in endpoint (0x81) and transferred Data-IN (1024 Bytes or 10Bytes), I only got “BULK IN transfer failed with Error Code:997” in the USB Control Center. No change happened in the Hyper Terminal (repeating “Data tracker: buffers received: X, buffers sent: 0”) and the CyFxSlFifoPtoUDmaCallback( ) was never called.
 
Look forward to explanation and solution.
Thanks,
Lehua Chen


Re: Debug with UART

RSKV posted on 01 Jul 2012 09:42 AM PST
Cypress Employee
655 Forum Posts

  Hi Lehua Chen,

Below are my answers to your questions.

If you look at the SlaveFifoAsync example source code, DMA buffer for USB to FX3 is configured for 2*1024 Bytes in case of super speed. That is the reason why you are able to do two BULK OUT transfers. If you change the 

dmaCfg.count = CY_FX_SLFIFO_DMA_BUF_COUNT; to 

dmaCfg.count = 16;

then you can do 16 BULK OUT transfers.

On the other hand if you look at the USBBulkSourceSink example, we are discarding the buffer as soon as we get some data from USB. CyU3PDmaChannelDiscardBuffer is called when there is CY_U3P_DMA_CB_PROD_EVENT. In this case you continuously send the data. But in SlaveFifoAsync example we are not doing this. So number of BULK OUT transfers are limited to dmaCfg.count.

Coming to your next question, regarding BULK IN, again we can correlate both these examples - SlaveFifoAsync  and USBBulkSourceSink. In case of SlaveFifoAsync  example we are committing the data only when there is a CY_U3P_DMA_CB_PROD_EVENT. That is when GPIF fills the DMA buffer.

Regards,

sai krishna. 






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.