Can't find device error when flashing the Librem 5

I have Amber on my L5USA, and I want to upgrade to Byzantium, so I followed these instructions to try to flash Byzantium on the phone from an x86_64 PC running Debian 11 (bullseye).

Here are the commands I used:

$ sudo apt install git uuu
$ git clone https://source.puri.sm/Librem5/librem5-flash-image.git
$ cd librem5-flash-image/
$ sudo apt build-dep .
Note, using directory '.' to get the build dependencies
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
  autoconf automake autopoint autotools-dev debhelper dh-autoreconf
  dh-strip-nondeterminism dwz flake8 help2man libdebhelper-perl
  libfile-stripnondeterminism-perl libsub-override-perl libtool m4 po-debconf
  python3-coloredlogs python3-flake8 python3-humanfriendly python3-mccabe
  python3-pycodestyle python3-pyflakes python3-tqdm
0 upgraded, 23 newly installed, 0 to remove and 0 not upgraded.
Need to get 4,766 kB of archives.
After this operation, 11.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] y

[snip -installs the software here-]

$ sudo ./scripts/librem5-flash-image --udev
2021-11-19 21:21:06 INFO Udev rules '/etc/udev/rules.d/70-librem5-flash-image.rules' updated. You can now flash without root permissions.
$ ./scripts/librem5-flash-image
2021-11-19 21:21:41 INFO Looking for librem5r4 plain byzantium image
2021-11-19 21:21:43 INFO Found disk image Build 9570 'plain librem5r4 byzantium image' from Thu Nov 18 22:12:42 2021
2021-11-19 21:21:43 INFO Found uboot Build 82 from Fri Sep 10 14:19:03 2021
2021-11-19 21:21:43 INFO Downloading to ./devkit_image_fb6hdckj
2021-11-19 21:21:43 INFO Downloading image from https://arm01.puri.sm/job/Images/job/Image%20Build/9570/artifact/librem5r4.img.xz
                                                                               2021-11-19 21:23:47 INFO Calculating sha256sum of ./devkit_image_fb6hdckj/librem5r4.img
2021-11-19 21:23:58 INFO Downloading uboot from https://arm01.puri.sm/job/u-boot_builds/job/uboot_librem5_build/82/artifact/output/uboot-librem5/u-boot-librem5.imx
                                                                                
            Turn all Hardware-Kill-Switches off
            Remove battery
            Hold volume-up
            Insert the USB-c cable: (red light blinks, no green light)
            Reinsert the battery: (red light is constantly on, the script will continue)

Searching...

I turned off all the kill switches, removed the battery, then held down the Volume Up button and inserted the USB-C cable into the L5USA. I saw nothing on the phone, so I turned over the USB-C cable and reinserted it, and then I saw a blinking red light on the phone. However, I then see the following error in the output on my PC:

uuu (Universal Update Utility) for nxp imx chips -- lib1.4.77

Success 0    Failure 1                                                         
                                                                                
                                                                                
1:4      3/ 3 [=================100%=================] SDPV: jump               
2:4      2/ 4 [Bulk(W):LIBUSB_ERROR_NO_DEVICE        ] FB: ucmd setenv mmcdev 0 

2021-11-19 21:24:17 INFO Cleaning up.
Traceback (most recent call last):
  File "/home/amos/purism/librem5-flash-image/./scripts/librem5-flash-image", line 471, in <module>
    sys.exit(main())
  File "/home/amos/purism/librem5-flash-image/./scripts/librem5-flash-image", line 455, in main
    flash_image(uuu_target, args.debug)
  File "/home/amos/purism/librem5-flash-image/./scripts/librem5-flash-image", line 299, in flash_image
    subprocess.check_call(['uuu', uuu_target])
  File "/usr/lib/python3.9/subprocess.py", line 373, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['uuu', './devkit_image_fb6hdckj/flash_librem5r4.lst']' returned non-zero exit status 255.```

Any idea why the script can’t find the device? Has anyone else seen this problem?

1 Like

There isn’t any problem, I think. Please download latest librem5-flash-image (from 12 September) at first place, extract it and use this command:
./scripts/librem5r4-flash-image --variant plain −− or other one.

I figured out what is the problem. Flashing the phone doesn’t seem to work from a USB-C port on the PC. However, it does work for me from a USB-A port on the same PC.

I was using the USB-C to USB-C cable that came with the L5USA. When I tried using a USB-A to USB-C cable, I was able to flash the phone:

uuu (Universal Update Utility) for nxp imx chips -- lib1.4.77

Success 1    Failure 0                                                                                                                                                                                            
                                                                                                                                                                                                                   
                                                                                                                                                                                                                   
1:1      4/ 4 [Done                                  ] FB: Done                                                                                                                                                    


2021-11-20 07:59:03 INFO Cleaning up.

The documentation needs to be fixed. This line needs to be changed from:

Make sure you have installed all python dependencies sudo apt build-dep . .

To:

Make sure you have installed all python dependencies sudo apt build-dep .

(remove the extra period at the end)

Then, this needs to be added to the documentation:

Do NOT use the USB-C to USB-C cable that comes with the phone. Instead use a USB-A to USB-C cable to flash the phone.

