TWR-K21 USB device

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

TWR-K21 USB device

1,787 Views
anupriyaajani
Contributor II

Hi,

I am using TWR-K21 120Mhz. I am using usb device example code provided in the project fron freescale. While debugging, it is waiting for the enumeration to happen(It will happen only when USB ISR happens), parallely I am connecting K21 device USB to Windows XP PC. On PC it is been detected as unknown device. Kindly guide me through.

Thanks

Anupriya Ajani

Labels (1)
Tags (1)
0 Kudos
Reply
5 Replies

1,628 Views
cutworth
NXP Employee
NXP Employee

Hi Ajiani,

There are a few things need your confirmation. Which USB device example code your are using and which demo in the stack?

I suppose you are using USB stack 4.1.1, right? If so, then the default demo in the stack only supports MK21D512xxx5, which is 50MHz part instead of 120MHz.

In order to support MK21 120MHz part, you need to make a few changes.

  1. Change the clock settings in pll_init() in main_kinetis.c file so you locked PLL at 120MHz, at the same time, you need to change SIM_CLKDIV2 register so USB clock is at 48MHz
  2. Make sure MPU_CESR is set to 0, the major difference between MK21D5 with MK21F12 is there is MPU on MK21F which by default will disable USB access

Or more simply, you could try latest USB stack code in KSDK1.2, it already supports MK21F.

Software Development Kit for Kinetis MCUs|Freescale

Hao

0 Kudos
Reply

1,628 Views
anupriyaajani
Contributor II

Hi Hao,

I am using KDS USB device code.

How to find USB stack?

1 . For clock, I have checked the settings for PLL with 120Mhz clock which is divided to 48Mhz using SIM_CLKDIV2.

2. I have checked for MCU_CESR also. It is set to 0.

Thanks

Anupriya

0 Kudos
Reply

1,628 Views
cutworth
NXP Employee
NXP Employee

Hi Ajani,

Do you mean KDS or KSDK? Please check if you have this folder image on your PC after installing KSDK1.2.

pastedImage_0.png

Hao

0 Kudos
Reply

1,628 Views
anupriyaajani
Contributor II

For USB device I am using Kinetis Design Studio.

As suggested by you, I am downloading KSDK now. Will check for this image and let you know.

Thanks

Anupriya

0 Kudos
Reply

1,628 Views
mjbcswitzerland
Specialist V

Hi

To verify the operation of USB device you can also load imges from the links below (for 50 and 120MHz boards).

µTasker Kinetis TWR-K21D50M support

µTasker Kinetis TWR-K21F120M support

These will show composite USB-CDC operation with mutliple interfaces.

Regards

Mark

Kinetis: µTasker Kinetis support

K21: µTasker Kinetis TWR-K21D50M support  / µTasker Kinetis TWR-K21F120M support

USB User's Guide: http://www.utasker.com/docs/uTasker/USB_User_Guide.PDF

Composite USB: µTasker USB Device Configuration

For the complete "out-of-the-box" Kinetis experience and faster time to market

0 Kudos
Reply