This tutorial was extracted from Erich Styger blog http://mcuoneclipse.wordpress.com with his agreement.
On the FRDM-KL25Z Board the target processor supports both USB host and device mode. However, the Freedom board has no jumper or other means to power the USB bus (which is required in the USB host mode). So if I want to get access to a memory stick from the KL25Z, then I’m stuck because the board does not offer that option. Luckily there is an easy hack to work around this.
Looking at the FRDM-KL25Z board schematics, there is 5V available on Pin 10 of J9:
5V on J9 Pin 10 on FRDM-KL25Z Board
The idea is to power the USB bus with 5V DC from the board itself. Normally I would use an ADML869L or similar device to have stable voltage and over-current protection. But attaching a memory stick or similar should be safe and would be protected through the other circuits and through the protection on my host.
So all what I need is to connect the power supply line on the USB host side of the cable. I cut the cable to prevent the current to flow back, just in case.
Usually in a USB cable the red wire is the VBUS/5V one, which connects to pin 1 of the USB plug. Cutting that cable and connected it with a probe tip:
Probe Tip to VBUS
That probe tip then connects to pin 10 on J9:
Power from Pin 10 on J9
With this I can power devices on the USB bus, and I was able to enumerate a USB memory stick in USB MSD host mode on the KL25Z:
USB Host powered Memory Stick with the KL25Z Freedom Board