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

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

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

ソリューションへジャンプ
854件の閲覧回数
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---

ラベル(2)
タグ(5)
0 件の賞賛
1 解決策
626件の閲覧回数
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 件の賞賛
4 返答(返信)
627件の閲覧回数
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 件の賞賛
625件の閲覧回数
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 件の賞賛
625件の閲覧回数
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 件の賞賛
625件の閲覧回数
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 件の賞賛