Kinetis USB Host and Device SDK Example

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

Kinetis USB Host and Device SDK Example

1,627 Views
Keith4DSmith
Contributor V

Are there any Kinetis K series SDK examples that have both a USB host and a USB device in the same example?

Labels (2)
5 Replies

859 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi Keith

Please download sdk for frdm-k66 from nxp website.

Welcome | MCUXpresso SDK Builder 

unzip the package, there are two demos for your requirement.

FRDM-K66F_2.4.0_0605\boards\frdmk66f\usb_examples\usb_pin_detect_hid_msd\freertos

when you connect k66 with your PC,  k66 work as a msd device.

when you connect a mouse with K66, it will act as  a hid host

Please also refer to this demo,

FRDM-K66F_2.4.0_0605\boards\frdmk66f\usb_examples\usb_pin_detect_hid_mouse\freertos

Regards

Daniel

0 Kudos

859 Views
Keith4DSmith
Contributor V

Daniel - The example you mentioned appears to be an example of how to support OTG. Is there an example of using two ports, one as a device and one as a host simultaneously?

I have the requirement to be a USB host to communicate with a USB CDC device, while being connected to a PC as a USB CDC device.

0 Kudos

859 Views
danielchen
NXP TechSupport
NXP TechSupport

Could you please let me know which board/MCU you are using?

Regards

Daniel

0 Kudos

859 Views
Keith4DSmith
Contributor V

I thought I would use the K26 MCU as it has two USB ports.

0 Kudos

859 Views
danielchen
NXP TechSupport
NXP TechSupport

Hi  Keith Smith :

Thank you for your additional information.

I would suggest you download the MCUXpresso SDK for TWR-K65F180M board. There is a keyboard2mouse demo.

This demo implements the host and the device, where the KHCI works as host and the EHCI works as a device.

The host supports the keyboard device and device works as a mouse when connecting to the PC. It seems very similar to your requirements.

I hope it helps.

Regards

Daniel

0 Kudos