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

Đang mở
#391 4 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
raspberry-pi, shell
Lĩnh vực
embedded-iot, tooling

Hướng nghiên cứu

Start with the default payload used by ./rpiboot -v and compare it with mass-storage-gadget64/boot.img, config.txt, and bootfiles.bin, especially the listed boot_ramdisk=1 and uart_2ndstage=1 settings. Reproduce the CM4 eMMC write test, then verify that the default payload behaves like the explicit mass-storage-gadget64 payload without causing the USB device to disconnect.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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 87d6e032

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

Ngôn ngữ chính
C
Star
1.4k
Fork
318
Merge trung bình
15 giờ 55 phút
Pull request đã merge (30 ngày)
6

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của raspberrypi/usbboot

Tất cả issue của raspberrypi/usbboot

Issue tương tự

Thêm issue về C

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.