cdc debug console hangs with repeated data

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

cdc debug console hangs with repeated data

ソリューションへジャンプ
824件の閲覧回数
inorman
Contributor III

Hi,

We've a project that uses the K64 usb port as a CDC serial port using the debug console with SDK 1.3 with PE , but it hangs when data is sent regularly to it.

 

I've stripped the program back so it's just calling debug_getchar();

and then sending that char straight back out with  debug_putchar(temp);

 

I used termite (a simple terminal program) just to send back a test message, so the whole thing will keep looping, after a few minutes the K64 will crash.

 

Any thoughts?

ラベル(1)
0 件の賞賛
1 解決策
592件の閲覧回数
therealfreegeek
Contributor IV

Do you have any long interrupts occurring?

I had a similar problem, my code was working well, it was tested running for 2 weeks, then at some point later I modified a PIT interrupt which toggled a pin, to toggling the pin twice with a random period of up to 10uS between toggles.

It was only later I noticed that the s/w would lock up when tested for a few hours, it took a while for me to link the two.

Modifying the interrupt back to the way it was negated the problem. Subsequent tests running for 3 weeks ran error free.

It seems like my long (well up to 10uS) was interfering with the operation of the USB peripheral or driver.

元の投稿で解決策を見る

0 件の賞賛
4 返答(返信)
593件の閲覧回数
therealfreegeek
Contributor IV

Do you have any long interrupts occurring?

I had a similar problem, my code was working well, it was tested running for 2 weeks, then at some point later I modified a PIT interrupt which toggled a pin, to toggling the pin twice with a random period of up to 10uS between toggles.

It was only later I noticed that the s/w would lock up when tested for a few hours, it took a while for me to link the two.

Modifying the interrupt back to the way it was negated the problem. Subsequent tests running for 3 weeks ran error free.

It seems like my long (well up to 10uS) was interfering with the operation of the USB peripheral or driver.

0 件の賞賛
592件の閲覧回数
inorman
Contributor III

Hmm you could be on to something, I've a timer interrupt to flash a led in an fpga via spi... I'll take that out and give it a go.

Thanks

0 件の賞賛
592件の閲覧回数
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Norman,

I am sorry for the delay. Can you use SDK2.0 to develop the code?

There is example code for cdc, you can refer to it:

C:\Freescale\SDK2.0_K82\boards\frdmk82f\usb_examples\usb_device_cdc_vcom\freertos\kds

Regarding your function debug_getchar(); and debug_putchar(temp); the two functions use UART to transfer data or use cdc which is implemented in K20 on the FRDM or tower board of K64. Do you encapsulate the above two function with the USB CDC class on K64?

Do you use FRDM-K64F, TWR-K64 or the target board you designed?

BR

Xiangjun Rong

0 件の賞賛
592件の閲覧回数
inorman
Contributor III

Hi thanks for getting back to me,

Probably too late in the day to switch to SDK2.0 unless I can just insert the usb code alongside the other drivers as our boards are at prototype stage with customers.

This is on our own custom board using a MK64FN1M0VLQ12

Yes the functions are setup using the PE libraries fsl_usb_framework and fsl_debug_console.

With the symbol use "BOARD_USE_VIRTUALCOM" enter under the settings “C/C++ Build >> Settings >> Cross ARM C Compiler >> Preprocessor

and call DbgConsole_Init(BOARD_DEBUG_UART_INSTANCE, DEBUG_UART_BAUD, kDebugConsoleUSBCDC); 

at the start of main program.

All works well, except when the usb uart is continuously polled.

Any further thoughts?

Kind regards

Ian Norman

0 件の賞賛