Is there any reason why USB 4.1.1 Stack will not run on k22?

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

Is there any reason why USB 4.1.1 Stack will not run on k22?

774 Views
rhana
Contributor III

Hello,

             Acknowledging the fact that  Freescale recommends the USB Stack version 5.0 for use with the Kinetis K22 MCU,  is any reason why the USB 4.1.1 stack will not run on the k22? From what I understand the hardware is identical for the USB (the registers are the same.) The usb_host (HID mouse) example in TWR-K21F120M_LABS runs without error on the k22. What reason is there that USB 4.1.1 will not work with K22?

Thanks.

-Robert Hana

5 Replies

485 Views
mjbcswitzerland
Specialist V

Robert

99.9999% of the code will probably work on any Kinetis.

I expect the problem is that the code is a bit over-heavily processor dependent by linking in specific include files for certain processor types - this may need specific new include files for new types. It is something that a user could probably sort out themselves with a little effort.

I use the uTasker USB device stack on many KL and K parts and there are in fact only about 5 lines of actual code that are processor dependent (some memory access settings and some clock settings). This has been verified on 50MHz, 72MHz, 100MHz and 120MHz K20s and 50MHz, 72MHz, and 120MHz K21s.

I never ran it on a K22 yet but don't expect any modifications required to a K21.

Regards

Mark

485 Views
rhana
Contributor III

Hello Mark,

    We have a k20 bootloader working fine on a k20 tower board and we are trying to port this to the k22. The USB stick is not being detected on our k22. Would there be an exception going from k20 to k22 (even though they are in the same family?)

Thanks.

R.H.

0 Kudos

485 Views
mjbcswitzerland
Specialist V

Robert

I would suggest checking the following details:

- the USB clock setting (SIM_SOPT2 and SIM_CLKDIV2) to ensure that it is using a 48MHz clock

- the USB power control - usually there will be an output from the processor controlling the 5V power switch which may be connected differently on different boards (and need a GPIO change for example)

Regards

Mark

0 Kudos

485 Views
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi Robert,

K22 is Kinetis next generation product, which has some advanced update from K20 product.

There also with related register modification about feature improvement.

So, as Mark mentioned, it need to check USB related clock and power setting.

BTW: Customer could download and refer USB Stack V5.0 with below link, which already support K22 product:

Freescale bare metal (no OS) USB Stack

USB Stack|Freescale


Wish it helps.
best regards
Ma Hui

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

485 Views
mjbcswitzerland
Specialist V

Hi

Update: I have now used USB on the K22 and can confirm that it is compatible with USB code for the K64.

This code is in turn the same as code for something like a K20_72 (slightly different clock setup to first generation FPU parts)

Regards

Mark

0 Kudos