Hello Prabhat! I tried and unfortunately, now it doesn't show up any more on adb, the driver on lsusb is null:
    |__ Port 2: Dev 17, If 0, Class=Diagnostic, Driver=, 5000M
and on the target, the connection is more unstable - and I get a logcat full of ADB issues and crashes... I've attached it.

Cheers

- Valerio


Valerio Pilo / PU IVI Amsterdam / valerio.pilo@tomtom.com / +31 (0) 20 7575 218 Amsterdam ODE / www.tomtom.com


From: Pandey, Prabhat Chand <prabhat.chand.pandey@intel.com>
Sent: Thursday, March 12, 2020 06:53
To: Valerio Pilo <Valerio.Pilo@tomtom.com>; celadon@lists.01.org <celadon@lists.01.org>
Subject: RE: [CELADON_IVI] USB over DBC on NUC hardware
 

Hello Valerio,

 

Can you please set below android property and try:

setprop persist.adb.nonblocking_ffs 0

 

Regards,

Prabhat Pandey

 

From: Valerio Pilo <Valerio.Pilo@tomtom.com>
Sent: Wednesday, March 11, 2020 5:32 PM
To: Pandey, Prabhat Chand <prabhat.chand.pandey@intel.com>; celadon@lists.01.org
Subject: [01.org Celadon] Re: [CELADON_IVI] USB over DBC on NUC hardware

 

Hello Prabhat, thank you too for your help! Greatly appreciated, really!!

 

I'll answer inline:

 

