Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > Read from UART in Dma-mode

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



Read from UART in Dma-mode
Moderator:
RSKV

Post Reply
Follow this topic



Read from UART in Dma-mode

RobK posted on 09 May 2012 9:48 AM PST
Top Contributor
56 Forum Posts

Hi,

I want to read from the FX3's UART which is configured in DMA-mode. The according DMA-channel is set to Manual_In between the UART-producer and the CPU as the consumer.

I connected a serial cable between the FX3 eval-board and my PC.

In the firmware I use the function CyU3PDmaChannelGetBuffer() to read from the DMA-channel. On PC-side I use a simple console-program to type some signs and send it to serial-port.

Unfortunately I can't receive anything in the FX3 via the UART DMA in-channel, means I can't see any activity on UART_RX-pin of the eval-board!

Transmitting data from FX3 to PC via another UART DMA out-channel works fine!

Did anybody implemented a thing like this successfully? Where could be the failure?

Do I receive the DMA-buffer only if it's full or which event must happen that the CyU3PDmaChannelGetBuffer() returns w/ the received data?

 

regards!




Re: Read from UART in Dma-mode

AssemblyRequired posted on 09 May 2012 10:53 AM PST
Top Contributor
37 Forum Posts

Hi,


I'm assuming you set rxEnable to CyTrue when calling CyU3PUartSetConfig()?
Are you calling CyU3PUartRxSetBlockXfer()?

I would expect the RX direction to have difficulty telling when DMA operations are supposed to be marked complete. You may need to send fixed-length "packets", or switch to byte-by-byte mode.

Regards,
Steve



Re: Read from UART in Dma-mode

RobK posted on 10 May 2012 12:04 AM PST
Top Contributor
56 Forum Posts

Hi Steve,

yes, I set rxEnable of the struct CyU3PUartConfig_t to true and call CyU3PUartRxSetBlockXfer(0xFFFFFFFF)!

Yes, possibly I have to use the Byte-mode instead of DMA.

But anyhow I don't receive anything even if I type more signs than the DMA buffer-size has (32 bytes in my case) so that the buffer must be full and could be retrieved by getBuffer()-function?! So at least this should work somehow...?!

 

Best regards,

Robert



Re: Read from UART in Dma-mode

RobK posted on 10 May 2012 01:18 AM PST
Top Contributor
56 Forum Posts

Problem solved! My serial cable has a defect on the according pin.






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.