Processor Expert FSL_USB_Stack CDC device will stop receiving - how to debug?

cancel
Showing results for 
Search instead for 
Did you mean: 

Processor Expert FSL_USB_Stack CDC device will stop receiving - how to debug?

Jump to solution
483 Views
ocmonte
Contributor III

Hi,

I'm using PE FSL Stack as a CDC and all is working well for simplex operations. I can send tons of data and likewise I can receive tons of data. Where I'm having trouble, is when the data is send and received simultaneously. All works well and then sometimes, the CDC device will not receive any more data. However, it will send data.

  • What may be causing this issue?
  • How would be the best way to debug this?

I'm using the K60 series microcontroller with the CodeWarrior tools in C/C++ mode.

Thanks in advanced.

Cheers,

Monte---

Labels (2)
0 Kudos
1 Solution
255 Views
BlackNight
NXP Employee
NXP Employee

Hi Monte,

can you check if your USB interrupts in that case are still firing? Set a breakpoint in the USB interrupt routine.

The other thing I would try is to increase the size of the ringbuffers used (Rx and Tx), to see if this might help.

Erich

View solution in original post

0 Kudos
4 Replies
256 Views
BlackNight
NXP Employee
NXP Employee

Hi Monte,

can you check if your USB interrupts in that case are still firing? Set a breakpoint in the USB interrupt routine.

The other thing I would try is to increase the size of the ringbuffers used (Rx and Tx), to see if this might help.

Erich

0 Kudos
254 Views
ocmonte
Contributor III

Hello Erich,

I increased my buffers and that seemed to fix things or at least it did not fail in my tests. Thanks for your input. Question: when the buffers are not large enough, what happens? I would like to somehow check for this.

Cheers,

Monte---

0 Kudos
254 Views
BlackNight
NXP Employee
NXP Employee

Hi Monte,

it is not clear to me what really happened in your case.

What was your previous Rx buffer size?

I only can speculate that probably CDC1_App_Callback() somehow does not get called any more.

In the problem case, you might set a breakpoint in that function, and check why it does not put the characters any more into the Rx buffer.

The location is

} else if ((event_type==USB_APP_DATA_RECEIVED) && (start_transactions==TRUE)) {

So I guess either there is the wrong/no event type, or somehow the transcation is not started?

Erich

0 Kudos
254 Views
ocmonte
Contributor III

Hi Erich,

Interesting stuff. I made the receive buffer small again and placed a breakpoint at that location when the system fell into the "never receiving any data mode". The values for the conditional were: event_type = 0x03 (

USB_APP_SEND_COMPLETE) and the start_transactions = 0x01 (TRUE).

Thanks for your help. Having bigger buffers solved the problem.

Monte--

0 Kudos