Freescale USB CDC problem receiving the second time

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Freescale USB CDC problem receiving the second time

403 Views
punitkumar
Contributor IV

Hi

I'm using Kinetis K64 MCU with freescale USB stack 4.1.1 for USB CDC device (baremetal).

The code is working but only for first receive (connected the virtual serial port to PC terminal), but when i tried to send more bytes ( or even 1 byte), i got nothing to the MCU side.

The way out i've found is i need to send some dummy thing out form MCU USB whenever i received something and after that i can receive the next time.

Can someone identify what the problem is and how to solve?

Thanks in advance

Punit Kumar

Labels (2)
0 Kudos
1 Reply

271 Views
isaacavila
NXP Employee
NXP Employee

Hello PK,

have you made some modifications on example project? Example is using an specific logic that is as follows:

  • After enumeration, device requests to receive data.
  • Once data is received, this data is copied in another auxiliar buffer and then it is sent back to host.
  • Once data is sent, device requests for more data and cycle is repeated.

If you alter the order in this cycle,transactions won't be finished and queue will be filled with transactions that are not completed and system can crash.

You can consult this thread that talks about it: KSDK VCOM example does not work without loopback

If you have any other doubt please let me know it.

Best Regards,

Isaac

----------------------------------------------------------------------------------------------------------------------------------------

Note: If this post answers your question, please click the Correct Answer button. Thank you!

----------------------------------------------------------------------------------------------------------------------------------------