Hi,
I'm trying to get USB CDC working full duplex on TWR_KW24D512
I have built my prooject with beekit release 3.0.2, HaOnOffSwitch_EndDevice.
I can send and received data on UART1 (TWR_KW24 <--> Teraterm)
I have included the files needed to support USB CDC and added initialisation calls as follow:
in BeeAppInit.c void Main()
#if gVirtualCOMPort_d
// Initializes USB vitual COM port //
USB_Init();
(void)CDC_ModuleInit();
#endif // #if gVirtualCOMPort_d
in BeeApp.c (void BeeAppIni (void))
#if gVirtualCOMPort_d
// USB data log and Command Port Rx CallBack Setting
CDC_SetRxCallBack(BS_SerialRxCallback);
#endif //gVirtualCOMPort_d
I can send without any problem logs to tera term window calling:
CDC_Transmit(pBuf, bufLen, pfCallBack)
There is a problem on USB CDC RX side:
BS_SerialRxCallback function, is not called everytime data are sent from teraterm to TWR-KW24.
It is called only two times and no more.
First data frame is not seen
second data frame is not seen
third data frame is not seen
Forth data frame is properly received
5th data frame is not seen
6th data frame is not seen
7th data frame is not seen
9th data frame is not seen
10th data frame is properly received
All following frames are not seen!!!??
What can be the rout cause of this behavior?
Thank you for your support
Best regards.
Fabrice.
Solved! Go to Solution.
Hi Isaac,
I looped back the received characters and the USB CDC works fine now.
Thank you for your efficient support.
Best regards.
Fabrice.
Hello Fabrice,
I've not checked Beestack further but this kind of issue seems similar to the one described in this thread: KSDK VCOM example does not work without loopback, I can advise you to see USB callbacks and understand its structure and see if same problem/solution applies to your project.
I will try to reproduce this issue and will let you know if something is found!
Hope this can help!
Best Regards,
Isaac
Hi Isaac,
I looped back the received characters and the USB CDC works fine now.
Thank you for your efficient support.
Best regards.
Fabrice.