2 Likes

Yes, USB-C to USB-A (3.1/blue colored) cable might be preferable option, but still and in order to make sure that USB-C to USB-C cable (why not?) of your choice found your device it is slightly better, IMO, to use Jumpdrive (just another script), execute sudo fdisk -l (or something else) to check if your Librem 5 already recognized from your computer side and when asked/introduced to:

just take out your Librem 5 battery and put it back in. Your install procedure should continue from there as well, without disconnecting/reconnecting any data (5Gbps or 10Gbps) USB cable again, the one that is already connected to your computer (perhaps USB-C to USB-C data one, not sure as didn’t try this myself).

Odd. I did it usb-c to usb-c. I think it was the cable that purism provided too.

1 Like

I’m using the USB-C that came with the phone over a USB-A adapter. I think the problem is somewhere else, but hard to tell where.

1 Like

I’m accepting gladly your advice as another (besides above kind recommendation from @amosbatto) and as purposely better solution. And luckily I found mine, just before vacuum cleaner comes, somewhere on the floor:

This may be hasty. The script didn’t work in one situation for unknown reasons. Perhaps the documentation should suggest: If you get the error LIBUSB_ERROR_NO_DEVICE and you are using a USB-C port on your computer then try using a USB-A port on your computer instead.

(That would necessitate either having a USB-C to USB-A cable or having a USB-C to USB-A adapter. I am using the latter. I have no USB-C ports on the computer I was testing with. I was using the Purism-supplied USB-C to USB-C cable.)

It really needs more investigation e.g. is the problem reproducible for you? what does lsusb give when it works and when it doesn’t work?

What operating system and version do you have on the computer? Are you using the version of uuu that came with the operating system or did you git clone Purism’s version and built it from sources?

1 Like

I’m not sure if this is a problem with my Thinkpad T480s laptop running Debian 11 (bullseye) or the Librem 5 USA (byzantium), but when I plug the phone into the laptop’s USB 3.1 Type-C port, dmesg on the laptop shows:

[95458.085789] usb usb2-port4: Cannot enable. Maybe the USB cable is bad?
[95458.085962] usb usb2-port4: config error
[95461.625691] usb usb2-port4: config error
[95466.017158] usb 2-4: Device not responding to setup address.
[95466.225488] usb 2-4: Device not responding to setup address.
[95466.433626] usb 2-4: device not accepting address 115, error -71
[95467.198251] usb usb2-port4: config error
[95471.053676] usb usb2-port4: config error
[95474.193657] usb usb2-port4: config error
[95478.713607] usb usb2-port4: config error
[95480.603146] usb 2-4: new SuperSpeed Gen 1 USB device number 117 using xhci_hcd
[95485.745891] usb 2-4: unable to read config index 0 descriptor/all
[95485.745902] usb 2-4: can't read configurations, error -110
[95485.946950] usb 2-4: new SuperSpeed Gen 1 USB device number 118 using xhci_hcd
[95485.972162] usb 2-4: New USB device found, idVendor=316d, idProduct=4c05, bcdDevice= 5.13
[95485.972168] usb 2-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[95485.972171] usb 2-4: Product: Librem 5
[95485.972174] usb 2-4: Manufacturer: Purism, SPC
[95485.972176] usb 2-4: SerialNumber: 0123456789
[95485.978490] cdc_acm 2-4:1.0: ttyACM0: USB ACM device
[95485.988692] cdc_ether 2-4:1.2 usb0: register 'cdc_ether' at usb-0000:00:14.0-4, CDC Ethernet Device, ce:96:4c:e5:75:d6
[95486.028865] cdc_ether 2-4:1.2 enxce964ce575d6: renamed from usb0
[95487.634176] cdc_acm 2-4:1.1: acm_start_wb - usb_submit_urb(write bulk) failed: -19
[95487.634242] cdc_acm 2-4:1.1: acm_start_wb - usb_submit_urb(write bulk) failed: -19
[95487.638539] xhci_hcd 0000:00:14.0: WARN Set TR Deq Ptr cmd failed due to incorrect slot or ep state.
[95487.639119] cdc_acm 2-4:1.0: acm_port_activate - usb_submit_urb(ctrl irq) failed
[95487.773514] usb 2-4: USB disconnect, device number 118
[95487.774528] cdc_ether 2-4:1.2 enxce964ce575d6: unregister 'cdc_ether' usb-0000:00:14.0-4, CDC Ethernet Device
[95487.778366] xhci_hcd 0000:00:14.0: WARN Set TR Deq Ptr cmd failed due to incorrect slot or ep state.

The L5USA is able to charge from my laptop’s USB 3.1 Type-C port, but the L5USA’s dmesg shows:

