Hardware and software configuration:
FRDM-K64F
OpenSDA J-Link firmware
KDS 3.0 with KSDK 1.2.0 and KSDK 1.3.0 Eclipse update installed.
KDS no updates:
GNU ARM C/C++ Cross Compiler 1.14.1.201508190739
GNU ARM C/C++ J-Link Debugging 3.2.1.201508190739
GNU ARM C/C++ OpenOCD Debugging 3.2.1.201508190739
File→New→Kinetis Project…. Name… boards FRDM-K64
Select KSDK 1.2.0 or KSDK 1.3.0
Select Processor Expert
Set Build Options
Stack Size 0x1000
Heap Size 0x0400
Now I find the fsl_usb_framework component from KSDK 1.2.0 or KSDK 1.3.0
and add it to project and inherited components :
Note: is KSDK 1.2.0 set Baud Rate in component fsl_debug_console.
Select usbFmw:fsl_usb_framework Properties Mode and Select Device class driver USBCFG_DEV_CDC Enabled
Select usbFmw:fsl_usb_framework Properties Initialization
and Select Auto Initialization Disabled
Click Generate Prosessor Expert Code
Create New Folger classes
Add
Includes Path
"${ProjDirPath}/SDK/usb/usb_core/device/sources/classes/include"
"${ProjDirPath}/SDK/usb/usb_core/device/sources/classes/include/config"
"${ProjDirPath}/SDK/usb/usb_core/device/sources/classes/common"
"${ProjDirPath}/SDK/usb/usb_core/device/sources/classes/cdc"
and Apply.
Copy C:\Freescale\KSDK_1.X.0\usb\usb_core\device\sources\classes\
to {ProjDirPath}/SDK/usb/usb_core/device/sources/classes/
folgers:
/cdc
/common
/include
Copy c:\Freescale\KSDK_1.X.0\examples\frdmk64f\demo_apps\usb\device\cdc\virtual_com\
to {ProjDirPath}/Sources/
files
virtual_com.h
usb_descriptor.h
usb_descriptor.c
Note: Not copy virtual_com.c
Next step change main.c based virtual_com.c.
View attachment projects.
Click Generate Prosessor Expert Code.
Note: function void APP_init(void) different KSDK_1.2.0 and KSDK_1.3.0
If KSDK_1.3.0 add
cdc_config.board_init_callback.callback = NULL ; //usb_device_board_init;
cdc_config.board_init_callback.arg = CONTROLLER_ID;
Konstantin.
Original Attachment has been moved to: CDC_KDS130.ZIP
Original Attachment has been moved to: CDC_KDS120.ZIP
解決済! 解決策の投稿を見る。
I tried to change some configurations on USB libraries of the main project code, and I didn't have sucess.
The solution was very, but very simple. If somebody have the same problem, here is the solution...
The device was detected and the driver update was done too, like in the image below:
The configuration for the device works on "Termite", is shown below.
We need to set the configurations of the "Flow Control" to RST/CTS.
Like in these steps:
Yellow: Set the serial COM port referenced by the Virtual Com Port driver (.inf).
Red: Set the Flow Control from "none" to "RTS/CTS".
Green: Press the ok button.
A test is shown below:
Comunicacao OK! (Communication OK!)
If ou have your own application software, you need to verify the Flow Control configurations for this applications with the KL27Z series, and it works nice!
Thank you to everyone!
Thank you for posting this. I'm having an issue with it identifying the USB Device correctly. I keep getting a "USB Device Not Recognized" error. Nay idea where I might have gone wrong?
Thank you for your help.
Grant
Hi,
can you check your Build Options on your CPU component ?
Stack Size 0x1000
Heap Size 0x0400
Thanks!
Yes, those are correct.
If your clock configurations are correct, remembering that your microntroller needs 48 MHz in the USB peripheral...
Which operating system are you using on your PC ?
I"m running Windows 7. I believe my clock settings are correct. I've setting the clock to 48Mhz and using the USB specific clock with the main clock at it's default settings. I think the problem is with the clock settings, but I just can't seem to find out where.
Maybe you can check if the external clock is configured correctly, like oscillator in low power mode or high gain (requires an external 1 Mohm resistor in parallel with the crystal), depending of your microcontroller. PEE clock mode in 96 MHz and subdivided to 48 MHz for USB functionalities. These are my suggestions, maybe, for solving the problem.
In Windows 7, when the configurations of the microcontroller are wrong, a message pops up in the right side of your screen, like "device malfunction" or "windows doesn't recognized the device". Sometimes these messages are slow to appear. If it's not the case, you have to check if you are using the correct ".inf" file.
I hope it has helped you,
thanks!
Hi Konstantin!
I followed your steps to implement this application on the KL27Z256VLH4 and it's working fine.
I did some tests with the serial terminal like "Tera Term", "Putty" and I can communicate with no problems.
When I tried to communicate with the "Termite" by CompuPhase, for example, or on my own software builded on C++ Builder using the TComPort, the device crashes. The "Termite" and my application does not answer.
Do you know what's happening? The diferences maybe of the implementation of this software to communicate with COM devices? Or the problem can be on the firmware of the microcontroller?
Really thank you for this post, it was so helpful for my academic projects!
I tried to change some configurations on USB libraries of the main project code, and I didn't have sucess.
The solution was very, but very simple. If somebody have the same problem, here is the solution...
The device was detected and the driver update was done too, like in the image below:
The configuration for the device works on "Termite", is shown below.
We need to set the configurations of the "Flow Control" to RST/CTS.
Like in these steps:
Yellow: Set the serial COM port referenced by the Virtual Com Port driver (.inf).
Red: Set the Flow Control from "none" to "RTS/CTS".
Green: Press the ok button.
A test is shown below:
Comunicacao OK! (Communication OK!)
If ou have your own application software, you need to verify the Flow Control configurations for this applications with the KL27Z series, and it works nice!
Thank you to everyone!
Hi,
can you please let me know how you could generate the .inf file?
I compile this project and can not get the .inf file at all.
Thanks,
Henry
Hi Henry,
you can find the inf. files in the KSDK examples folders. I was using the Kinetis KL27Z microcontroller. In the examples folder there are other suported processors.
For KSDK 1.2 the directory is: \Freescale\KSDK_1.2.0\examples\frdmkl27z\demo_apps\usb\device\cdc\virtual_com\inf
For KSDK 1.3 the directory is: \Freescale\KSDK_1.3.0\examples\frdmkl27z\demo_apps\usb\device\cdc\virtual_com\inf
Thanks for this post, really helpful. I have created a blog post as well on this topic but added how to hook it all up to the fsl_debug_console component which is already supporting CDC but manual initialisation is needed. Check it out at: KSDK USB CDC PRINTF | Centaurian