Hello Forum! I am working on a FRDM-KL25Z dev board and hopign to have it come up as a virtual com port on a windows machine and then interact with the incoming data inside the ARM. I didn't see a straightforward example of doing a VCOM port on this processor so I started out with the USB HID example for the tower system with the same processor (Keil\ARM\Boards\Freescale\XTWR-KL25Z48M\RL\USB\Device\HID) and then copied the usb_config.c and usbd_user_cdc.c from another example (Keil\ARM\Boards\Keil\MCBSTR9\RL\USB\Device\CDC). The project compiles, I load it on the target, and then I see the virtual com port on my system (after installing the driver). I have stripped out the code from usbd_user_cdc.c to remove UART functionality. The problem I am having is when I try to open the virtual com port on the windows side. I tried 9600 baud, which seemed to be the default rate in the demo. I tried Putty and RealTerm, both applications hang when I try to open the specific com port. I was wondering if you folks had an idea what I was doing wrong or how I can begin to troubleshoot this. I have debugging access and it seems that USB works enough to identify its self on my system. I also included the CM1 usb library. I added some relevant code below. (I verified usb_config.c with the wizard and it seems to make sense) Thank you in advance!
I had to put the files on pastebin to meet the 7000 character limit
usb_config.c: http://pastebin.com/4vtczSUB usbd_user_cdc.c: http://pastebin.com/RrSrH3ML usbd_MKL25Z4.c: http://pastebin.com/D9WGuqnD
Hi Tsuneo, I added your code to my project, started debugging, and verified that we enter MyUSBD_CDC_SetLineCoding() when trying to open the serial port with putty. The function does get called, however, I still have the same issue with cancelled Set Line Coding (oi49.tinypic.com/10iex5d.jpg). I have tried opening the port with different speeds and verified that the _initport() function gets the correct speed value, for example. I have also uploaded the capture if this will be helpful for you here: routed.net/VCOM-20121118a.ulz . Thanks again for looking into this.