PSoC 5 USB Endpoint Maximum Packet Size

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

cross mob
ScEn_283436
Level 5
Level 5
5 sign-ins First solution authored 100 replies posted

I'm using a PSoC 5 with the Full Speed USBFS device configured as a CDC in order to simulate a serial port for use with Visual C# and LabView.

The Endpoint maximum packet size is restricted to 64 bytes. Is there a way to increase that and retain the CDC functionality?

Thank you,

Nick

0 Likes
1 Solution

Nick,

I suspect that the 64 byte endpoint is a HW limitation with the PSoC USB fixed function resource.

There is the ability to use DMA with the USB transfer.   There is documentation on how to use this in the datasheet.

With DMA, you can create a virtual endpoint size of basically what ever size you want.

Len

Len
"Engineering is an Art. The Art of Compromise."

View solution in original post

0 Likes
5 Replies
KyTr_1955226
Level 6
Level 6
250 sign-ins 10 likes given 50 solutions authored

I believe 64 bytes per BULK endpoint is a hardware limit of the PSoC.

See:

More than 64 bytes per USB transfer fails

Re: Question about the USBFS component of psoc5lp

Might be a workaround somehow?

PSoC5LP - How to send longer lines than USB CDC maximum packet size

I think in any case you still need to read in the endpoint in sets of 64-bytes, and if your total data is a multiple of 64, ensure there is a null packet at the end to signal that there is no more incoming data.

0 Likes
Len_CONSULTRON
Level 9
Level 9
Beta tester 500 solutions authored 1000 replies posted

Nick,

Why do you need more the 64 bytes?

Let's assume 64 bytes is the limit for the buffer.   You can use DMA transfer for the bytes if you need to reduce the CPU load.

Len

Len
"Engineering is an Art. The Art of Compromise."
0 Likes

Len,

I have to store 3K blocks of data in an I2C EEPROM that comes from a PC GUI app The EEPROM has 32 byte rows and data is continuous. For every byte of hex data that gets programmed into the EEPROM, there are 2 ASCII characters coming in on the USB. I attempted to do a 64 byte packet but that also holds the CR-LF, so best I can do is 62.

The work around is to just split the lines into lower and upper half and send only 32 bytes at a time.

The PSoC 5 has a load of memory, so I just thought there might be some way to expand the Endpoint. You can go less but not more.

Nick.

0 Likes

Nick,

I suspect that the 64 byte endpoint is a HW limitation with the PSoC USB fixed function resource.

There is the ability to use DMA with the USB transfer.   There is documentation on how to use this in the datasheet.

With DMA, you can create a virtual endpoint size of basically what ever size you want.

Len

Len
"Engineering is an Art. The Art of Compromise."
0 Likes

Len,

Yes, I looked into the DMA but it doesn't do me any good because the GUI will still have to send 64 bytes at a time. Burdening the CPU isn't an issue because at the time of the transfer, that's all that's happening. The way it's working is, the PSoC receives a line from the GUI, programs it into the EEPROM and reads it back out before processing the next line. It's just a bummer that I have to split the line in half because with the CR-LF, you can only get 62 characters. Oh well, I told the GUI programmer that we were beating on a poor little micro and there might be limitations, just didn't know what they were at the time. He wanted to blast the whole block.

Cool stuff to know though.

Nick

0 Likes