-
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 boot does not work on every RPI3 #898
Comments
Does it work reliably if you boot from an sdcard containing just bootcode.bin? This should still boot from the USB drive, but uses the bootcode in bootcode.bin which has a couple of bugs fixed in it. Gordon |
I'm seeing pretty much the exact same issues. 2 x RPI3 (Both are KCE MC1 1610) Initially, I was experimenting with PXE booting. First Pi worked exactly as expected, netbooting etc. The second Pi does not. Without an SD card the network never establishes a link and so doesn't do a DHCPDISCOVER. With an SD card containing Inspired by this issue I tested with booting from USB media. The first Pi boots a Raspbian Stretch image okay. The second does not, including when using an SD card with I'm doing all of this headless, so I don't know what is present on the framebuffer. If it will help, I can see if there is anything on the serial console. |
Same issue. Please advise. Tried about everything at this point. Boot w/o SD card gets me just the red led. Booting with SD card with bootcode.bin and timeout file gets me four green flashes. Trying to boot from a 32GB Transcend SSD in a usb 2.0 case, which I have tried imaging in both Linux and Windows so pretty sure this is not the issue. Drive shows up just fine if I boot up from an SD card image. |
Can you try the attached bootcode.bin on it's own, create an empty file called 'UART' alongside it. Then connect serial to the standard pins (GPIO 14, 15 on pins 8 and 10) serial 115200-8-n-1 Then power it up and report with the log output? This will give useful output for both USB MSD boot and network boot Thanks Gordon See the Wiki for more information on this debug... |
Thanks for helping with this. The UART output when booting with this
The second
I hope this provides some useful pointers. Of course, I'm more than happy to help in any way that I can. |
It looks like you need a little more debug output. Also can you run tcpdump on it as well...
That should do it, it'll capture all broadcast packets as well and any either sourced or destined for the Raspberry Pi. |
Log files attached below. I think it should be pointed out that this process only attempts to netboot once in every three or so attempts. Most other times, the network link doesn't come up and the following can be seen on the UART output:
Even more occasionally, it is as seen above in my previous comment. For completeness, the
|
There's a 5 second delay waiting for the link to come up... Are you seeing it sitting at 'Wait for Link up' for five seconds? Just wondering if this is a problem with timing setup... Gordon |
Try again with this, added some debug output while sending TFTP_RRQ and ACK Note, this contains a lot of debug, since it will output debug for every TFTP packet, I'm guessing this will slow things down significantly but should give us an idea of why it's going wrong |
Yep, seeing the 5 second delay. Attached is the UART output. At the moment, I'm testing this on a live network with separate DHCP, TFTP and NFS servers. This worked okay for me with the first Pi I setup. I'll allocate some time to setup up an isolated network with DHCP, TFTP and NFS all on the same server. This will make capturing traces much easier. Ideally, I'd like this to be ISC DHCP and atftpd as that's what I'm using for my current PXE environment. If you think it beneficial, I can build a dnsmasq environment as described in the tutorials. |
It would be useful if you could tcpdump the packets as well as get the UART output, because this should show me what happens on that last packet... Gordon |
I hope I am not waking up a dead thread or hijacking. I have a similar problem but trying to boot from a USB WD PiDrive 1TB. I have made use of the debug bootcode.bin & UART to obtain output suggesting to me that the disk isn't spinning up quickly enough, see enclose UART log. |
Don't know about spinning up quickly enough, but it's not a problem with the disk not attaching in time (this is what the standard timeout is for). It looks like it's failing to reply to the TEST_UNIT_READY command, not sure why this would be... Can you plug it into a PC and see it it subsequently works? I wonder whether the drive behaves slightly differently in some cases (i.e. it is doing some housekeeping that it needs to finish before starting up...) Gordon |
Many thanks for getting back to me so soon Gordon. As is often the case my further throughts have pointed the finger of blame towards me. I used this to build my HD and now realise that it doesn't create the FAT32 as partition 1 on the HD. Since a boot directory was copied to sda1 I presumed that it would accessed by bootcode.bin from the SDCard. I will rebuild with what I suspect is the correct two partition layout for the HD. |
Pity, no change in the UART output after the change. Device Boot Start End Sectors Size Id Type |
Now that the FAT32 is added as partition 1 the drive connects fine to my Mac. It seem to be quite sluggish before it is actually mounted on the Mac. |
I've added a little debug to this bootcode.bin, can you put it onto the MSD to get the UART debug out? |
Here is the latest UART output. |
I tried bouncing the power to the RasPi while keeping the disk powered and it boots: |
This just has the timeout increased to 20 seconds! Lets see what happens! Gordon |
Yo! we have action: |
Just as a matter of interest, which power supply do you have for the PiDrive? The original supply was rated at 2A, but WD introduced a 2.5A supply intended for use with the Pi 3. |
My PSU claims to be 3A, branded Ktec. It came along with the 1TB disk. |
I assume that this isn't going to help with booting directly from the hard drive though, since we cannot change the bootrom (that's fixed in the silicon), so it does mean you're going to have to have an SD card plugged in to get it to boot! Will commit this change to bootcode.bin so you can at least do that.... |
Thanks for your help Gordon. I had already decided not to set the OTP bit for USB boot as I would like to retain the flexibility. Loading bootcode.bin from an easy to replicate SD card and then bringing in the HD is fine for me and applicable across the whole RasPi family I am expecting. |
@ghollingworth I wonder if something could also be done about the bootcode.bin apparently locking into an apparent ethernet boot loop if the USB drive doesn't respond? |
Um... Not sure what you'd want to do in this situation? If the USB drive doesn't respond or no suitable firmware is found on the device, what would you like it to do? Gordon |
I would hope it could restart from the beginning again checking all its options once more. |
Perhaps also power the USB ports down and then up again? |
Some sort of signaling by LED (must) and maybe (nice) on video output or audio output? |
@ghollingworth I saw your post on #838 and recent fixes to SDcard handling. Is there a version of bootcode.bin that includes the SDcard fixes and the 20 seconds timeout that you supplied on 5th March? |
I've created an internal pull request to change this timeout to 20 seconds... Should appear in the latest firmware (available through rpi-update) over the next couple of days. |
Is there a link to the pull for this update? |
It'll be in the next release... |
kernel: Revert Revert net: pskb_trim_rcsum() and CHECKSUM_COMPLETE are friends See: raspberrypi/linux#2659 kernel: config: Add CONFIG_USBIP_VUDC See: #353 kernel: mmc/bcm2835-sdhost: Recover from MMC_SEND_EXT_CSD See: raspberrypi/linux#2728 kernel: overlays: pi3-disable-bt: Clear out bt_pins node kernel: Revert rtc: pcf8523: properly handle oscillator stop bit See: #1065 bootcode: Extend TEST_UNIT_READY timeout to 20 seconds, some hard drives take a really long time See: #898 firmware: video_render: Treat an empty buffer with ENDOFFRAME set as a flush firmware: dispmanx: Add option to ignore all layers lower than the current layer
kernel: Revert Revert net: pskb_trim_rcsum() and CHECKSUM_COMPLETE are friends See: raspberrypi/linux#2659 kernel: config: Add CONFIG_USBIP_VUDC See: raspberrypi/firmware#353 kernel: mmc/bcm2835-sdhost: Recover from MMC_SEND_EXT_CSD See: raspberrypi/linux#2728 kernel: overlays: pi3-disable-bt: Clear out bt_pins node kernel: Revert rtc: pcf8523: properly handle oscillator stop bit See: raspberrypi/firmware#1065 bootcode: Extend TEST_UNIT_READY timeout to 20 seconds, some hard drives take a really long time See: raspberrypi/firmware#898 firmware: video_render: Treat an empty buffer with ENDOFFRAME set as a flush firmware: dispmanx: Add option to ignore all layers lower than the current layer
Latest rpi-update firmware contains this fix. |
Loaded now, many thanks. |
I wonder if this bootcode.bin could be network loaded and the remainder of the boot continue from a connected HDD. |
If the bootcode.bin is retrieved from the network then it'll require the rest of the firmware files to be located there (start.elf, fixup.dat, kernel7.img, config.txt etc.) but you can then put a suitable cmdline.txt to use the USB MSD for the ext4 filesystem. Of course the ethernet booting has its own set of issues (much as anything)! Gordon |
I believe this can now be closed? |
I've got two RPI3 v1.2 boards here. Made an SD card to set the OTP bit on both devices and also verified that is was set. On one board the RPI boots correctly and runs good as far as I've tested today. On the other RPI, with exactly the same USB drive(just moved it over to the other device, not changing anything) it does not boot correctly.
Half of the times the display stays black, other half of the time I get the squared colored test image. Even though i disabled this image and it does not show on the other RPI. Also the image is the only thing I see, no network connection, no commandline, just the image.
Both PCB's are the same, Model B V1.2. There is only a small difference in some numbers on the board. The one that is working has the QR code on the bottom is 24/06 and the code KCE MC1 1618 94V-OF1 I5. The one that is not working has the QR code on the bottom is 23/03 and the code KCE MC1 1608 94V-OF1 E4.
The text was updated successfully, but these errors were encountered: