timg236
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 252
Joined: Thu Jun 21, 2018 4:30 pm

Raspberry Pi4 bootloader - network boot support - BETA

Mon Sep 23, 2019 1:31 pm

A beta version of the Raspberry Pi4 bootloader with network boot support is now available via the rpi-eeprom package.

The setup process is pretty much identical to network boot on Pi3 except that the boot mode is now an EEPROM parameter rather than an OTP bit.

Full details for configuration and setup
https://github.com/raspberrypi/rpi-eepr ... ot_beta.md

The start4.elf firmware on the TFTP server must be updated to be the latest rpi-update version in order to include the new network driver. You can either use rpi-update and copy the files from the sd-card or alternatively, download the firmware files from the rpi-update repo https://github.com/Hexxeh/rpi-firmware

dickon
Posts: 561
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: Raspberry Pi4 bootloader - network boot support - BETA

Mon Sep 23, 2019 2:24 pm

Thankyou very much for that.

After some faffing trying to find the right rpi-eeprom* packages, it worked a treat. One minor error: the firmware path is /lib/firmware/raspberrypi/bootloader/beta/pieeprom-2019-09-23.bin (ie there's an extra 'bootloader/' component in it).

timg236
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 252
Joined: Thu Jun 21, 2018 4:30 pm

Re: Raspberry Pi4 bootloader - network boot support - BETA

Mon Sep 23, 2019 2:27 pm

dickon wrote:
Mon Sep 23, 2019 2:24 pm
Thankyou very much for that.

After some faffing trying to find the right rpi-eeprom* packages, it worked a treat. One minor error: the firmware path is /lib/firmware/raspberrypi/bootloader/beta/pieeprom-2019-09-23.bin (ie there's an extra 'bootloader/' component in it).
Great, thanks for the test. I've fixed the path in .md file

Kendek
Posts: 128
Joined: Thu Jul 25, 2019 4:39 pm
Location: Kaposvár, Hungary

Re: Raspberry Pi4 bootloader - network boot support - BETA

Mon Sep 23, 2019 2:41 pm

I tried first with LibreELEC on the microSD card, with the following configuration:

Code: Select all

[all]
BOOT_UART=0
WAKE_ON_GPIO=0
POWER_OFF_ON_HALT=1
DHCP_TIMEOUT=45000
DHCP_REQ_TIMEOUT=4000
TFTP_FILE_TIMEOUT=15000
TFTP_IP=
BOOT_ORDER=0x1
SD_BOOT_MAX_RETRIES=3
NET_BOOT_MAX_RETRIES=5
[none]
FREEZE_VERSION=0
After the update and auto reboot, the Pi doesn't started, only red LED and some green flash. Then I updated the start.elf binary, downloaded from here, but nothing changed. After that I downloaded the missing start4.elf file too, and with a noticable delay the LibreELEC is started, but I get only black screen. The HDMI signal is detected, and I can SSH into it, but nothing can be seen on the TV.

timg236
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 252
Joined: Thu Jun 21, 2018 4:30 pm

Re: Raspberry Pi4 bootloader - network boot support - BETA

Mon Sep 23, 2019 3:56 pm

Kendek wrote:
Mon Sep 23, 2019 2:41 pm
I tried first with LibreELEC on the microSD card, with the following configuration:

Code: Select all

[all]
BOOT_UART=0
WAKE_ON_GPIO=0
POWER_OFF_ON_HALT=1
DHCP_TIMEOUT=45000
DHCP_REQ_TIMEOUT=4000
TFTP_FILE_TIMEOUT=15000
TFTP_IP=
BOOT_ORDER=0x1
SD_BOOT_MAX_RETRIES=3
NET_BOOT_MAX_RETRIES=5
[none]
FREEZE_VERSION=0
After the update and auto reboot, the Pi doesn't started, only red LED and some green flash. Then I updated the start.elf binary, downloaded from here, but nothing changed. After that I downloaded the missing start4.elf file too, and with a noticable delay the LibreELEC is started, but I get only black screen. The HDMI signal is detected, and I can SSH into it, but nothing can be seen on the TV.
Did you also update fixup4.dat (I've updated the docs to explicitly state that this is required) ? My best guess is that Linux is booting but doesn't have enough CMA memory because start4.elf has wrong/missing fixup information.

dickon
Posts: 561
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: Raspberry Pi4 bootloader - network boot support - BETA

Mon Sep 23, 2019 4:07 pm

timg236 wrote:
Mon Sep 23, 2019 2:27 pm
[Great, thanks for the test. I've fixed the path in .md file
Not so much a test, TBH. I've been waiting for this since I first got my grubby little mitts on one -- I netboot virtually everything else around here, and it was slightly irksome that I couldn't quite do that with the 4. The bootcode.bin-only sd card hack for older Pis has been very, very useful to me since you introduced it, as that's allowed /boot to be controlled centrally and versioned correctly like everything else; I was a little surprised by the omission on the 4. I haven't complained, because you made it perfectly clear that this feature would be coming soon -- I don't think three months is at all unreasonable -- and I can live with an SD card /boot for the time being.

Now, though? I've removed the SD card from the Pi 4 and I doubt I'll boot from one again...

I can swap between the 32b Raspbian and the 64b aarch64 Debian thing I've mentioned on the other board with a change of symlink and a reboot. Very handy.

All I'm waiting for now is 10b H.265 output, and I can retire the Khadas Vim. I realise this probably isn't a priority, and that's fine. I can wait.

Kendek
Posts: 128
Joined: Thu Jul 25, 2019 4:39 pm
Location: Kaposvár, Hungary

Re: Raspberry Pi4 bootloader - network boot support - BETA

Mon Sep 23, 2019 4:33 pm

timg236 wrote:
Mon Sep 23, 2019 3:56 pm
Did you also update fixup4.dat (I've updated the docs to explicitly state that this is required) ? My best guess is that Linux is booting but doesn't have enough CMA memory because start4.elf has wrong/missing fixup information.
I forgot that, but now the LibreELEC is working well. :)
There is a very long delay before the Linux boot process, even with BOOT_ORDER=0x1. Is it a normal behaviour with my eeprom config?

HiassofT
Posts: 222
Joined: Fri Jun 30, 2017 10:07 pm
Location: Salzburg, Austria
Contact: Website

Re: Raspberry Pi4 bootloader - network boot support - BETA

Mon Sep 23, 2019 4:46 pm

Kendek wrote:
Mon Sep 23, 2019 4:33 pm
I forgot that, but now the LibreELEC is working well. :)
There is a very long delay before the Linux boot process, even with BOOT_ORDER=0x1. Is it a normal behaviour with my eeprom config?
Which LibreELEC version are you using, I assume the latest official one, 9.2 beta 1?

With that version LibreELEC will copy the ~140MB SYSTEM file to RAM by default which can take a bit (but is probably useful when network booting and you can safely update kernel and SYSTEM on NFS while the RPi4 is running). Note that this will change in the next LE version, then you have to add "toram" to cmdline.txt (currently you'd have to use "noram" to prevent that).

Checking with a serial console and BOOT_UART=1 enabled may help to find out where the delay comes from, could also be the TFTP server is slow to respond.

so long,

Hias

dickon
Posts: 561
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: Raspberry Pi4 bootloader - network boot support - BETA

Mon Sep 23, 2019 4:48 pm

Ah.
For unknown reasons the brcmfmac wifi is not initialised in netowrk (sic) boot mode
Is it possible to initialise it once it's booted? If not, I may need to revert...

Kendek
Posts: 128
Joined: Thu Jul 25, 2019 4:39 pm
Location: Kaposvár, Hungary

Re: Raspberry Pi4 bootloader - network boot support - BETA

Mon Sep 23, 2019 4:58 pm

HiassofT wrote:
Mon Sep 23, 2019 4:46 pm
Which LibreELEC version are you using, I assume the latest official one, 9.2 beta 1?
Yeah, LibreELEC 9.1.501, and there is no such delay with previous eeprom versions.
Last edited by Kendek on Mon Sep 23, 2019 5:37 pm, edited 2 times in total.

timg236
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 252
Joined: Thu Jun 21, 2018 4:30 pm

Re: Raspberry Pi4 bootloader - network boot support - BETA

Mon Sep 23, 2019 5:00 pm

dickon wrote:
Mon Sep 23, 2019 4:48 pm
Ah.
For unknown reasons the brcmfmac wifi is not initialised in netowrk (sic) boot mode
Is it possible to initialise it once it's booted? If not, I may need to revert...
Not yet, adding some debug to the kernel reveals that bcm2835_mmc is sending SDIO commands to the WiFi module but it's failing to send / complete CMD55. Maybe the WiFi module is not getting powered on, will take another look tomorrow.

dickon
Posts: 561
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: Raspberry Pi4 bootloader - network boot support - BETA

Mon Sep 23, 2019 5:13 pm

Right, ta. Reinserting the SD card makes it work again; a few more days won't hurt...

timg236
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 252
Joined: Thu Jun 21, 2018 4:30 pm

Re: Raspberry Pi4 bootloader - network boot support - BETA

Tue Sep 24, 2019 12:39 pm

The WiFi issue has been fixed there was an issue, the problem was due to some missing setup for mmc1 when it was not used by start.elf for file-system. It will be in the next rpi-update. I'll reply when it's available.

BRX7
Posts: 32
Joined: Sat Aug 31, 2019 11:07 pm

Re: Raspberry Pi4 bootloader - network boot support - BETA

Tue Sep 24, 2019 5:45 pm

Ive upgraded the update 23-09-19
Getting issues since i had pinn based microsd install, (delayed, frozen boot)
Managed to get into raspbian and flashed back to. 10-09-19 but its not worked for me
Any help on downgrading thanks

Kendek
Posts: 128
Joined: Thu Jul 25, 2019 4:39 pm
Location: Kaposvár, Hungary

Re: Raspberry Pi4 bootloader - network boot support - BETA

Tue Sep 24, 2019 5:57 pm

BRX7 wrote:
Tue Sep 24, 2019 5:45 pm
Managed to get into raspbian and flashed back to. 10-09-19 but its not worked for me
If you want to revert the eeprom to the latest stable version, just use these commands:

Code: Select all

wget -O /boot/recovery.bin https://github.com/raspberrypi/rpi-eeprom/raw/master/firmware/recovery.bin
wget -O /boot/pieeprom.upd https://github.com/raspberrypi/rpi-eeprom/raw/master/firmware/critical/pieeprom-2019-09-10.bin
reboot

timg236
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 252
Joined: Thu Jun 21, 2018 4:30 pm

Re: Raspberry Pi4 bootloader - network boot support - BETA

Tue Sep 24, 2019 6:16 pm

BRX7 wrote:
Tue Sep 24, 2019 5:45 pm
Ive upgraded the update 23-09-19
Getting issues since i had pinn based microsd install, (delayed, frozen boot)
Managed to get into raspbian and flashed back to. 10-09-19 but its not worked for me
Any help on downgrading thanks
Thanks for testing and reporting the problem.

Did it get to the rainbow splash screen and did the green LED flash at all ?

timg236
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 252
Joined: Thu Jun 21, 2018 4:30 pm

Re: Raspberry Pi4 bootloader - network boot support - BETA

Tue Sep 24, 2019 6:53 pm

The WiFi issue with network boot should now be fixed in the latest rpi-update firmware.

dickon
Posts: 561
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: Raspberry Pi4 bootloader - network boot support - BETA

Tue Sep 24, 2019 10:27 pm

Stonking. Sorted, ta. Works like a charm.

And for the record, I'm still seriously impressed by the responsiveness of you Pi engineers to user-reported bugs. It puts multi-billion $currency companies to shame.

dickon
Posts: 561
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: Raspberry Pi4 bootloader - network boot support - BETA

Tue Sep 24, 2019 10:40 pm

And just to add, boots a 64b kernel happily, and I'm currently watching something in 1080p H.264 via omxplayer on it. I'm impressed. Seriously impressed.

HiassofT
Posts: 222
Joined: Fri Jun 30, 2017 10:07 pm
Location: Salzburg, Austria
Contact: Website

Re: Raspberry Pi4 bootloader - network boot support - BETA

Tue Sep 24, 2019 10:48 pm

I did some tests with a RPi behind a wifi bridge (typ. 10MB/sec net bandwidth with TCP) on a different subnet than the TFTP server, netbooting current LibreELEC 9.2 dev version.

First test went fine, so TFTP on different subnet seems to be no issue, but the TFTP_FILE_TIMEOUT default seems to a bit marginal - after a reboot the RPi didn't come back up.

After increasing TFTP_FILE_TIMEOUT from 15000 to 30000 that issue is solved.

May I suggest bumping the default TFTP_FILE_TIMEOUT value? DHCP_TIMEOUT is at 45000 and as TFTP has a bit more to do than DHCP it might help with congested networks etc too.

so long,

Hias

timg236
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 252
Joined: Thu Jun 21, 2018 4:30 pm

Re: Raspberry Pi4 bootloader - network boot support - BETA

Wed Sep 25, 2019 9:26 am

HiassofT wrote:
Tue Sep 24, 2019 10:48 pm
I did some tests with a RPi behind a wifi bridge (typ. 10MB/sec net bandwidth with TCP) on a different subnet than the TFTP server, netbooting current LibreELEC 9.2 dev version.

First test went fine, so TFTP on different subnet seems to be no issue, but the TFTP_FILE_TIMEOUT default seems to a bit marginal - after a reboot the RPi didn't come back up.

After increasing TFTP_FILE_TIMEOUT from 15000 to 30000 that issue is solved.

May I suggest bumping the default TFTP_FILE_TIMEOUT value? DHCP_TIMEOUT is at 45000 and as TFTP has a bit more to do than DHCP it might help with congested networks etc too.

so long,

Hias
Yes, that seems reasonable. I'll bump it to 30000. I've also changed loading sequence to only load start.elf instead of start4.elf if start4.elf does not exist. If a timeout occurs but start4.elf exists it will move to the next retry / boot mode.

timg236
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 252
Joined: Thu Jun 21, 2018 4:30 pm

Re: Raspberry Pi4 bootloader - network boot support - BETA

Wed Sep 25, 2019 12:19 pm

I've uploaded a new version which fixes an intermittent slow/freeze boot from sd-card, increases TFTP file timeout and fixes incorrect failover from start4.elf to start.elf

https://github.com/raspberrypi/rpi-eepr ... e-notes.md

The apt package should get updated later on today.

Kendek
Posts: 128
Joined: Thu Jul 25, 2019 4:39 pm
Location: Kaposvár, Hungary

Re: Raspberry Pi4 bootloader - network boot support - BETA

Wed Sep 25, 2019 2:11 pm

timg236 wrote:
Wed Sep 25, 2019 12:19 pm
I've uploaded a new version which fixes an intermittent slow/freeze boot from sd-card...
Thanks, this eeprom version is working well with LE on microSD card. No more delayed startup, and compatible with older start.elf.

timg236
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 252
Joined: Thu Jun 21, 2018 4:30 pm

Re: Raspberry Pi4 bootloader - network boot support - BETA

Wed Sep 25, 2019 2:18 pm

Kendek wrote:
Wed Sep 25, 2019 2:11 pm
timg236 wrote:
Wed Sep 25, 2019 12:19 pm
I've uploaded a new version which fixes an intermittent slow/freeze boot from sd-card...
Thanks, this eeprom version is working well with LE on microSD card. No more delayed startup, and compatible with older start.elf.
Thanks, that's great news. That was a very confusing issue to debug :)

dickon
Posts: 561
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: Raspberry Pi4 bootloader - network boot support - BETA

Wed Sep 25, 2019 4:10 pm

I realise that this doubtless isn't supported, but upgrading the eeprom using network booting doesn't work. This seems to be for two reasons: ropi-update-eeprom drops the new firmware in /boot/recovery.bin, whereas the bootloader looks for recovery.elf, recovery8.img, recovery8-32.img, recovery7l.img, recovery7.img, and recovery.img. Renaming recovery.bin to recovery.elf doesn't work, and results in the kernel being booted with what looks like some sort of default cmdline.txt.

Fun, though.

Return to “Advanced users”