PSoC 5LP USB CDC API receive buffer expansion.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
niprc_2224616
Level 2
Level 2
Welcome!

What is the best method to access the USB CDC buffer in real time?  It has been no problem at all transmitting packets around 1kB, however, the API accessors seem to only update upon the completion of a full packet.

   

The USB CDC output is limited by memory, whereas the CDC input buffer is limited to 64kB.

   

I have source code to attach for reference if needed.

   

I also understand that this task is best suited for isochronous transfer, but there is an old driver used on the host side that is necessary.

0 Likes
4 Replies
himam_31
Employee
Employee
50 likes received 25 likes received 10 likes received

Hello,

   

The CDC data can be only accessed using API(OUT packet). Else you need to modify the component for DMA with Automatic Memory management. In that case the data will get updated to the local data buffer.

   

As per the specification the CDC interface need the data endpoints as Bulk endpoint, not isochronous. The bulk endpoint has limitation on the packet size as per the USB Full speed specification.

   

Thanks,

   

Hima

0 Likes
niprc_2224616
Level 2
Level 2
Welcome!

Hima,

   

The high speed limit is 512 bytes per the specification, correct me if I am wrong?  I have had zero issues transmitting packets this large.

   

In my experience with the USB API on the PSoC 5LP, the API(OUT) function only give me a data ready flag once the packet has been zero terminated.

   

I would like to use DMA, but I have only had success using DMA for ADC.  THe USB block is closed on the TopDesign page and manually socketing the memory is doable, but a bit more than I anticipated.  Is there a relevant example for USB CDC memory management via DMA??  About 99% of my processing time may be committed to USB polling. 

   

I would send a code snippet, but the spam filter appears to flag my commet.

   

Thank you for the time,

   

Nick

0 Likes
himam_31
Employee
Employee
50 likes received 25 likes received 10 likes received

Hello Nick,

   

PSoC have Full speed USb capability. For full speed the packets can be only 64 bytes long. We do not have a sample project for this. But creating the project is straight forward. All you need to do is use USBFS specific API's instead of the USB CDC specific APIs.

   

Thanks,

   

Hima

0 Likes
niprc_2224616
Level 2
Level 2
Welcome!

Hima,

   

Forgive some of the questions coming up.  I am generally a USB lamen protocol-wise.  I am doing this as a favor and I generally write serial protocols between systems, not PC to board.

   

The PC host that they use, requires communication through a COMM port and this board is meant for driver verification.  The Comm protocol they use is meant to send and receive 512 byte packets and that won't change.  The only thing on the chopping block is the MCU in question.  An STM32F7 can do this, but their HAL libraries are quite garbage and I will have to write most of the API myself...

   

Would it be possible to implement USBFS APIs and have them identify as a comm port?  Possibly through changing an identifying packet as well as the .inf??  

   

I have access to some hardware and I will be playing with this now, but if the limit on comm port receivals is stuck at 64 bytes, this is a non starter.

0 Likes