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.
I'm using the K60 series microcontroller with the CodeWarrior tools in C/C++ mode.
Thanks in advanced.
Cheers,
Monte---
Solved! Go to Solution.
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
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
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---
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
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--