burtyb
Posts: 30
Joined: Sat Mar 05, 2016 4:19 pm

Timeout booting Linux on CM3+ with rpiboot

Tue May 14, 2019 11:51 am

I've made a minimal carrier board which has only has - USB, UART0/1, GPIO28/29/44/45 are pulled to ground via 100k, std schematic/parts for emmc en/dis and have jumpers for USBBOOT and OTGID (floating).

USBBOOT works OK when in MSD mode with rpiboot on Linux and also flashes without issue using Etcher on Win10.

Booting Linux with the CMIO board works without issue but when I use my carrier with standard rpiboot (20180627~140218 from Raspbian or from github) the boot process doesn't complete and gets stuck.

Code: Select all

sudo /home/pi/usbboot/rpiboot -m 2000 -d /var/lib/clusterhat/boot/ -o -l -v|ts # rpiboot from github
May 14 12:22:58 Waiting for BCM2835/6/7
May 14 12:23:05 Device located successfully
May 14 12:23:06 Initialised device correctly
May 14 12:23:06 Found serial number 0
May 14 12:23:06 Sending bootcode.bin
May 14 12:23:06 libusb_bulk_transfer sent 24 bytes; returned 0
May 14 12:23:06 Writing 52296 bytes
May 14 12:23:07 libusb_bulk_transfer sent 52296 bytes; returned 0
May 14 12:23:08 Successful read 4 bytes
May 14 12:23:09 Waiting for BCM2835/6/7
May 14 12:23:09 Device located successfully
May 14 12:23:10 Failed to open the requested device
May 14 12:23:10 Device located successfully
May 14 12:23:11 Initialised device correctly
May 14 12:23:11 Found serial number 1
May 14 12:23:11 Second stage boot server
May 14 12:23:11 Received message GetFileSize: autoboot.txt
May 14 12:23:11 libusb_bulk_transfer sent 0 bytes; returned 0
May 14 12:23:11 Cannot open file autoboot.txt
May 14 12:23:11 Received message GetFileSize: config.txt
May 14 12:23:11 File size = 1810 bytes
May 14 12:23:11 Received message ReadFile: config.txt
May 14 12:23:11 File read: config.txt
May 14 12:23:11 libusb_bulk_transfer sent 1810 bytes; returned 0
May 14 12:23:11 Received message GetFileSize: recovery.elf
May 14 12:23:11 libusb_bulk_transfer sent 0 bytes; returned 0
May 14 12:23:11 Cannot open file recovery.elf
May 14 12:23:11 Received message GetFileSize: start.elf
May 14 12:23:11 File size = 2873444 bytes
May 14 12:23:11 Received message ReadFile: start.elf
May 14 12:23:11 File read: start.elf
May 14 12:23:16 libusb_bulk_transfer sent 2873444 bytes; returned 0
May 14 12:23:16 Received message GetFileSize: fixup.dat
May 14 12:23:16 File size = 6701 bytes
May 14 12:23:16 Received message ReadFile: fixup.dat
May 14 12:23:16 File read: fixup.dat
May 14 12:23:16 libusb_bulk_transfer sent 6701 bytes; returned 0
May 14 12:23:16 Received message GetFileSize: recovery.elf
May 14 12:23:16 libusb_bulk_transfer sent 0 bytes; returned 0
May 14 12:23:16 Cannot open file recovery.elf
May 14 12:23:16 Received message GetFileSize: config.txt
May 14 12:23:16 File size = 1810 bytes
May 14 12:23:16 Received message ReadFile: config.txt
May 14 12:23:16 File read: config.txt
May 14 12:23:16 libusb_bulk_transfer sent 1810 bytes; returned 0
May 14 12:23:16 Received message GetFileSize: dt-blob.bin
May 14 12:23:16 libusb_bulk_transfer sent 0 bytes; returned 0
May 14 12:23:16 Cannot open file dt-blob.bin
May 14 12:23:20 Received message GetFileSize: recovery.elf
May 14 12:23:20 libusb_bulk_transfer sent 0 bytes; returned 0
May 14 12:23:20 Cannot open file recovery.elf
And that's as far as it gets.

Looking at what it's doing when it gets stuck I can see in ep_write the call to libusb_control_transfer returns -7 (LIBUSB_ERROR_TIMEOUT) over and over.

Increasing the delay from 2000 to 10000 for the libusb_control_transfer call (in function ep_write) it boots without issue.

Code: Select all