>>> The target always shows as offline in ADB (e.g. `adb devices` shows `0001 offline` - using the Celadon build's ADB binary).

You mean, you are using adb binary from this path: $(Project)/out/host/linux-86/bin/adb

Valerio: Yes. I make sure that's the only ADB I have installed - and I make sure Android Studio is not around to start its own ADB 😉

 

>>> On the target, the file `/sys/bus/pci/devices/0000:00:14.0/dbc` yields `configured` (and dbc also looks good on the host side).

Means DbC state change is also working fine, remember to do plug cable after boot the system, if you are using host kernel <5.1

Valerio: On my host I'm running 5.3.0-40-generic on Ubuntu 18.04.

 

>>> The exception being [sys.usb.controller]: [none] - but changing it to `dwc3.1.auto` manually doesn't do anything.

This is not required to do, as in case of ADB over DbC, DWC will not be used.

Valerio: I am just wondering why sys.usb.controller is empty.. what should it be set to, and by which initrc script?

 

>>> I suspect a misconfiguration of the USB gadget in the USB-related init.rc file, as I can not write anything to the gadget's UDC file

Not required to write anything to UDC in case ADB over DbC.

Valerio: Okay, but the system is trying to, and constantly: every single second I see the same log messages from dmesg:

[ 5025.532326] read descriptors

[ 5025.532345] read strings

[ 5025.532704] init: processing action (sys.usb.config=adb && sys.usb.configfs=1 && sys.usb.ffs.ready=1) from (/init.usb.configfs.rc:20)

[ 5025.532957] init: Command 'write /config/usb_gadget/g1/UDC ${sys.usb.controller}' action=sys.usb.config=adb && sys.usb.configfs=1 && sys.usb.ffs.ready=1 (/init.usb.configfs.rc:23) took 0ms and failed: Unable to write to file '/config/usb_gadget/g1/UDC': Unable to write file contents: No such device

 

Please help to answer below question, which may help me to debug further:

 

  1. Can you make the sepolicy to permissive?
    Valerio: I set selinux to permissive and restarted ADB (by unplugging-waiting-replugging the usb cable). does not help unfortunately.
  2. Run ls -l /dev/dbc_raw0 and share.
    Valerio: ls -la says: `crwxrwxrwx 1 system system 10,  52 2020-03-11 05:31 /dev/dbc_raw0`
  3. Please share me your Celadon version Release detail, which you are using.
    repo info says my manifest revision is `refs/tags/android-10.0.0_r25` or `master`. I updated and rebuilt for the last time yesterday morning.

 

Let me know if you need any other info.

And thank you again!

 

Cheers

- Valerio

 

Valerio Pilo / PU IVI Amsterdam / valerio.pilo@tomtom.com / +31 (0) 20 7575 218 Amsterdam ODE / www.tomtom.com


From: Pandey, Prabhat Chand <prabhat.chand.pandey@intel.com>
Sent: Wednesday, March 11, 2020 12:08
To: Valerio Pilo <Valerio.Pilo@tomtom.com>; celadon@lists.01.org <celadon@lists.01.org>
Subject: RE: [CELADON_IVI] USB over DBC on NUC hardware

 

Hello Valerio,

 

>>> The target always shows as offline in ADB (e.g. `adb devices` shows `0001 offline` - using the Celadon build's ADB binary).

You mean, you are using adb binary from this path: $(Project)/out/host/linux-86/bin/adb

 

>>> We have the right kind of debug cable, as the target properly shows up in lsusb (`Class=Diagnostic, Driver=usbfs, 5000M`), and the host's dmesg says:

Looks Host System has properly enumerated the Target device, which means hardware and kernel side both is proper.

 

>>> On the target, the file `/sys/bus/pci/devices/0000:00:14.0/dbc` yields `configured` (and dbc also looks good on the host side).

Means DbC state change is also working fine, remember to do plug cable after boot the system, if you are using host kernel <5.1

 

>>> [persist.vendor.sys.usb.adbover]: [dbc]

Required android property is also set.

 

>>> The exception being [sys.usb.controller]: [none] - but changing it to `dwc3.1.auto` manually doesn't do anything.

This is not required to do, as in case of ADB over DbC, DWC will not be used.

 

>>> I suspect a misconfiguration of the USB gadget in the USB-related init.rc file, as I can not write anything to the gadget's UDC file

Not required to write anything to UDC in case ADB over DbC.

 

Please help to answer below question, which may help me to debug further:

 

  1. Can you make the sepolicy to permissive?
  2. Run ls -l /dev/dbc_raw0 and share.
  3. Please share me your Celadon version Release detail, which you are using.

 

Regards,

Prabhat Pandey

 

 

From: Valerio Pilo <Valerio.Pilo@tomtom.com>
Sent: Tuesday, March 10, 2020 6:28 PM
To: celadon@lists.01.org
Subject: [01.org Celadon] [CELADON_IVI] USB over DBC on NUC hardware

 

Hello!

My team is using Intel NUCs for Android development, and we are running Celadon on NUC7i5BNH and NUC7i5BNK.

I have been using a self-built `celadon_ivi-userdebug` lunch target since a couple months (and keeping it constantly updated from manifest), with great results.

Thank you very much, by the way - Celadon is making development a breeze for us!

 

There is only one hiccup: while ADB over ethernet works perfectly, it requires extra steps to set up.

We would like to instead use ADB over USB DbC, but I have not been able yet to make it work. The target always shows as offline in ADB (e.g. `adb devices` shows `0001 offline` - using the Celadon build's ADB binary).

We have the right kind of debug cable, as the target properly shows up in lsusb (`Class=Diagnostic, Driver=usbfs, 5000M`), and the host's dmesg says:

usb 4-1.3.3: new SuperSpeed Gen 1 USB device number 54 using xhci_hcd

usb 4-1.3.3: LPM exit latency is zeroed, disabling LPM.

usb 4-1.3.3: New USB device found, idVendor=1d6b, idProduct=0010, bcdDevice= 0.10

usb 4-1.3.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3

usb 4-1.3.3: Product: Linux USB Debug Target

usb 4-1.3.3: Manufacturer: Linux Foundation

usb 4-1.3.3: SerialNumber: 0001

On the target, the file `/sys/bus/pci/devices/0000:00:14.0/dbc` yields `configured` (and dbc also looks good on the host side).

Getprop has almost the right configuration:

[persist.vendor.sys.usb.adbover]: [dbc]

[sys.usb.config]: [adb]

[persist.sys.usb.config]: [adb]

[init.svc.adbd]: [running]

[sys.usb.ffs.ready]: [1]

The exception being [sys.usb.controller]: [none] - but changing it to `dwc3.1.auto` manually doesn't do anything.

 

On the target's logcat ADB complains - every single second - like this:

I adbd    : opening control endpoint /dev/usb-ffs/adb/ep0

I adbd    : UsbFfsConnection constructed

W adbd    : timed out while waiting for FUNCTIONFS_BIND, trying again

I adbd    : UsbFfs: connection terminated: monitor thread finished

I adbd    : UsbFfs: already offline

I adbd    : destroying transport UsbFfs

I adbd    : UsbFfsConnection being destroyed

 

And the target's dmesg also shows every second:

[ 5261.183485] read descriptors

[ 5261.183494] read strings

[ 5261.183761] init: processing action (sys.usb.config=adb && sys.usb.configfs=1 && sys.usb.ffs.ready=1) from (/init.usb.configfs.rc:20)

[ 5261.183986] init: Command 'write /config/usb_gadget/g1/UDC ${sys.usb.controller}' action=sys.usb.config=adb && sys.usb.configfs=1 && sys.usb.ffs.ready=1 (/init.usb.configfs.rc:23) took 0ms and failed: Unable to write to file '/config/usb_gadget/g1/UDC': Unable to write file contents: No such device

I suspect a misconfiguration of the USB gadget in the USB-related init.rc file, as I can not write anything to the gadget's UDC file (I get return value 1) and it is empty when using `cat /config/usb_gadget/g1/UDC`, while all other components seem to respond just fine.

 

Me not having enough knowledge about USB gadgets, DBC or functionfs, I would like to ask for help: does anyone have any pointers on why this might be happening?

 

Thank you in advance for your help,

kind regards

Valerio Pilo

 

Valerio Pilo / Expert Engineer / valerio.pilo@tomtom.com / +31 (0) 20 7575 218 Amsterdam ODE / www.tomtom.com