-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
USB device boot not working on RPi4 #1184
Comments
In what way does it 'not work' what's the response from rpiboot? |
Let me copy the relevant output here:
So, all looks good, I received a zero status code, but the board appears to be hanging - no output whatsoever. Here's the patch I applied to the usbboot utility:
|
As an aside, I have discovered where the 55 comes from. When the Linux kernel first asks for a configuration descriptor, the BCM2711 boot ROM program responds with wTotalLength = 55. But this first request allocates only the minimum 9-byte buffer to find out how big the configuration descriptor actually is. The kernel immediately allocates a buffer for 55 bytes of data and sends a new request, but this time the boot ROM sets the wTotalLength field to 32 and also sends only 32 bytes. Looking at the difference, 55 - 32 = 23, i.e. just enough for one more interface (9 bytes) with 2 endpoints (2 × 7 = 14 bytes). There is a comment in Anyway, this is unrelated to the question of what exactly should be sent to the USB boot endpoint and/or how to debug failures. It must be a silly mistake I'm doing here, but without any feedback from the board, it's extremely difficult to debug… Oh, that reminds me: Would it be possible to debug the VPU using JTAG? |
Not without a licence from Broadcom (at least), so no. |
Yeah, USB mass storage (as a device) was enableable but now removed (it wasn't actually very useful in the end). We're not going to be looking at USB boot for a while, we're first working on the network and MSD boot modes. But it does work (I've tested it when 2711 first came back). Have you tried sending the recovery.bin file, rather than hand hacking the EEPROM? |
Yes, that was the first thing to try. I copied
No other indication of success, nothing on the serial port, although I set BOOT_UART=1 in As to the use case, this would be a great method of unbricking one's RPi4 if something goes wrong with the EEPROM… Of course, you can always flash the chip with an external programmer while 2711 is not running, but that's a lot more involved. Especially since the chip is located very close to the audio jack, so it's quite hard to put a clip on it without desoldering the connector first. 😏 |
The ROM will always load recovery.bin from the sd-card in preference to the EEPROM so it's not possible to brick a Pi with a corrupted EEPROM. USB device boot is not yet supported by pieeprom.bin, so whilst it might be possible to run the code it won't be able to load files from start.elf. Other stuff might fail because other than validating that the ROM can load and run code it's essentially untested. We do plan to add proper support for USB device boot but AFAIK it's unlikely to get any attention until after other bootmodes are implemented. |
Thank you for all your answers. Much appreciated. I believe this issue can be closed for the time being. |
For the record, I have just re-run USB boot now, and it works (EEPROM content was recovered). I'm not sure what went wrong before, but I'm no longer able to reproduce the failure. With that, I'm going to update |
I’ve encountered much of what you have here, just haven’t documented not nearly, but besides trying to boot straight from the usb, Ive ordered a PoE hat, and intend to upgrade the kernel to 5.0 ubuntu’s 18.04 flavor. So stay tuned |
USB device mode boot does not seem to work for me. I connected my laptop to my RPi4 with a straight Type-C cable and I can see the USB device:
The warning seems to be a red herring; I am not sure where this expected size of 55 comes from, as you can see that wTotalLength is actually 32:
At this point, I modified
usbboot
to recognize the new product id (0x2711), but whatever I try I am unable to move forward. I have extracted the original firmware blob from my EEPROM (usingflashrom
), removed the 8-byte header and truncated it to just 44852 bytes, so this should be now exactly the same code that would be loaded over SPI, but still no luck.The text was updated successfully, but these errors were encountered: