Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8026

Troubleshooting • Nth usage of rpi-imager failing when used with rpiboot

$
0
0
Howdy. I'm using the https://github.com/raspberrypi/usbboot project to mount a RPI CM5 module, and then the rpi-imager to flash the OS image. The first time around, all is well. However, when I come to flash the next CM5 module, or even the same one again, and having recycled the power/usb connectivity first, the rpi-imager returns almost straight away.

I have noticed a similar problem if I'm using dd command instead of rpi-imager. This leads me to suspect that it is something to do with my Debian Linux installation.

Indeed, if I reboot my Linux machine then the first flashing works fine again. The problem is quite reproducible.

Here's what a successful run looks like:

Code:

$ sudo ./rpiboot -d mass-storage-gadget64RPIBOOT: build-date 2026/02/15 pkg-version local 101f2d00Please fit the EMMC_DISABLE / nRPIBOOT jumper before connecting the power and USB cables to the target device.If the device fails to connect then please see https://rpltd.co/rpiboot for debugging tips.Loading: mass-storage-gadget64/bootfiles.binUsing mass-storage-gadget64/bootfiles.binWaiting for BCM2835/6/7/2711/2712...Sending bootcode.binSuccessful read 4 bytes Waiting for BCM2835/6/7/2711/2712...Second stage boot serverFile read: mcb.binFile read: memsys00.binFile read: memsys01.binFile read: rp1c0fw1.binFile read: memsys02.binFile read: rp1c0fw2.binFile read: memsys03.binFile read: bootmainLoading: mass-storage-gadget64/config.txtFile read: config.txtLoading: mass-storage-gadget64/boot.imgFile read: boot.imgSecond stage boot server donesudo rpi-imager --cli --sha256 <some-sha> <some-img> /dev/sda --enable-writing-system-drives --debugWARNING: writing to system drives is enabled.Available disk space for caching: 0 GBError opening cache file for writing. Disabling caching.BLKDISCARD not supported                  Zeroing out first and last MB of driveDone zeroing out start and end of drive. Took 0 secondsHash of uncompressed image: "<some-sha>"Write done in 12 seconds-------> ] 99 %Verify hash: "<some-sha>"Verify done in 7.259 secondsWriting first block (which we skipped at first)Write successful.                         
Note the time taken for writing and then for verifying - 12 seconds and 7 seconds respectively.

If I then unplug the usb cable, which is also providing power to the device, and then plug it back in, I repeat the steps:

Code:

$ sudo ./rpiboot -d mass-storage-gadget64RPIBOOT: build-date 2026/02/15 pkg-version local 101f2d00Please fit the EMMC_DISABLE / nRPIBOOT jumper before connecting the power and USB cables to the target device.If the device fails to connect then please see https://rpltd.co/rpiboot for debugging tips.Loading: mass-storage-gadget64/bootfiles.binUsing mass-storage-gadget64/bootfiles.binWaiting for BCM2835/6/7/2711/2712...Sending bootcode.binSuccessful read 4 bytes Waiting for BCM2835/6/7/2711/2712...Second stage boot serverFile read: mcb.binFile read: memsys00.binFile read: memsys01.binFile read: rp1c0fw1.binFile read: memsys02.binFile read: rp1c0fw2.binFile read: memsys03.binFile read: bootmainLoading: mass-storage-gadget64/config.txtFile read: config.txtLoading: mass-storage-gadget64/boot.imgFile read: boot.imgSecond stage boot server done$ sudo rpi-imager --cli --sha256 <some-sha> <some-img> /dev/sda --enable-writing-system-drives --debugWARNING: writing to system drives is enabled.Available disk space for caching: 0 GBError opening cache file for writing. Disabling caching.BLKDISCARD not supported                  Zeroing out first and last MB of driveDone zeroing out start and end of drive. Took 0 secondsHash of uncompressed image: "<some-sha>"Write done in 0 secondsVerify hash: "<some-sha>"Verify done in 0.169 secondsWriting first block (which we skipped at first)Write successful.                         
The write time is now 0 seconds and verification takes 0.169 seconds!!!

That seemed suspicous to me. So I then tried another new CM5 and got an error:

Code:

$ sudo ./rpiboot -d mass-storage-gadget64RPIBOOT: build-date 2026/02/15 pkg-version local 101f2d00Please fit the EMMC_DISABLE / nRPIBOOT jumper before connecting the power and USB cables to the target device.If the device fails to connect then please see https://rpltd.co/rpiboot for debugging tips.Loading: mass-storage-gadget64/bootfiles.binUsing mass-storage-gadget64/bootfiles.binWaiting for BCM2835/6/7/2711/2712...Sending bootcode.binSuccessful read 4 bytes Waiting for BCM2835/6/7/2711/2712...Second stage boot serverFile read: mcb.binFile read: memsys00.binFile read: memsys01.binFile read: rp1c0fw1.binFile read: memsys02.binFile read: rp1c0fw2.binFile read: memsys03.binFile read: bootmainLoading: mass-storage-gadget64/config.txtFile read: config.txtLoading: mass-storage-gadget64/boot.imgFile read: boot.imgSecond stage boot server done$sudo rpi-imager --cli --sha256 <some-sha> <some-img> /dev/sda --enable-writing-system-drives --debugWARNING: writing to system drives is enabled.Available disk space for caching: 0 GBError opening cache file for writing. Disabling caching.BLKDISCARD not supported                  Zeroing out first and last MB of driveError: Write error while trying to zero out last part of card.<br>Card could be advertising wrong capacity (possible counterfeit).
At this stage, I'm sure that rebooting the machine will then see rpi-imager succeed.

Obviously something wrong with my Linux setup. Any ideas? Thanks.

Statistics: Posted by huntc — Sun Feb 15, 2026 3:36 am



Viewing all articles
Browse latest Browse all 8026

Trending Articles