SAM3S transfering 64B over USB in CDC mode

Discussion around product based on ARM Cortex M3 core.
This forum will be discontinued soon.

Moderators: nferre, ncollot

ugljesa.tomanovic
Posts: 8
Joined: Thu Mar 07, 2013 1:05 pm

SAM3S transfering 64B over USB in CDC mode

Thu Oct 01, 2015 10:57 am

Hi all,
I have a problem when sending packets exactly 64B long via USB in CDC mode. The code is slightly modified Atmel's example for GCC and uC is SAM3S8C and SAM3S4B.
Used endpoint for sending is EP5. Because Bulk transfer on Full speed is used endpoint size is 64B.
If packets smaller than 64B are sent everything works fine.
When packet of exactly 64B is sent it is not received by host, than if next transfer is packet <64B both packets are received.
During debugging i have observed that in both cases host acknowledges the DATA packet (TXCOMP is set to 1 in UDP_CSR5), ISR is performed and correct handler is executed.
I have also connected the logic probe on DDM and DDP lines, triggered it on start of transfer and it seems that in both cases the data was put on the line (there is a long stream of data on the line that differs in length if I send 10B or 64B).
As the problem points to the host side i have tried it on several platforms (different PCs with WinXP, Win8 and Linux and Robbery Pi with Linux) and the results were the same.

Has anybody encountered similar problem?

Regards
Ugljesa
kshysio
Posts: 25
Joined: Thu Nov 03, 2011 11:17 am

Re: SAM3S transfering 64B over USB in CDC mode

Wed Oct 28, 2015 11:29 pm

hi, I have the same prolem and don't know how to fix. My temporal solution is modifying sending procedure to split packet to not biger than 63 bytes (when packet is 64 bytes long, procedure sends 63+1 bytes).
I suspect the problem is with bank swap handling - endpoint size is 64 bytes long, and when bank is full it is switched to next one...

Return to “SAM3 Cortex-M3 MCU”

Who is online

Users browsing this forum: No registered users and 1 guest