MK26F and MK65F USB Application troubles

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

MK26F and MK65F USB Application troubles

913 Views
gumpforrest
Contributor I

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:

2016-01-29_114849.jpg

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!

Labels (2)
0 Kudos
3 Replies

557 Views
isaacavila
NXP Employee
NXP Employee

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!

----------------------------------------------------------------------------------------------------------------------------------------

0 Kudos

557 Views
gumpforrest
Contributor I

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

pastedImage_1.png

it compiled OK!

3. build the usbd_sdk_bm_lib for MK26

pastedImage_2.png

pastedImage_3.png

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

pastedImage_4.png

pastedImage_5.png

b. C/C++

change Define to be CPU_MK26FN2M0VMI18

pastedImage_6.png

in the include paths:

change the finally folders directed to MK26F18

pastedImage_10.png

because in the usb_core,there is no MK26,so the Final MK65F18 is use instead

pastedImage_9.png

after all these, I compiled it

4. As with the application projectpastedImage_11.png

a. update configurations as step3 above

b. update the start files from MK65 to be MK26

pastedImage_13.png

c. Link lib

pastedImage_14.png

d. after all these,I config the clock in board.c file to make the MCG out is 120MHz

pastedImage_16.png

pastedImage_17.png

5. Finally,I compile the project and debug with a Jlink Debuger,with no luck,the usb is still no recgnized

pastedImage_18.png

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!

0 Kudos

557 Views
isaacavila
NXP Employee
NXP Employee

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

0 Kudos