Hello!
I'm a new comer of applying MK26F usb cdc,via the Community,I have knowed that,the MK26F is subset of MK65F,so I substitute the K65F18 instead of MK26F,in folder:
C:\Freescale\KSDK_1.3.0\examples\twrk65f180m\demo_apps\usb\device\cdc\virtual_com\bm\mdk
But my custom board always enumerates error,the Port Monitor capture is as following:
what is the trouble?
Are there any conditons that not meet or tips I miss?
I have already tripped in this situation for days,Waiting for help!
Hello,
Yes, K26F180 is compatible with K65F180 part, so, you can use that example and it should work, but you need to be careful to use proper libraries.
First of all, be sure to have same configuration as TWR-K65F180M, (USB connection, EXTAL clock, etc) because hardware configuration in that example is based on TWR-K65F180's hardware, so, you should have same connections in order to use same example.
Once hardware is compatible, you should compile correct library for MK26. It is located at:
C:\Freescale\KSDK_1.3.0\lib\ksdk_platform_lib\mdk\K26F18
Once this library is compiled, you can compile USB library but replace K65's macro definition by K26's. it is to say, on preprocessor definition, replace the CPU_MK65FN2M0VMI18 definition for proper MK26's, depending on your MCU: CPU_MK26FN2M0CAC18, CPU_MK26FN2M0VLQ18, CPU_MK26FN2M0VMD18 or CPU_MK26FN2M0VMI18 and also change K65's paths for K26's, this way, you will generate a new USB library but taking the right files for K26.
This same situation should be done in example C:\Freescale\KSDK_1.3.0\examples\twrk65f180m\demo_apps\usb\device\cdc\virtual_com\bm\mdk, (replace K65's definition by K26 and modify paths, libraries and linker file). This way, you are sure that correct libraries and files are used to generate image for MK26.
After this, you should be able to use this example in your MK26 MCU and it should work if hardware is compatible as shown in TWR-K65F180M.
I hope this can help you!
Best regards,
Isaac Avila
----------------------------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
----------------------------------------------------------------------------------------------------------------------------------------
Thanks for Isaacavila's quickly reply!
Having read your instruction,I tried it for steps:
1. Check my costom board,
a. the USB connection is fine,
b. the USB is defaultly connected to USB0 of MK26(for the nowa time,I only want to use USB Full Speed)
c. the external oscilator is 8MHz
2. compile library
C:\Freescale\KSDK_1.3.0\lib\ksdk_platform_lib\mdk\K26F18
it compiled OK!
3. build the usbd_sdk_bm_lib for MK26
as the KSDK1.3.0 has no usb sdk lib project for MK26,I can only do it on the bases of MK65F18
open the MK65F18 usb lib project,I have changed some configureation:
a. Device and Target to be MK26
b. C/C++
change Define to be CPU_MK26FN2M0VMI18
in the include paths:
change the finally folders directed to MK26F18
because in the usb_core,there is no MK26,so the Final MK65F18 is use instead
after all these, I compiled it
4. As with the application project
a. update configurations as step3 above
b. update the start files from MK65 to be MK26
c. Link lib
d. after all these,I config the clock in board.c file to make the MCG out is 120MHz
5. Finally,I compile the project and debug with a Jlink Debuger,with no luck,the usb is still no recgnized
SO, where am I wrong? Please help me figure out
The MK26 is a new MCU,subset of MK65,and the sdk has no released USB demo on MK26
I believe that there are many people,who are newly applying MK26,have the same troubles in transplanting demo usb of MK26
SO, we need help!
Thank you!
Hello Gump,
There is a new Kinetis SDK v2.0 in which demos for K26 are available, you can download it on Software Development Kit for Kinetis MCUs|NXP.
I hope this can help you!
Best Regards,
Isaac