[58249.076792] dwc3 38100000.usb: request 000000008a157325 was not queued to ep1in
[58265.458580] dwc3 38100000.usb: request 0000000014428761 was not queued to ep1in
[58281.972669] bq25890-charger 3-006a: NTC state normal
[58282.008733] bq25890-charger 3-006a: Upstream supply changed: 0.
[58282.008758] bq25890-charger 3-006a: Disabling OTG_EN pin
[58282.015157] bq25890-charger 3-006a: Upstream supply changed: 0.
[58282.015179] bq25890-charger 3-006a: Disabling OTG_EN pin
[58292.838727] bq25890-charger 3-006a: Upstream supply changed: 1.
[58292.838753] bq25890-charger 3-006a: Disabling OTG_EN pin
[58292.844886] bq25890-charger 3-006a: Upstream supply changed: 1.
[58292.844908] bq25890-charger 3-006a: Disabling OTG_EN pin
[58292.979565] bq25890-charger 3-006a: Upstream supply changed: 1.
[58292.979589] bq25890-charger 3-006a: Disabling OTG_EN pin
[58293.106909] bq25890-charger 3-006a: NTC state normal
[58293.194640] bq25890-charger 3-006a: NTC state normal
[58296.978674] dwc3 38100000.usb: request 0000000084b945db was not queued to ep1in
[58457.242184] edt_ft5x06 2-0038: Unable to fetch data, error: -6
[59038.886105] edt_ft5x06 2-0038: Unable to fetch data, error: -6
[59129.947860] edt_ft5x06 2-0038: Unable to fetch data, error: -6
[59167.013722] edt_ft5x06 2-0038: Unable to fetch data, error: -6
[59203.333488] edt_ft5x06 2-0038: Unable to fetch data, error: -6
[59216.414748] edt_ft5x06 2-0038: Unable to fetch data, error: -6
[59257.353366] edt_ft5x06 2-0038: Unable to fetch data, error: -6
[59485.892765] edt_ft5x06 2-0038: Unable to fetch data, error: -6
[59677.709984] edt_ft5x06 2-0038: Unable to fetch data, error: -6

What do other people see when they plug in their L5 to a USB-C port on a PC?

I wonder if there are manufacturing defects in my L5USA, because it produces no audio, and dmesg in both Amber and Byzantium show:

[   10.436088] wm8962 2-001a: ASoC: error at soc_component_read_no_lock on wm8962.2-001a: -16
[   10.448413] wm8962 2-001a: ASoC: error at soc_component_read_no_lock on wm8962.2-001a: -16

I also see:

[   10.288280] dw9714 3-000c: I2C write fail
[   10.288279] caam 30900000.crypto: Instantiated RNG4 SH1
[   10.288297] caam 30900000.crypto: device ID = 0x0a16040100000000 (Era 9)
[   10.292326] dw9714 3-000c: dw9714_vcm_suspend I2C failure: -5
[   10.294138] s5k3l6xx: i2c_read: error during transfer (-6)

Does anyone else see these errors in their dmesg?

I do have the caam lines ands the wm8962 lines. I don’t have the dw9714 lines or s5k3l6xx.
My audio works fine though.

Keep in mind those lines aren’t necessarily in this order or close to each other.


As we all might learn from there, is it this issue you are having on Intel® Thunderbolt™ 3 port 2 or on USB-C™ port 1?

EDIT: Please be aware of this recent note: “Lenovo recommends users immediately update the applicable systems with these Intel Driver and Firmware packages.

usb-c port of Librem14:

[1096312.628875] usb usb2-port3: config error
[1096313.848835] usb usb2-port3: config error
[1096314.121382] usb 2-3: new SuperSpeed Gen 1 USB device number 5 using xhci_hcd
[1096314.145814] usb 2-3: New USB device found, idVendor=316d, idProduct=4c05, bcdDevice= 5.13
[1096314.145818] usb 2-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[1096314.145820] usb 2-3: Product: Librem 5
[1096314.145821] usb 2-3: Manufacturer: Purism, SPC
[1096314.145822] usb 2-3: SerialNumber: 0123456789
[1096314.150287] cdc_acm 2-3:1.0: ttyACM0: USB ACM device
[1096314.192403] cdc_ether 2-3:1.2 usb0: register 'cdc_ether' at usb-0000:00:14.0-3, CDC Ethernet Device, 00:11:22:33:44:55

usb-a port of Librem14:

[1096400.717359] usb 1-7: new high-speed USB device number 6 using xhci_hcd
[1096400.869858] usb 1-7: New USB device found, idVendor=316d, idProduct=4c05, bcdDevice= 5.13
[1096400.869864] usb 1-7: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[1096400.869867] usb 1-7: Product: Librem 5
[1096400.869870] usb 1-7: Manufacturer: Purism, SPC
[1096400.869872] usb 1-7: SerialNumber: 0123456789
[1096400.874452] cdc_acm 1-7:1.0: ttyACM0: USB ACM device
[1096400.877921] cdc_ether 1-7:1.2 usb0: register 'cdc_ether' at usb-0000:00:14.0-7, CDC Ethernet Device, 00:11:22:33:44:55

The phone started charging on both ports.

2 Likes

Is this

a) just boot Librem 5 normally and plug it in, or
b) setting Librem 5 up for flashing etc.?

With amber at least you get a different USB vendor and product id depending on which of those two scenarios applies, and you get different devices and functions available.

I only ask this because you started out talking about flashing your phone.

The obvious fault isolation … do you have any other USB-C-capable device that you can try?