Skip to content

Default rpiboot mass-storage payload fails on CM4 eMMC writes; explicit -d mass-storage-gadget64 works #391

Description

@Christoph1111

Describe the bug

Hardware:

  • Raspberry Pi Compute Module 4 with 16 GB eMMC
  • Raspberry Pi Compute Module 4 IO Board
  • Host: Linux Mint
  • Also reproduced on a Windows 11 PC
  • Different USB cables and USB ports tested

usbboot:

  • local build
  • build-date: 2026/08/12
  • pkg-version: local 87d6e03

Problem:
When starting rpiboot without specifying a directory:

sudo ./rpiboot -v

the CM4 eMMC appears as:

/dev/sdb
30535680 512-byte logical blocks
Write Protect is off

Reading works, but writing causes the USB mass-storage device
to disappear. For example:

sudo dd if=/dev/zero of=/dev/sdb bs=1M count=100 conv=fsync

results in USB errors such as:

device descriptor read/64, error -110
Device not responding to setup address
device not accepting address ..., error -71
USB disconnect
device offline error, dev sdb

A read test worked:

sudo dd if=/dev/sdb of=/dev/null bs=4M count=100

419430400 bytes ... 10.3 MB/s

However, explicitly using the current mass-storage-gadget64
directory fixes the problem:

sudo ./rpiboot -d ./mass-storage-gadget64 -v

With this payload:

sudo dd if=/dev/zero of=/dev/sdb bs=4096 count=1 oflag=direct

works.

A larger test also succeeds:

sudo dd if=/dev/zero of=/dev/sdb bs=1M count=1024 oflag=direct

1073741824 bytes ... 24.9 MB/s

The RPi Imager then also works normally.

The explicit payload contains:

mass-storage-gadget64/boot.img
mass-storage-gadget64/config.txt
mass-storage-gadget64/bootfiles.bin

The config contains:

boot_ramdisk=1
uart_2ndstage=1

It looks like the default/embedded mass-storage-gadget payload
may differ from the current mass-storage-gadget64 payload, and
the former has a write-path problem on CM4 eMMC.

Steps to reproduce the behaviour

./rpiboot
→ eMMC reads OK
→ eMMC writes cause USB disconnect

./rpiboot -d ./mass-storage-gadget64
→ eMMC reads OK
→ eMMC writes work normally (~25 MB/s)

Device(s)

Raspberry Pi CM4

Compute Module IO board.

  • Raspberry Pi Compute Module 4 with 16 GB eMMC
  • Raspberry Pi Compute Module 4 IO Board

RPIBOOT logs

No response

Kernel logs

No response

Device UART logs

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions