Question

I am designing a USB OTG board as an extension board for Android. The board is based upon Freescale KL25Z128VLK4. Most part of design is similar to IOIO from Sparkfun, with some extensions.

  1. By connecting OTG cable from Android phone (Galaxy Nexus) to KL25Z board, Android acts as USB host and KL25Z acts as device B (CDC).
  2. By reverse connecting OTG cable, Android works in AOA/ADK/ADB mode, and KL25Z sources VBUS and charge current to Android.

In current design, switching role host/device has to be done manually by swapping cable connection. However, in latter case, if KL25Z can not offer enough current to Android, KL25Z wants to hand over host role to Android, so it can switch off main supply of 5V/500mA, and works in low power mode with VBUS from Android.

Anyway, I want my board to support switching mode between HOST/Device, as well as support in Android.

In principle, HNP protocol should be started for switching A/B in OTG. However, I have no idea how to handle it in Android side. I mean I don't know how Android SDK support HNP in programmatic way? Any API involved? Any documents, labs and open projects?

Was it helpful?

Solution

As of right now HNP protocol is not supported in the Android. The only way to do this would be to reset the USB stack on your board and re enumerate each time you want to switch modes.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top