- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
A few years ago I was able to get a PSoC 5 to transfer 512 bytes per USB frame using the CDC interface. Now I am trying to the same think with the PSoC 62 in Modus toolbox 1.1. I can transfer 64 bytes without any problems, but 128 bytes fails to transfer any data. I've done into the USB end point descriptor and increased both the IN and OUT endpoints from 64 bytes to 128 and 256. This doesn't have any effect. I can open the CDC device on the Windows side, but no data is being transferred. Has anyone else been able to get this to work?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The USBFS hardware block in PSoC 6 is limited to 64 bytes when the endpoint is configured as BULK.
PSoC 5LP has the same limitation, so perhaps what happened was that your host requests multiple packets of 64 bytes in a single frame.
Have you tried to use the exact same driver and host? It should work with PSoC 6 as well, though you will be sending chucks of 64 bytes in either case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
In the "USBCommDevice" named Code Example available in Modus toolbox 1.1 for PSoC62 implementing USB CDC, just change this line of code:
from:
Cy_USB_Dev_CDC_PutData(USBUART_COM_PORT, (uint8_t *)msg, strlen(msg),&USBUART_cdcContext);
to
Cy_USB_Dev_CDC_PutString(USBUART_COM_PORT, msg, 1000,&USBUART_cdcContext);
inside function "PrintMessage(const char msg[])" definition
I did so and was able to send strings of length greater than 64 bytes.
Because that is the way you were able to send string of length greater than 64 bytes for PSoC5LP earlier as stated in this Forum thread too:
PSoC5LP - How to send longer lines than USB CDC maximum packet size
Full-Speed capable devices support a maximum packet size of 64-bytes for Bulk endpoint..
Thanks,
Ankita
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for your response. In my application I'm not transmitting strings. The syntax for put_string is: cy_en_usb_dev_status_t
Cy_USB_Dev_CDC_PutString(uint32_t port, char_t const *string, int32_t timeout, cy_stc_usb_dev_cdc_context_t *context)
The function is looking for a NULL terminated string, which I don't have. I did another experiment (albeit transmitting strings), where I transmit the length of the string, followed by a string that makes up that length. Below is the result.
020:AAAAAAAAAAAAAA
021:AAAAAAAAAAAAAAA
022:AAAAAAAAAAAAAAAA
023:AAAAAAAAAAAAAAAAA
024:AAAAAAAAAAAAAAAAAA
025:AAAAAAAAAAAAAAAAAAA
026:AAAAAAAAAAAAAAAAAAAA
027:AAAAAAAAAAAAAAAAAAAAA
028:AAAAAAAAAAAAAAAAAAAAAA
029:AAAAAAAAAAAAAAAAAAAAAAA
030:AAAAAAAAAAAAAAAAAAAAAAAA
031:AAAAAAAAAAAAAAAAAAAAAAAAA
032:AAAAAAAAAAAAAAAAAAAAAAAAAA
033:AAAAAAAAAAAAAAAAAAAAAAAAAAA
034:AAAAAAAAAAAAAAAAAAAAAAAAAAAA
035:AAAAAAAAAAAAAAAAAAAAAAAAAAAAA
036:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
037:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
038:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
039:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
040:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
041:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
042:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
043:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
044:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
045:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
046:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
047:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
048:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
049:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
050:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
051:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
052:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
053:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
054:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
055:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
056:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
057:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
058:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
059:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
060:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
061:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
062:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
063:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
It never transmits another USB packet. This appears to be a bug in either the silicon or the PDL code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The USBFS hardware block in PSoC 6 is limited to 64 bytes when the endpoint is configured as BULK.
PSoC 5LP has the same limitation, so perhaps what happened was that your host requests multiple packets of 64 bytes in a single frame.
Have you tried to use the exact same driver and host? It should work with PSoC 6 as well, though you will be sending chucks of 64 bytes in either case.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I just used the Windows 10 driver. I created a new USBCommDevice example app, then I went in and modified the IN end point to 256 bytes and the OUT end point to 128 bytes. If I set both end points to 256 bytes the device fails to enumerate.
I was then able to transmit up to 128 bytes at a time. Using Wireshark, I monitored the USB bus and I see the following packets transferred:
Then I start to see malformed packets. For some reason, my other application that transferred binary data, can't transfer more than 64 bytes per call to Cy_USB_Dev_CDC_PutData.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Again, the hardware does not support sending/receiving more than 64 bytes in BULK mode. This might explain why you often get the malformed packets. The enumeration might well works, but not the actual transfer in the data endpoints will fail, eventually.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Gotcha. I understand. I have it working by doing the following: void SendUSBDataIn64ByteChunks(const int data[], int len) { if (Cy_USB_Dev_CDC_IsReady(USBUART_COM_PORT, &USBUART_cdcContext)) { for (int i = 0; i < len; i += 64) { Cy_GPIO_Set(USB64_PORT, USB64_PIN); while (!Cy_USB_Dev_CDC_IsReady(USBUART_COM_PORT, &USBUART_cdcContext)) {}; Cy_USB_Dev_CDC_PutData(USBUART_COM_PORT, (uint8_t *)data + i, 64, &USBUART_cdcContext); Cy_GPIO_Clr(USB64_PORT, USB64_PIN); } } } Thank you.