USB on MK22FN512xxx12 vs MK22FN1M0Axxx12

cancel
Showing results for 
Search instead for 
Did you mean: 

USB on MK22FN512xxx12 vs MK22FN1M0Axxx12

Jump to solution
419 Views
cwolff
Contributor II

I'm trying to prove out USB functionality on my custom PCB with a MK22FN1M0Axxx12 microprocessor.  Since I cannot seem to get USB to enumerate on my hardware, I took a step back and started using the FRDM-K22 boards.

I have two FRDM-K22 boards.  One is completely stock out of the box.  The other has the MK22FN512xxx12 micro swapped out with a MK22FN1M0Axxx12.  I used the FRDM-K22 (K22FN1M) as a proof of concept for another design and we had no problems with SPI, UART and other basic functionalities... so I'm ruling out solder bridges and misaligned pins and whatnot.

Both boards work just fine with the exception of USB0.  The FRDM-K22 (MK22FN512) will work with all the USB example projects, but the MK22FN1M0A will not.  The FRDM board with the MK22FN1M0A micro will always show up as "USB Device Not Recognized".  I realize that the MK22FN1M0A has an MPU whereas the other micro does not, so I think maybe I missed something in that configuration... but I just cannot figure out what.

The micro on the TWR-K21 boards are supposed to be functionally the same as the MK22FN1M0A micro I'm using.  Again, I can get the TWR projects to work on the MK22FN512 but not the MK22FN1M0A.

Does anyone have anything specific I should look at?  Since I have everything working on one board, I cannot imagine it would be that big of a (SW) change to work on the other.  Is there something that needs to be done differently in hardware between the two micros?

I'm currently using the usb_device_cdc_vcom (freertos) example from https://mcuxpresso.nxp.com/en/builder for the TWR-K21F20M which is stated to be compatible with the MK22FN1M0Axxx12... So I would expect it to work out of the box with just a couple pin muxing changes.

Tags (2)
0 Kudos
1 Solution
116 Views
mjbcswitzerland
Specialist V

Hi Corey

K22FN512 supports crystal-less operation and has no MPU
K22NF1M doesn't support crystal-less operation and so needs to be configured for internal or external clock instead. It has MPU, so MPU MPU_CESR = 0; should be used to allow concurrent access to MPU controller.
USB HW is the same for both.

In case of problems, use the uTasker project (open source at links below) to build for various boards/processors - it uses one driver which adapts itself so doesn't need porting. You can test USB in its Kinetis simulator in Visual Studio and step through with K22FN512 and K22F1M targets to see the differences involved and then quickly solve any issues with the standard libraries. The simulator will show you in case there is anything that is not configured correctly for USB to operate.

Regards

Mark

http://www.utasker.com/kinetis/TWR-K21F120M.html
http://www.utasker.com/kinetis/FRDM-K22F.html
http://www.utasker.com/kinetis/TWR-K22F120M.html
http://www.utasker.com/kinetis/BLAZE_K22.html

http://www.utasker.com/kinetis.html

USB:
- http://www.utasker.com/docs/uTasker/USB_User_Guide.PDF
- http://www.utasker.com/docs/uTasker/uTaskerV1.3_USB_Demo.PDF
- http://www.utasker.com/docs/uTasker/uTaskerUSB_Audio.pdf
- http://www.utasker.com/docs/uTasker/uTaskerRNDIS.pdf
- Composite http://www.utasker.com/kinetis/USB_Device.html

Video:
- K22FN1M USB in action: https://www.youtube.com/watch?v=n-GABeILGV8&index=6&list=PLWKlVb_MqDQFZAulrUywU30v869JBYi9Q


P.S. The uTasker USB stack can also be used together with FreeRTOS in a dual-OS environment: http://www.utasker.com/forum/index.php?topic=1947.0

View solution in original post

2 Replies
117 Views
mjbcswitzerland
Specialist V

Hi Corey

K22FN512 supports crystal-less operation and has no MPU
K22NF1M doesn't support crystal-less operation and so needs to be configured for internal or external clock instead. It has MPU, so MPU MPU_CESR = 0; should be used to allow concurrent access to MPU controller.
USB HW is the same for both.

In case of problems, use the uTasker project (open source at links below) to build for various boards/processors - it uses one driver which adapts itself so doesn't need porting. You can test USB in its Kinetis simulator in Visual Studio and step through with K22FN512 and K22F1M targets to see the differences involved and then quickly solve any issues with the standard libraries. The simulator will show you in case there is anything that is not configured correctly for USB to operate.

Regards

Mark

http://www.utasker.com/kinetis/TWR-K21F120M.html
http://www.utasker.com/kinetis/FRDM-K22F.html
http://www.utasker.com/kinetis/TWR-K22F120M.html
http://www.utasker.com/kinetis/BLAZE_K22.html

http://www.utasker.com/kinetis.html

USB:
- http://www.utasker.com/docs/uTasker/USB_User_Guide.PDF
- http://www.utasker.com/docs/uTasker/uTaskerV1.3_USB_Demo.PDF
- http://www.utasker.com/docs/uTasker/uTaskerUSB_Audio.pdf
- http://www.utasker.com/docs/uTasker/uTaskerRNDIS.pdf
- Composite http://www.utasker.com/kinetis/USB_Device.html

Video:
- K22FN1M USB in action: https://www.youtube.com/watch?v=n-GABeILGV8&index=6&list=PLWKlVb_MqDQFZAulrUywU30v869JBYi9Q


P.S. The uTasker USB stack can also be used together with FreeRTOS in a dual-OS environment: http://www.utasker.com/forum/index.php?topic=1947.0

View solution in original post

116 Views
cwolff
Contributor II

Looks like I missed the part about the K22FN512 being crystal-less.

I was able to compile your uTasker project for a FRDM-K22, remove the USB_CRYSTAL_LESS define and set up the clock sources for high speed mode and now I have USB working on both boards.  Thanks Mark!!

0 Kudos