AnsweredAssumed Answered

Role switch issue with iMX6UL

Question asked by Ranjan Kumar on Jan 30, 2019
Latest reply on Feb 6, 2019 by Ranjan Kumar


We are using iMX6UL and using usb1 as otg port to connect to Apple device.I have enabled hnp and srp in device tree.We are trying to achieve role switch on usb1 port .Host to device is happening and we are able communicate with apple device.But when communication is not happening on usb1 then we want role switch to happen from Device to host and iMX should start charging Apple device.It is showing role switch has happened to Host mode

 cat /sys/kernel/debug/ci_hdrc.0/role -> Host

But the problem is Apple device is not getting charged or more specific Apple device is not getting enumerated on iMX side.

We are using Linux 4.9.11 version . Can any body have any patch or solution to this problem.


UART2 Serial Port Initializing


  Module Controller UARTt port tymxc1 Opened Successfully
 len 35
dRate = 115200
using random self ethernet address


  Parity   = noneStarting Module Controller Read thread
 Starting Module Controller Send Command thread
 Moodule controller UART Init End
initTransducerDetectionSystem Entry
 Test Writusing random host ethernet address
e function testing


 iap_host_register_device_ready_callback called


iAP2_Host_bfnHostInitiusb0: HOST MAC b2:43:27:12:8e:80
alization called
iAP2_Host_bfnHostInitialization start
iAP2_Host_SetConfig start
  using hiddev: /dev/usb/hiddev0
  using i2cdev: /dev/i2c-1
  using i2caddrusb0: MAC 22:73:55:4b:40:80
: 17


 Open /dev/mfi-ffs/ep0
g_ffs gadget: g_ffs ready


 Send USB descriptors


 Send USB strings
  UART2 Read Thread Entry


 Allocate buffer for endpoint
ep0_thread_function(): EVENT BIND
VID: 0x5ac
PID: 0x12ab
USB Apple Device Detected




  iAP2_USB_Device : Send role switch USB request using received value
usb 1-1: USB disconnect, device number 2
Debug: Closing libusb ci_hdrc ci_hdrc.0: remove, state 1


usb usb1: USB disconnect, device number 1


Debug: Switching to device mode
ci_hdrc ci_hdrc.0: USB bus 1 deregistered
USB MFI role switch status: 0


Starting iAP_USBDev_init_usb_gffs_device


oen FFS_OUT /dev/mfi-ffs/ep1 12


oen FFS_IN /dev/mfi-ffs/ep2 13


oen FFS_NATIVE_OUT /dev/mfi-ffs/ep3 14


oen FFS_NATIVE_IN /dev/mfi-ffs/ep4 15
iAP2_Host_vfStateMachineDriver start


iAP_USBDev_read_thread_native started


iap_usb_device_read_native_enable 1


iAP_USBDev_read_thread started
g_ffs gadget: high-speed config #1: FunctionFS + NCM
ep0_thread_function(): EVENT ENABLE
iAP2_Sessions_vfnStateMachine started
iAP2_Link_vfnTask start
iAP_Auth_vfnStateMachine started


 iAP2_Link_vfnReleaseMemReqId 0
iAP Host Initialization completeci_hdrc ci_hdrc.0: EHCI Host Controller

Inside IF block of main app


 Inside transducer_charger_checkInside IF block of ChargerDetectionThread
ERROR: iAP_USBDev_read_native, errno: 108 ret -1
ep0_thread_function(): EVENT DISABLE
ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: EHCI Host Controller
usb usb1: Manufacturer: Linux 4.9.11-02215-g5aba4a9 ehci_hcd
usb usb1: SerialNumber: ci_hdrc.0
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected
ep0_thread_function. ENDED



Waiting for reply.

Thanks and Regards