Re flash fails after following instrucions

I followed these instructions to reflash a Librem5 on Pop_OS (not a VM) and constantly fail.

This is output:
2024-11-19 13:39:33,636 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
78%|█████████████████████████████████████████████████████████████████████████████ | 835584/1073880 [00:00<00:00, 7616431.45it/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…
uuu (Universal Update Utility) for nxp imx chips – lib1.4.193

Success 0 Failure 1

5:1 3/ 5 [Bulk(R):LIBUSB_ERROR_NO_DEVICE ] FB: flash -raw2sparse all librem5r4.img
100%|██████████████████████████████████████████████████████████████████████████████████████████████████| 1073880/1073880 [00:12<00:00, 7616431.45it/s]

2024-11-19 13:39:51,570 INFO Cleaning up.
Traceback (most recent call last):
File “/home/newuser/librem5-flash-image/./scripts/librem5-flash-image”, line 538, in
sys.exit(main())
File “/home/newuser/librem5-flash-image/./scripts/librem5-flash-image”, line 521, in main
flash_image(uuu_target, args.debug)
File “/home/newuser/librem5-flash-image/./scripts/librem5-flash-image”, line 351, in flash_image
subprocess.check_call([‘uuu’, uuu_target])
File “/usr/lib/python3.10/subprocess.py”, line 369, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[‘uuu’, ‘./tmp_librem5-flash-image_vowd1mno/flash_librem5r4.lst’]’ returned non-zero exit status 255.

And the computer:
newuser@pop-os:~$ neofetch
///////////// newuser@pop-os
///////////////////// --------------
///////767//////////////// OS: Pop!_OS 22.04 LTS x86_64
//////7676767676
////////////// Host: HP ENVY dv6 Notebook PC 088B110000305910000620100
/////76767//7676767////////////// Kernel: 6.9.3-76060903-generic
/////767676///76767/////////////// Uptime: 3 mins
///////767676///76767.///7676
/////// Packages: 1886 (dpkg)
/////////767676//76767///767676//////// Shell: bash 5.1.16
//////////76767676767////76767///////// Resolution: 1366x768
///////////76767676//////7676////////// DE: GNOME 42.9
////////////,7676,///////767/////////// WM: Mutter
/////////////*7676///////76//////////// WM Theme: Pop
///////////////7676//////////////////// Theme: Pop [GTK2/3]
///////////////7676///767//////////// Icons: Pop [GTK2/3]
//////////////////////'//////////// Terminal: gnome-terminal
//////.7676767676767676767,////// CPU: AMD A8-4500M APU (4) @ 1.900GHz
/////767676767676767676767///// GPU: AMD ATI Radeon HD 7640G
/////////////////////////// Memory: 1203MiB / 5392MiB
/////////////////////

1 Like

I recommend that you follow the official documentation for the reflash procedure.

Are you successfully getting your Librem 5 into serial download mode? After you have done so, with the Librem 5 plugged into your host computer, use the lsusb command on the host computer to look at the Librem 5 and see how it displays to the host. You should see something like

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

The important bit is “serial downloader”. Don’t even worry about running the reflash script until you can get the above output.

You should also make sure that you have the latest version of the reflash script. Conversely, have you ever previously successfully reflashed?

1 Like

Dare I say, that in the ‘reflash’ procedure under Flash the Image that in my case, after diging out all the missing stuff required that we were trying flash Byzantium on to a Amber version. Too, I used @FranklyFlawless approach by using a USB stick instead of running off a PureOS desktop, or laptop.
~s

1 Like

With the battery removed - all switches down - volume up held - USB C connected

/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/6p, 5000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/12p, 480M
|__ Port 1: Dev 5, If 0, Class=Human Interface Device, Driver=usbhid, 480M
|__ Port 7: Dev 2, If 0, Class=Wireless, Driver=btusb, 12M
|__ Port 7: Dev 2, If 1, Class=Wireless, Driver=btusb, 12M

I am not seeing what you said is needed,
I get the same results with: different USB cable and holding power and volume up.

1 Like

You appear to have used lsusb -t

Just the vanilla lsusb output please.

However even from the output that you did post, I don’t see the phone.

So … forget about serial download mode or anything fancy. If you just boot the Librem 5 normally and plug it into your host computer via USB, do you see the phone appear on the host computer in lsusb output? (If you do then the output will be different from what I quoted above but it will still be progress.)

If you still get nothing then there may be merit in checking the system journal or log on the host computer to see whether there is any recognition that a USB device has been plugged in.

Note the generic advice from the reflash instructions when having problems with getting the Librem 5 to show up:

Some USB-C cables may need to be plugged into the phone with a particular orientation. If the instructions above do not appear to work, try flipping the USB-C end of the cable over and replugging it into the phone.

In other words, to elaborate further, on a typical host computer you have a zillion choices in total regarding

  • which USB port on the computer you use
  • whether the port is USB 2.0 USB-A connector, USB 3.x USB-A connector or USB 3.x USB-C connector
  • whether you use a USB port adapter (e.g. USB-A M with USB-C F)
  • what kind of cable you use (e.g. USB-A M to USB-C M or USB-C M to USB-C M)
  • and for any USB-C cable there are multiple orientations (2 if A-to-C and 4 if C-to-C).

I believe that I usually use a USB 3.x port that has a USB-A connector, with a USB-A to USB-C cable (i.e. not the Purism-supplied cable), and I’ve never had a problem with the orientation of the USB-C end of the cable (but having a problem with cable orientation is a USB hardware implementation issue, I think).

I am using Ubuntu 22.04 LTS i.e. very close to what you are using.

1 Like

Either append the --debug argument to the command for more verbose or use PureOS instead.

1 Like

I installed PurOs (after much difficulty) and did the lsusb. I appears OK.

Bus 001 Device 005: ID 8087:0a2a Intel Corp. Bluetooth wireless interface
Bus 001 Device 006: ID 138a:003f Validity Sensors, Inc. VFS495 Fingerprint Reader
Bus 001 Device 004: ID 05e3:0608 Genesys Logic, Inc. Hub
Bus 001 Device 003: ID 04f2:b51c Chicony Electronics Co., Ltd HP HD Camera
Bus 001 Device 002: ID 0438:7900 Advanced Micro Devices, Inc. Root Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 003: ID 05ac:1402 Apple, Inc. Ethernet Adapter [A1277]
Bus 002 Device 007: ID 25a7:fa67 Areson Technology Corp 2.4G Receiver
Bus 002 Device 008: ID 1fc9:012b NXP Semiconductors i.MX 8M Dual/8M QuadLite/8M Quad Serial Downloader
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
… I didn’t have time to try a reflash; having spent time on the install.
Problem is the installer would not do the partitioning option of using entire disk - when selected the “next” button would not become available. I had to select the manual partitioning option to to next and that was trial and error.
steve@pure:~$ neofetch
dmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmd steve@pure
dNm//////////////////////////////////mNd ----------
dNd dNd OS: PureOS 10 (Byzantium) x86_64
dNd dNd Host: HP EliteBook 745 G3
dNd dNd Kernel: 5.10.0-23-amd64
dNd dNd Uptime: 19 mins
dNd dNd Packages: 1767 (dpkg)
dNd dNd Shell: bash 5.1.4
dNd dNd Resolution: 1024x768
dNd dNd DE: GNOME 3.38.6
dNm//////////////////////////////////mNd WM: Mutter
dmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmd WM Theme: Adwaita
Theme: Adwaita [GTK2/3]
Icons: Adwaita [GTK2/3]
Terminal: gnome-terminal
CPU: AMD PRO A10-8700B R6 4C+6G (4) @ 1.800GHz
GPU: AMD ATI Radeon R5/R6/R7 Graphics
Memory: 1098MiB / 15472MiB
I will try to reflash Friday.

2 Likes

Note that the intention from the suggestion above from @Sharon, as I understand it, is that you would do a Live Boot i.e. download a Live Boot iso or disk image for a distro that does work and write it to a flash drive and just boot the flash drive. That way you don’t have to disrupt your existing setup.

There are of course trade-offs. One of the challenges with doing a Live Boot is that the disk image for the Librem 5 reflash is relatively large (≈ 4GB) and so you need to find somewhere to put it after download and before reflash. There are several solutions available to address that but I won’t pursue that as you haven’t done a Live Boot.

I’m surprised that PopOS doesn’t work given that it is based on Ubuntu and Ubuntu 22.04 LTS works fine for me to reflash and to use serial download mode generally.

1 Like

Where is that procedure documented? I have not been able to find it in this forum. It’s probably the “not what you ask, but how you ask”

1 Like

I think it is all starting to sink in. I downloaded Ubuntu 22.04 LTS and used Rufus to make bootable USB. Rufus could set up 8 GB persistent area. I was able to boot and seems like my changes including update and upgrade are being saved. The Librem5 is seen by lsusb.
Again ran out of time so I will flashing tomorrow.
I have not found any documents on this procedure.

1 Like

Because it’s not the preferred procedure. The preferred procedure is that you are using a distro and version that can follow the documented reflash procedure e.g. Ubuntu 22.04 LTS or PureOS.

However, point taken, maybe I will get to writing up some hints for the side-track procedure for getting a suitable Live Boot environment.

If you aren’t running a suitable distro and version then the alternative procedure is to side-track by having to make a bootable USB of a distro that is OK and then boot that - and then having the additional complications of doing the whole procedure from within a Live Boot environment.

For the record, I routinely make bootable USBs for Ubuntu and I just use Startup Disk Creator from within Ubuntu to do that. That by default, once booted, allows you to make non-persistent changes to the boot environment. However, as you imply, it won’t typically have enough space to hold a Librem 5 disk image.

One option is that from the Live Boot environment, you mount the normal boot disk and then use some empty temporary directory on the normal boot disk to hold the files used by the reflash, including the Librem 5 disk image.

Or, if you have enough USB ports, you could put the reflash files on a second USB flash drive.

Or, if you have oodles of RAM, you could use a RAM disk (but then of course you won’t be able to save the results of the reflash).

Or you can do what you have done i.e. use a non-default bootable USB creator program that is capable of creating a persistent area in addition to the Live Boot, providing that the USB flash drive is big enough (would probably want 16 GB minimum, which these days is very undemanding).

Note that the reflash procedure involves downloading a compressed disk image file of a little over 4 GB and then decompressing it into a bigger file that is also (by definition) over 4 GB. You would need 9 GB just for those two files. So I would suggest a minimum 16 GB flash drive and then devote all remaining space to the persistent area i.e. whatever is not used by the Live Boot image itself. A 32 GB flash drive would therefore certainly be more comfortable. A current Ubuntu full iso is over 6 GB.

1 Like

I had 2 successful flashes of the Librem5 today, but had many more unsuccessful tries. For the last good flash I did the volume up/ connect cable - the disconnect and repeat untill it stared to flash.This was on laptop with PureOS.
I dont know why it doesn’t run ok every time; maybe the phone has issues.
My next issue is: after a good flash when it wants disk encryption phrase - can I enter what I want ? Or must I use 123456 ? And later use what I want, like AAAAA1234 ?

Success
2024-11-23 14:19:47 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
65%|█████████████████████████████████████████████████████████████████████▍ | 696320/1073880 [00:00<00:00, 6950943.10it/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…
uuu (Universal Update Utility) for nxp imx chips – lib1.4.77

Success 1 Failure 0

1:1 5/ 5 [Done ] FB: Done
100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████| 1073880/1073880 [00:19<00:00, 6950943.10it/s]

Flashing complete.
2024-11-23 14:24:14 INFO Cleaning up.
steve@zb:~/librem5-flash-image$

Fail
steve@zb:~/librem5-flash-image$ ./scripts/librem5-flash-image --stable
2024-11-23 12:33:08 INFO Looking for librem5r4 luks byzantium image
2024-11-23 12:33:08 INFO Found disk image Build “stable” ‘Last stable librem5r4 build’ from Fri Jun 23 22:21:40 2023
2024-11-23 12:33:09 INFO Found uboot Build 85 from Thu Aug 25 09:22:41 2022
2024-11-23 12:33:09 INFO Downloading to ./tmp_librem5-flash-image_lyt49c52
2024-11-23 12:33:10 INFO Downloading image from https://storage.puri.sm/librem5/images/byzantium/latest/librem5r4/luks/artifact/librem5r4.img.xz
2024-11-23 12:36:08 INFO Calculating sha256sum of ./tmp_librem5-flash-image_lyt49c52/librem5r4.img
2024-11-23 12:36:20 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
19%|████████████████████▍ | 204800/1073880 [00:00<00:00, 2042591.47it/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…
uuu (Universal Update Utility) for nxp imx chips – lib1.4.77

Success 0 Failure 1

1:1 3/ 5 [Bulk(R):LIBUSB_ERROR_IO ] FB: flash -raw2sparse all librem5r4.img

2024-11-23 12:36:39 INFO Cleaning up.
Traceback (most recent call last):
File “/home/steve/librem5-flash-image/./scripts/librem5-flash-image”, line 538, in
sys.exit(main())
File “/home/steve/librem5-flash-image/./scripts/librem5-flash-image”, line 521, in main
flash_image(uuu_target, args.debug)
File “/home/steve/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_lyt49c52/flash_librem5r4.lst’]’ returned non-zero exit status 255

1 Like

It may need a photo of the screen in order to clarify precisely what it is asking you but it is my guess that it is impossible to change the slot encryption passphrase without first entering the default slot encryption passphrase that you got automatically by downloading the encrypted disk image (and you get the encrypted disk image by default). The default slot encryption passphrase is 123456. You need to change the slot encryption passphrase afterwards.

Personally what I do is use the reflash script options that allow the “download” to be performed separately from the “flash” - and then, between the former and the latter, I reencrypt (change LUKS disk encryption master key), and change the slot encryption passphrase, inside the disk image using the host computer. That way, if I ever have to reflash, the disk image is already secure. However that is just refinement as long as you do those things eventually.

2 Likes