USB OTG on FRDM-K22F? (Do I really need it?)

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

USB OTG on FRDM-K22F? (Do I really need it?)

Jump to solution
880 Views
davepfaltzgraff
Senior Contributor I

This question may be more for clarification (education on my part), but it may be an appropriate question for this forum.

 

I have used both the host mode (to drive a USB thumb drive) and the peripheral mode (as a USB CDC to a PC) on the FRDM-K22F, so I know that the hardware can handle it. Now, I'm running into an application where the end user would like to be able to operate in either mode according to the situation. The device just sits and collects data. Most of the time, 99%, the data is stored internally in EEPROM and then transferred to the PC via a serial link, either USB CDC or Bluetooth. However, on a rare occasion, the 1%, the device will collect more data than can be held in the internal EEPROM. What the user wants now is to be able to plug in a USB thumb drive to hold the data. When the collection process is complete, the USB thumb drive will be transfered to the PC - no need for a serial link. That's the background.

 

When I was approached about this, I thought, "OK. We're going to need USB OTG." But, as I get into it and found that there is no OTG demo for the FRDM-K22F, my thought it that maybe I don't need the full OTG. I just need to be able to switch modes according to user input.

 

First question: Any thoughts from others in the community? Am I reading this right that I can switch modes and don't need full OTG capability?

 

Second question: The platform is running MQX with the KSDK. Any pointers on switching modes? (Please remember that I've only used the host and peripheral modes separately.)

 

Final question - for now: If I really do need the full OTG capability, where can I find schematics for the hardware to support it? (I'm presuming that there's something missing in the FRDM-K22F design that precludes implementing full OTG as it is present in the TWRK22F case.)

 

Thanks.

Labels (1)
Tags (1)
0 Kudos
1 Solution
508 Views
davepfaltzgraff
Senior Contributor I

In pursuing this topic, I have come to the conclusion that OTG is not what I need. I do need the CDC device capability as there are times when the design will be connected via cable to a PC for data transfer. At other times, as selected by the user, it will need to be host to a USB drive.

To achieve this, I need to be able to control power to/from the USB and to switch between the USB Host and USB Device stacks. Although it may be more brute force, it is not as detailed as implementing the full OTG capability.

Refer to the final posts on Powering a USB device from 3.3V system

View solution in original post

0 Kudos
3 Replies
509 Views
davepfaltzgraff
Senior Contributor I

In pursuing this topic, I have come to the conclusion that OTG is not what I need. I do need the CDC device capability as there are times when the design will be connected via cable to a PC for data transfer. At other times, as selected by the user, it will need to be host to a USB drive.

To achieve this, I need to be able to control power to/from the USB and to switch between the USB Host and USB Device stacks. Although it may be more brute force, it is not as detailed as implementing the full OTG capability.

Refer to the final posts on Powering a USB device from 3.3V system

0 Kudos
508 Views
Kan_Li
NXP TechSupport
NXP TechSupport

Hi David,

I don't think OTG is what you need, why not try device with two USB port? so that you may use one as Host and the other as Device, such as K66 with both USBHS and USBFS on one chip.

BTW, I don't think USB CDC is essential for your application, and as you said, Bluetooth is also ok , so if your application is cost sensitive , you may choose the device with only one USB module, such as KL25, which can communicate with the PC via a Bluetooth module and act as a Host MSD class in the same time, we have such kind of demo for this device, please refer to "C:\Freescale\KSDK_1.3.0\examples\frdmkl25z\demo_apps\usb\host\msd\msd_fatfs" for details.

Hope that helps,


Have a great day,
Kan

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

0 Kudos
508 Views
lucianomoretti
Contributor IV

I asked about switching modes under MQX 4.1.1 with the standard driver, and was told by my FAE that it was technically possible but the non-OTG drivers were not designed for it and it would likely result in resource leaks and other issues.

I found the following post which may be helpful.

Where can I find an source code for USB OTG with MKL26?

The KSDK_1.3.0\usb\usb_core\otg\sources\bsp has files for the MK22F25612.

0 Kudos