I apologize right now for not knowing enough about USB and its implementation in MQX on the K70. This is an inherited project. I'll try my best to provide as much information as I can and that I know. I am learning how this works, but I'm at a point where I'm stuck and not sure where to go.
I have a K70 that has a full speed USB port. The code is setting that port up as a USB CDC device. I have communication working between the K70 and an Android device via an OTG cable.
I am noticing in certain instances where the communication stops or packets become "garbled" for lack of a better word. I can see the data in the packets, but neither side of the communication really understands them.
The biggest initiator of this scenario is when we unplug and then replug the USB cable. I am assuming, maybe incorrectly, that this is something that I'd need to do the re-initialize the device driver once I've noticed a bus reset or re-enumeration complete event.
Do I need to call USB_Class_CDC_Init() again? Do I need to re-initialize the entire device driver? Reset it somehow? And if so, how?
I've been reading the MQX USB Device Reference manual and it just has a little snippet about how to use the CDC class layer API. I've tried calling the USB_Class_CDC_Init() at different points, but nothing seems to work. I've also tried to deinit the device before I reinit, but still no dice.
I'm stuck... Any help would be greatly appreciate. Like I said, I'm not sure what information I may be missing, so if there is something I left out that would help solve this, let me know and I'll provide the info.
Thanks in advance!!
Hi Terry:
There is a readme file under the MQX installation folder
Freescale_MQX_4_2\usb_v2\example\device\cdc\virtual_com
Since there is no dynamic detection between host and device, the COM port must be closed from the terminal tool prior to plug-out the CDC device. Or the CDC device won't get recognized next time you plug-in with the COM port still opened.
I hope it helps
Regards
Daniel
Hi Terry
Have you contacted MQX?
I can help on USB FS device on K70 and deliver proven USB-CDC device solutions, but have no experience with MQX libraries.
Regards
Mark
Complete Kinetis solutions, training and support: http://www.utasker.com/kinetis.html
Kinetis K70:
- http://www.utasker.com/kinetis/TWR-K70F120M.html
- http://www.utasker.com/kinetis/EMCRAFT_K70F120M.html