Reflashing Librem 5 Failure

Reflashing has failed. I followed Purism’s steps here, but terminal says the reflash failed. I’m not quite to the level of interpreting/understanding this. Does anyone know the issue? Thanks.

Download:  87%|█████████████████████████████████████████████████████████████████████████████████▊            | 3628228019/4171456508 [55:07<08:06, 1116451.63it/s]2023-11-01 15:58:08,079 INFO Connection error, retrying███████████████████████████████████████████████▎           | 3937887992/4500000256 [55:07<08:22, 1117583.38it/s]
Download:  87%|█████████████████████████████████████████████████████████████████████████████████▊            | 3628241594/4171456508 [55:20<08:06, 1116451.63it/s]2023-11-01 15:58:23,550 INFO Connection error, retrying███████████████████████████████████████████████▎           | 3937901567/4500000256 [55:20<08:22, 1117583.38it/s]
2023-11-01 15:58:38,882 INFO Connection error, retrying
                                                                                                                                                                  2023-11-01 16:06:56,220 INFO Calculating sha256sum of ./tmp_librem5-flash-image_hw03nr5p/librem5r4.img                                                                 
2023-11-01 16:09:06,344 INFO Downloading uboot from https://arm01.puri.sm/job/u-boot_builds/job/uboot_librem5_build/85/artifact/output/uboot-librem5/u-boot-librem5.imx
 90%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████                | 966656/1073880 [00:01<00:00, 1165059.78it/s]
            Enter the flashing mode by holding volume-up button while turning the phone on.

            If it's not detected, follow these steps:
            - Ensure that the phone is powered off
            - Turn all Hardware-Kill-Switches off
            - Unplug the USB cable if connected
            - Remove battery
            - Hold volume-up button
            - Insert the USB-C cable (red light blinks, no green light)
            - Reinsert the battery (red and green lights constantly on, the script will continue)
            - Release volume-up button

Searching...
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 1073880/1073880 [00:13<00:00, 1165059.78it/s]uuu (Universal Update Utility) for nxp imx chips -- lib1.4.77

Success 0    Failure 1                                                                                                                                                                                            
                                                                                                                                                                                                                   
                                                                                                                                                                                                                   
1:2      1/ 1 [HID(W):LIBUSB_ERROR_TIMEOUT           ] SDP: boot -f u-boot-librem5.imx                                                                                                                             


2023-11-01 16:13:29,095 INFO Cleaning up.
Traceback (most recent call last):
  File "/home/redactedUserName/librem5-flash-image/./scripts/librem5-flash-image", line 538, in <module>
    sys.exit(main())
  File "/home/redactedUserName/librem5-flash-image/./scripts/librem5-flash-image", line 521, in main
    flash_image(uuu_target, args.debug)
  File "/home/redactedUserName/librem5-flash-image/./scripts/librem5-flash-image", line 351, 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', './tmp_librem5-flash-image_hw03nr5p/flash_librem5r4.lst']' returned non-zero exit status 255.
redactedUserName@redactedUserName-optiplex-Pureos:~/librem5-flash-image$   
1 Like

Follow-up question: Is there an easy way to re-try the ‘reflashing the phone’ portion of this script without re-downloading the image that was downloaded in the previous step?

1 Like

Use the following additional argument to the script

--skip-download

For starters, always do lsusb on the host computer once the phone is connected to the host computer via USB and the phone is in serial download mode, in order to confirm that
a) the phone is seen by the host computer, and
b) the phone really is in serial download mode.

1 Like

Apparently, that may be part of the problem? Based on the list below, I would assume the Librem 5 is undetected:

xx-Pureos:~/librem5-flash-image$ lsusb
Bus 002 Device 002: ID 0bc2:ab24 Seagate RSS LLC Backup Plus Portable Drive
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 086: ID 0572:14c1 Conexant Systems (Rockwell), Inc. USB Audio
Bus 001 Device 043: ID 0c45:7403 Microdia Foot Switch
Bus 001 Device 042: ID 0c45:7403 Microdia Foot Switch
Bus 001 Device 085: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 041: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

1 Like

See this post: Librem 5 Flashing the Jail - #4 by irvinewade for what the Librem 5 should look like when using lsusb on the host computer if you successfully put the phone in serial download mode.

Even if you did not succeed in getting serial download mode, the phone should show up as something. Maybe check/change USB port on host, USB cable, USB cable orientation.

But for sure if the host computer does not see the phone as an appropriate type of USB device then communication between the host computer and the phone using uuu will fail.

2 Likes

Got it! :slight_smile: I see the librem phone. (Had to try one of the usb ports on the back of my machine… instead of the ones on front.)

Bus 001 Device 108: ID 1fc9:012b NXP Semiconductors i.MX 8M Dual/8M QuadLite/8M Quad Serial Downloader

Thanks!

1 Like

The command worked. However, Terminal claims a directory is required:

,769 ERROR Skipping download requires a directory to be specified with --dir

I found the image in my “/home/[username]/” directory. Presuming that is the correct one to path to, do you know what code I would append to the command? Something like…

./scripts/librem5-flash-image --skip-download --dir-______?

I do know the following is incorrect:

./scripts/librem5-flash-image --skip-download --dir-/home/[username]/
1 Like

That should be --dir /somepath i.e. a space after --dir and before the path for the directory.

I thought, but I could be wrong, that it creates a temporary directory (tmp_...) if you don’t specify where the download is going.

1 Like

There is not supposed to be a dash after the --dir argument. It should be something like this:

./scripts/librem5-flash-image --skip-download --dir /home/[username]/

Usually I just drag and drop the directory into the Terminal after the argument to populate it with the correct value.

1 Like