sudo /home/pi/usbboot/rpiboot -m 2000 -d /var/lib/clusterhat/boot/ -o -l -v|ts # rpiboot from github with modified timeout
May 14 12:24:32 Waiting for BCM2835/6/7
May 14 12:24:40 Device located successfully
May 14 12:24:41 Initialised device correctly
May 14 12:24:41 Found serial number 0
May 14 12:24:41 Sending bootcode.bin
May 14 12:24:41 libusb_bulk_transfer sent 24 bytes; returned 0
May 14 12:24:41 Writing 52296 bytes
May 14 12:24:41 libusb_bulk_transfer sent 52296 bytes; returned 0
May 14 12:24:42 Successful read 4 bytes
May 14 12:24:43 Waiting for BCM2835/6/7
May 14 12:24:43 Device located successfully
May 14 12:24:44 Failed to open the requested device
May 14 12:24:44 Device located successfully
May 14 12:24:45 Initialised device correctly
May 14 12:24:45 Found serial number 1
May 14 12:24:45 Second stage boot server
May 14 12:24:45 Received message GetFileSize: autoboot.txt
May 14 12:24:45 libusb_bulk_transfer sent 0 bytes; returned 0
May 14 12:24:45 Cannot open file autoboot.txt
May 14 12:24:45 Received message GetFileSize: config.txt
May 14 12:24:45 File size = 1810 bytes
May 14 12:24:45 Received message ReadFile: config.txt
May 14 12:24:45 File read: config.txt
May 14 12:24:45 libusb_bulk_transfer sent 1810 bytes; returned 0
May 14 12:24:45 Received message GetFileSize: recovery.elf
May 14 12:24:45 libusb_bulk_transfer sent 0 bytes; returned 0
May 14 12:24:45 Cannot open file recovery.elf
May 14 12:24:45 Received message GetFileSize: start.elf
May 14 12:24:45 File size = 2873444 bytes
May 14 12:24:45 Received message ReadFile: start.elf
May 14 12:24:45 File read: start.elf
May 14 12:24:50 libusb_bulk_transfer sent 2873444 bytes; returned 0
May 14 12:24:50 Received message GetFileSize: fixup.dat
May 14 12:24:50 File size = 6701 bytes
May 14 12:24:50 Received message ReadFile: fixup.dat
May 14 12:24:50 File read: fixup.dat
May 14 12:24:50 libusb_bulk_transfer sent 6701 bytes; returned 0
May 14 12:24:51 Received message GetFileSize: recovery.elf
May 14 12:24:51 libusb_bulk_transfer sent 0 bytes; returned 0
May 14 12:24:51 Cannot open file recovery.elf
May 14 12:24:51 Received message GetFileSize: config.txt
May 14 12:24:51 File size = 1810 bytes
May 14 12:24:51 Received message ReadFile: config.txt
May 14 12:24:51 File read: config.txt
May 14 12:24:51 libusb_bulk_transfer sent 1810 bytes; returned 0
May 14 12:24:51 Received message GetFileSize: dt-blob.bin
May 14 12:24:51 libusb_bulk_transfer sent 0 bytes; returned 0
May 14 12:24:51 Cannot open file dt-blob.bin
May 14 12:24:54 Received message GetFileSize: recovery.elf
May 14 12:24:54 libusb_bulk_transfer sent 0 bytes; returned 0
May 14 12:24:54 Cannot open file recovery.elf
May 14 12:24:54 Received message GetFileSize: config.txt
May 14 12:24:54 File size = 1810 bytes
May 14 12:24:54 Received message ReadFile: config.txt
May 14 12:24:54 File read: config.txt
May 14 12:24:54 libusb_bulk_transfer sent 1810 bytes; returned 0
May 14 12:25:02 Received message GetFileSize: bootcfg.txt
May 14 12:25:02 libusb_bulk_transfer sent 0 bytes; returned 0
May 14 12:25:02 Cannot open file bootcfg.txt
May 14 12:25:02 Received message GetFileSize: cmdline.txt
May 14 12:25:02 File size = 334 bytes
May 14 12:25:02 Received message ReadFile: cmdline.txt
May 14 12:25:02 File read: cmdline.txt
May 14 12:25:02 libusb_bulk_transfer sent 334 bytes; returned 0
May 14 12:25:02 Received message GetFileSize: recovery8.img
May 14 12:25:02 libusb_bulk_transfer sent 0 bytes; returned 0
May 14 12:25:02 Cannot open file recovery8.img
May 14 12:25:02 Received message GetFileSize: recovery8-32.img
May 14 12:25:02 libusb_bulk_transfer sent 0 bytes; returned 0
May 14 12:25:02 Cannot open file recovery8-32.img
May 14 12:25:02 Received message GetFileSize: recovery7.img
May 14 12:25:02 libusb_bulk_transfer sent 0 bytes; returned 0
May 14 12:25:02 Cannot open file recovery7.img
May 14 12:25:02 Received message GetFileSize: recovery.img
May 14 12:25:02 libusb_bulk_transfer sent 0 bytes; returned 0
May 14 12:25:02 Cannot open file recovery.img
May 14 12:25:02 Received message GetFileSize: kernel8.img
May 14 12:25:02 libusb_bulk_transfer sent 0 bytes; returned 0
May 14 12:25:02 Cannot open file kernel8.img
May 14 12:25:02 Received message GetFileSize: kernel8-32.img
May 14 12:25:02 libusb_bulk_transfer sent 0 bytes; returned 0
May 14 12:25:02 Cannot open file kernel8-32.img
May 14 12:25:02 Received message GetFileSize: kernel7.img
May 14 12:25:02 File size = 4944992 bytes
May 14 12:25:02 Received message GetFileSize: armstub8.bin
May 14 12:25:02 libusb_bulk_transfer sent 0 bytes; returned 0
May 14 12:25:02 Cannot open file armstub8.bin
May 14 12:25:02 Received message GetFileSize: armstub8-32.bin
May 14 12:25:02 libusb_bulk_transfer sent 0 bytes; returned 0
May 14 12:25:02 Cannot open file armstub8-32.bin
May 14 12:25:02 Received message GetFileSize: armstub7.bin
May 14 12:25:02 libusb_bulk_transfer sent 0 bytes; returned 0
May 14 12:25:02 Cannot open file armstub7.bin
May 14 12:25:02 Received message GetFileSize: armstub.bin
May 14 12:25:02 libusb_bulk_transfer sent 0 bytes; returned 0
May 14 12:25:02 Cannot open file armstub.bin
May 14 12:25:02 Received message GetFileSize: kernel7.img
May 14 12:25:02 File size = 4944992 bytes
May 14 12:25:02 Received message ReadFile: kernel7.img
May 14 12:25:02 File read: kernel7.img
May 14 12:25:11 libusb_bulk_transfer sent 4944992 bytes; returned 0
May 14 12:25:11 Received message GetFileSize: initramfs7.img
May 14 12:25:11 File size = 6191397 bytes
May 14 12:25:11 Received message ReadFile: initramfs7.img
May 14 12:25:11 File read: initramfs7.img
May 14 12:25:24 libusb_bulk_transfer sent 6191397 bytes; returned 0
May 14 12:25:24 Received message GetFileSize: bcm2710-rpi-cm3.dtb
May 14 12:25:24 File size = 24087 bytes
May 14 12:25:24 Received message ReadFile: bcm2710-rpi-cm3.dtb
May 14 12:25:24 File read: bcm2710-rpi-cm3.dtb
May 14 12:25:25 libusb_bulk_transfer sent 24087 bytes; returned 0
May 14 12:25:25 Received message GetFileSize: config.txt
May 14 12:25:25 File size = 1810 bytes
May 14 12:25:25 Received message ReadFile: config.txt
May 14 12:25:25 File read: config.txt
May 14 12:25:25 libusb_bulk_transfer sent 1810 bytes; returned 0
May 14 12:25:25 Received message GetFileSize: overlays/dwc2.dtbo
May 14 12:25:25 File size = 856 bytes
May 14 12:25:25 Received message ReadFile: overlays/dwc2.dtbo
May 14 12:25:25 File read: overlays/dwc2.dtbo
May 14 12:25:25 libusb_bulk_transfer sent 856 bytes; returned 0
May 14 12:25:26 Received message Done: overlays/dwc2.dtbo
May 14 12:25:26 Second stage boot server done
May 14 12:25:27 Waiting for BCM2835/6/7
May 14 12:25:27 Device located successfully
May 14 12:25:28 Initialised device correctly
May 14 12:25:28 Found serial number 1
May 14 12:25:28 Second stage boot server
May 14 12:25:42 Second stage boot server done
May 14 12:25:43 Waiting for BCM2835/6/7
I'm wondering if there might be something it's looking for (other pull up/down maybe?) that I haven't got - anyone have any pointers?

burtyb
Posts: 30
Joined: Sat Mar 05, 2016 4:19 pm

Re: Timeout booting Linux on CM3+ with rpiboot

Fri May 17, 2019 2:31 pm

I spotted https://www.raspberrypi.org/forums/view ... p?t=189385 which seems to be the problem but instead of a slow boot (with eMMC) it doesn't boot at all with rpiboot due to the timeout.

Either adding "hdmi_ignore_hotplug=1" to config.txt or adding pull up resistors on the "If unused leave open" HDMI I2C pins (HDMI_SCL and HDMI_SDA) it's now boots with an unmodified rpiboot :D.

Return to “Compute Module”