- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.