Android-tools: fastboot <waiting for device>

Hi there,

I just wanted to check if anyone could or did recently flash a custom firmware or Android build to their smartphone. I did today and it hang with the message <waiting for device>.
Command (in fastboot mode): fastboot flash abl_ab abl.elf
Reference: Update firmware on beryllium | LineageOS Wiki

Now I’m not sure if it’s a bug with NixOS or my laptop’s fault.
It worked without any problems on my desktop PC with arch installed.

Cheers

How do you have adb installed?

You should set

programs.adb.enable = true;

and add your user to the adbusers group for adb to work properly.

I did follow the wiki from Android - NixOS Wiki and set

  programs.adb.enable = true;
  users.users.<your-user>.extraGroups = ["adbusers kvm"];

Before that, adb wouldn’t start. Currently adb works without any problems but fastfetch doesn’t.

Is the device connected? Check lsusb.

I usually also keep dmesg -w running while working with devices; it logs USB device connects and disconnects.

lsusb lists the device as connected.
dmesg -w goes wild when I try to flash a image to the device with the command:

  1. Boot device into fastboot with adb reboot bootloader
usb 1-1: new full-speed USB device number 10 using xhci_hcd
usb 1-1: new high-speed USB device number 11 using xhci_hcd
usb 1-1: New USB device found, idVendor=xxxx, idProduct=xxxx, bcdDevice= 1.00
usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1: Product: Android
usb 1-1: Manufacturer: Google
usb 1-1: SerialNumber: xxxxxxxx
  1. Run fastboot flash abl_ab abl.img
  2. After pressing enter the terminal freezes with the output
Sending 'abl_ab' (204 KB)
  1. After a few minutes, I cancel the command and execute fastboot devices.
    The command doesn’t list the android device and dmesg -w prints the following:
usb 1-1: reset high-speed USB device number 11 using xhci_hcd
usb 1-1: device descriptor read/64, error -110
usb 1-1: device descriptor read/64, error -71
usb 1-1: reset high-speed USB device number 11 using xhci_hcd
usb 1-1: device descriptor read/64, error -71
usb 1-1: device descriptor read/64, error -71
usb 1-1: reset high-speed USB device number 11 using xhci_hcd
usb 1-1: Device not responding to setup address.
usb 1-1: Device not responding to setup address.
usb 1-1: device not accepting address 11, error -71
usb 1-1: reset high-speed USB device number 11 using xhci_hcd
usb 1-1: Device not responding to setup address.
usb 1-1: Device not responding to setup address.
usb 1-1: device not accepting address 11, error -71
usb 1-1: USB disconnect, device number 11
usb 1-1: new high-speed USB device number 12 using xhci_hcd
usb 1-1: device descriptor read/64, error -71
usb 1-1: device descriptor read/64, error -71
usb 1-1: new high-speed USB device number 13 using xhci_hcd
usb 1-1: device descriptor read/64, error -71
usb 1-1: device descriptor read/64, error -71
usb usb1-port1: attempt power cycle
usb 1-1: new high-speed USB device number 14 using xhci_hcd
usb 1-1: Device not responding to setup address.
usb 1-1: Device not responding to setup address.
usb 1-1: device not accepting address 14, error -71
usb 1-1: new high-speed USB device number 15 using xhci_hcd
usb 1-1: Device not responding to setup address.
usb 1-1: Device not responding to setup address.
usb 1-1: device not accepting address 15, error -71
usb usb1-port1: unable to enumerate USB device

and lsusb doesn’t list the previous device anymore.

You could try a different port or cable but that smells like an issue with the device?

So, I assume, that it works for you without any problems on 24.11 unstable?

Did you use an USB C-to-C cable?

I was told C-to-C cables do not work in fastboot mode on some devices.

Try an A-to-C cable instead.

I did use the same USB-A to USB-C on my laptop and tower PC. The only difference is that my laptop runs NixOS and my tower arch. Therefore I concluded that it could be a bug on the NixOS side or the android-tool package.