Virtual Com program enumerating correctly but not transferring data.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Virtual Com program enumerating correctly but not transferring data.

528 Views
leedimmitt
Contributor I

I'm trying to implement the Virtual_Com app from Freescale USB Stack v4.1.1 on a K60 processor with ULPI to communicate with a Docklight terminal emulator running on Windows 10. The Virtual Com App is implementing a loopback program but I never receive the text I type in the terminal emulator there. I've also created a "Hello World" routine to transmit a string when triggered, but it never shows on the terminal emulator either. I'm seeing the CDC_CARRIER_ACTIVATED and DEACTIVATED events in USB_Cdc_Notify_Callback, and getting the USB_APP_ENUM complete event in USB_Cdc_App_Callback, but never a DATA_RECEIVED or SEND_COMPLETE.

I'm getting numerous USB_APP_EP_UNSTALLED events into the USB_Cdc_App_Callback when the com port is open. Aside from this, everything looks to be functioning correctly, but no data moves. I've got the Com port settings set to the same baud rate, etc and handshaking off in both the Docklight terminal emulator and in Device Manager - USB Serial Device - Properties - Port Settings.

I've modified usb_dci_kinetis.c/h to work on my hardware and can implement an MSD device with it. I eventually want to implement a Composite MSC/CDC device but am trying to get the CDC working on its own before going for both. I've switched the usb_descriptor.c/h files out for the CDC and everything looks good in the Device Manager when I look at the details. It just doesn't move data.

Anyone out there able to help?

Thanks in advance,

Lee

Tags (1)
0 Kudos
3 Replies

408 Views
leedimmitt
Contributor I

Thanks Mark, but I'm not using the TWR_K60F120M board itself, but a custom board based on its design. You wouldn't happen to have the source code for these bins, would you?

Regards,

Lee

0 Kudos

408 Views
mjbcswitzerland
Specialist V

Lee

The source is on GITHUB - link at this page: http://www.utasker.com/kinetis.html

To build for the TWR-K60F120M (with KDS, CW, MCUXpresso, S32 Design Studio, Rowley Crossworks, IAR, Keil, Atollic, Green Hills, CooCox, GCC or Visual Studio) see the compiler guide links at the top of the same page, whereby I set
config.h:
- TWR_K60F120M
- TWR_SER2
- USB_INTERFACE
- USE_USB_CDC
- USE_USB_MSD
- SDCARD_SUPPORT

to configure for HS USB, and removed the define TWR_SER2 for FS USB.

You can build for about 50 different boards (see list in config.h) or just search for TWR_K60F120M to see sub-configurations, such as clock settings and pin selections, in case you need to adapt to a different HW.

In case of problems cloning from GIT, importing, configuring/building etc. there are a number of videos at https://www.youtube.com/watch?v=kWNlsAoMly4&list=PLWKlVb_MqDQFZAulrUywU30v869JBYi9Q which may help.

As reference for USB device I have attached the USB-CDC configuration descriptors that are used. This is suitable for FS or HS and making composits of up to 6 CDC interfaces (limited by controller's endpoints and less for the HS K60), optionally with USB-RNDIS, and mixed with any combinations of MSD, HID mouse, HID keyboard, HID Raw, and Audio. The defines USE_USB_CDC + USE_USB_MSD automatically select the configuration, whereby USB_CDC_COUNT can be defined to control how many CDC interfaces are used.
A further option, FAT_EMULATION, allows additional USB-MSD views of emulated disks as discussed in the document http://www.utasker.com/docs/uTasker/uTaskerEmulatedFAT.pdf

Regards

Mark

0 Kudos

408 Views
mjbcswitzerland
Specialist V

Hi Lee

I have attached a binary for the TWR-K60F120M and SER2 board that implements USB-CDC (with command shell [with a DOS like interface to the SD card too] and capability to switch to USB-UART bridge mode) and USB-MSD to the SD card.
EP1 is VCOM-Rx/Tx bulk endpoint, EP2 is VCOM interrupt endpoint, EP3 is USB-MSD Rx/Tx bulk endpoint.

This is included as standard configuration in the free OpenSource uTasker project (HS USB has been used intensively in industrial products based on K60, K61, K70 over past 5 years) which can be used to save development time or to help fixing problems in the examples. The complete operation can be simulated with VisualStudio (free community edition is edequate).

For K60 users who want the same on the FS interface (without ULPI, for standard SER board) I also have attached a second binary that can be used instead.

Regards

Mark


http://www.utasker.com/kinetis/TWR-K60F120M.html

0 Kudos