iMX6 AOA protocol not working

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

iMX6 AOA protocol not working

1,087 Views
mixa
Contributor III

Hi,

I`m working on iMX6 dual and on a board based on SabreSD. I have JB4.3 with BSP 1.1.0 & 1.1.1, kernel version 3.0.35 and I`m trying to start accessory mode to uses AOA. I have traced down the problem that the device is never presenting it self as an accessory USB PID: 0x2D00 or 0x2D01.

When I look the kernel logs I can see some errors while trying to switch device to accesory mode:

<3>acc_complete_set_string, err -108

<3>acc_complete_set_string, err -108

<3>acc_complete_set_string, err -108

<6>acc_open

<6>acc_release

<6>acc_open

<6>acc_release

<6>adb_release

<6>mtp_release

<6>adb_open

I have found that error -108 is -ESHUTDOWN error code from kernel/include/asm-generic/errno.h.

When I try this on Samsung Galaxu Nexus or Note4 where it works I can see in kernel log:

<6>[24186.401763] acc_open

<6>[24186.401977] acc_release

<6>[24186.402099] acc_open

<6>[24186.402191] acc_release

<6>[24186.404663] mtp_release

<6>[24186.404907] adb_release

<3>[24186.406127] android_usb: already disabled

<6>[24186.411895] adb_open

<6>[24186.412078] acc_bind_config

<6>[24186.412628] adb_bind_config

On my device it never reaches acc_bind_config and shows errors while trying to switch to accessory mode.

Did anybody encountered this problem, or have any idea where to look??

Labels (2)
0 Kudos
8 Replies

681 Views
mixa
Contributor III

Another strange thing I have found is when I put some simple printk in acc_ctrlrequest function in f_accessory.c I do not get errors any more and device show PID 2D01 but still AOA does not work... It is very strange just putting unrelated printk that changes the behaviour. Can this be some race condition or similar?

0 Kudos

681 Views
CarlosCasillas
NXP Employee
NXP Employee

Hi Mihailo,

We are internally reviewing you case. I will send you an update soon.

Best regards!

/Carlos

0 Kudos

681 Views
mixa
Contributor III

It still does not work while testing it on RPi with HelloADK and HelloADK app from Play store (YuuichiAkagawa/RPi_ADK · GitHub​ ) without modifying the kernel and putting either printk or udelay(100) in acc_ctrlrequest. Both Galaxy Nexus and Note 4 works with HelloADK flawlessly.

If I do not modify the kernel HelloADK binary goes into loop as device never reports as PID: 2D01 and I get those errors in kernel log. Otherwise it works fine.

0 Kudos

681 Views
CarlosCasillas
NXP Employee
NXP Employee

Hi,

Could you please help us providing detailed steps to reproduce your observed behavior?

We will be waiting for your reply.

Best regards!

/Carlos

0 Kudos

681 Views
mixa
Contributor III

Hi,

It seems that the problem was in HelloADK example on RPi side. I have added sleep for 1 second between sending strings on USB and it works fine.

You can reproduce this with using this app on RPi  and YuuichiAkagawa/HelloADK · GitHub and download HelloADK from PlayStore.

Regards,

Mihailo

0 Kudos

681 Views
CarlosCasillas
NXP Employee
NXP Employee

So from your original question:

I have traced down the problem that the device is never presenting it self as an accessory USB PID: 0x2D00 or 0x2D01.

It can presenting it self as an accessory per my test.

And the test example can work as you explained, do you still have any issue?

Best regards!

0 Kudos

681 Views
mixa
Contributor III

The only issue I have now is that when device switches to accessory mode (0x2D01) when I unplug usb and plug it again it stays in accessory mode, it won`t turn back to mtp. When I try that with a phone it works normally.

I`ll have to check on SabreSD Platform board instead on my custom device to see if it is the same behaviour.

Thanks,

Mihailo

0 Kudos

681 Views
mixa
Contributor III

I have made another discovery. Because we removed the factory SystemUI the AOA was not working as there were no body to grant permission and call the AOA app, this was done by SystemUI.
With the factory SystemUI and no changes in kernel, device can switch to accessory mode and AOA works. But when unplugging the accessory from the device does not switch it back to normal mode. I have compared kernel logs from iMX6 and Samsung Galaxy Nexus, and I can notice that there is no disconnect events (even when not in accessory mode, but normal adb) - android_work: sent uevent USB_STATE=DISCONNECTED. On Samsung Galaxy Nexus I can see the disconnects and it switches back to mtp with adb from acc and back when I unplug/plug the accessory.

0 Kudos