Introduction
Keeping the Raspberry Pi bootloader up-to-date is essential for accessing new features, performance improvements, and bug fixes. This technical knowledge article provides a step-by-step guide for the Cytron support team to prepare and install the bootloader on Raspberry Pi 4 and Pi 5 using the Raspberry Pi Imager. This process is particularly important for enabling features like NVMe booting on Raspberry Pi 5 with bootloader versions 30de0ba5 (released 2024/01/05) or later.
Prerequisites
Raspberry Pi 4 or 5: Ensure the device is powered off and peripherals are disconnected before starting.
MicroSD Card: A spare microSD card (minimum 8GB recommended) for flashing the bootloader.
Computer: A system running Windows, macOS, or Linux with an SD card reader.
Raspberry Pi Imager: Download the latest version from the official Raspberry Pi website (https://www.raspberrypi.com/software/).
Internet Connection: Required for downloading the Raspberry Pi Imager and bootloader images.
Step-by-Step Guide
Step 1: Install Raspberry Pi Imager
Visit the official Raspberry Pi website (https://www.raspberrypi.com/software/) and download the Raspberry Pi Imager for your operating system (Windows, macOS, or Linux).
Follow the installation instructions provided on the website to set up the Imager on your computer.
Alternatively, for Raspberry Pi OS, install the Imager via the terminal with the command:
sudo apt install rpi-imager
Step 2: Launch Raspberry Pi Imager
Open the Raspberry Pi Imager application on your computer.
Ensure your spare microSD card is inserted into the SD card reader.
Step 3: Select the Raspberry Pi Model
Click Choose Device in the Imager interface.
Select your Raspberry Pi model (Raspberry Pi 4 or Raspberry Pi 5) from the list to ensure compatibility with the bootloader.
Step 4: Select the Bootloader Image
Click Choose OS.
Scroll down and select Misc utility images from the operating system menu.
Choose the Bootloader option for your specific Raspberry Pi model. For Raspberry Pi 4, select the stable bootloader; for Raspberry Pi 5, ensure the bootloader version is 30de0ba5 or later to support PCIe NVMe booting.
Note: Avoid the "Beta Test Bootloader" unless specifically required for testing, as it may be less stable.
Step 5: Configure Boot Order
After selecting the bootloader, choose SD Card Boot as the boot order to ensure the Raspberry Pi prioritizes the microSD card for the bootloader update.
For Raspberry Pi 5 users intending to boot from an NVMe drive, verify that the BOOT_ORDER includes the value "6" (e.g., 0xf461, which prioritizes SD Card [1], NVMe [6], and USB [4]). This can be checked later using rpi-eeprom-config if needed.
Step 6: Select Storage
Click Choose Storage and select your microSD card from the list of available devices.
Warning: Ensure no other external storage devices are connected to avoid accidental data loss, as the Imager will erase all data on the selected device.
Step 7: Flash the Bootloader
Click Next to proceed.
A prompt will warn that the microSD card's contents will be erased. Confirm by selecting YES.
The Imager will write the bootloader image to the microSD card. This process typically takes a few minutes.
Once complete, a confirmation message will appear, indicating that the bootloader has been successfully written to the microSD card. Safely eject the card.
Step 8: Install the Bootloader on the Raspberry Pi
Power off the Raspberry Pi and ensure all peripherals (e.g., USB drives, keyboards, etc.) are disconnected.
Insert the microSD card with the flashed bootloader into the Raspberry Pi’s SD card slot.
Power on the Raspberry Pi. The device will read the bootloader image from the microSD card and update the EEPROM.
Verification: A successful update is indicated by a rapidly blinking green LED on the Raspberry Pi. If the LED displays a different blinking pattern, it indicates an error. Refer to the Raspberry Pi documentation for specific error codes.
Once the update is complete, power off the Raspberry Pi, remove the microSD card, and insert the original SD card or NVMe drive (for Pi 5) with the desired operating system.
Step 9: Verify NVMe Booting (Raspberry Pi 5 Only)
For Raspberry Pi 5 users utilizing a PCIe NVMe HAT:
Install the NVMe drive with a preinstalled Raspberry Pi OS (e.g., Bookworm).
Boot the Raspberry Pi and open a terminal.
Run the command lsblk to verify that the NVMe drive is detected as a block device.
If the NVMe drive is not detected, check the BOOT_ORDER configuration using:
rpi-eeprom-config
Ensure the value "6" is present in the BOOT_ORDER (e.g., 0xf461). If absent, edit the configuration with:
sudo rpi-eeprom-config --edit
Add "6" to the BOOT_ORDER and save the changes.
Step 10: Post-Installation
Power on the Raspberry Pi with the original SD card or NVMe drive.
Verify that the system boots correctly and the new bootloader features (e.g., NVMe support on Pi 5) are functional.
Periodically check for bootloader updates using the Raspberry Pi Imager to ensure the device remains up-to-date with the latest firmware enhancements.
Troubleshooting
Unsuccessful Bootloader Update: If the green LED does not blink rapidly, indicating a failed update, reflash the microSD card with the bootloader image and repeat the process. Ensure the correct Raspberry Pi model is selected in the Imager.
NVMe Not Detected (Pi 5): Confirm the bootloader version is 30de0ba5 or later and that the BOOT_ORDER includes "6". If issues persist, consult the Raspberry Pi documentation or the rpi-eeprom GitHub repository for advanced troubleshooting.
Imager Issues: If the Raspberry Pi Imager fails to run or detect the microSD card, ensure it is properly installed and the card is formatted correctly (FAT32). Alternatively, use another imaging tool like Balena Etcher.
Corrupted Bootloader: In rare cases of a corrupted bootloader, use a spare SD card with the Raspberry Pi Imager to flash an EEPROM recovery image to restore factory defaults.
Best Practices for Cytron Support Team
Regular Updates: Encourage users to check for bootloader updates periodically to maintain compatibility with new hardware (e.g., PCIe NVMe HAT) and software features.
Documentation Reference: Always refer to the official Raspberry Pi documentation (https://www.raspberrypi.com/documentation/) for the latest bootloader and hardware specifications.
Backup: Advise users to back up critical data on their Raspberry Pi before performing bootloader updates, as the process may involve erasing storage devices.
NVMe Setup for Pi 5: Emphasise the importance of bootloader version 30de0ba5 or later for NVMe booting and verify the BOOT_ORDER configuration post-update.
Support Resources: Direct users to the Cytron tutorial (https://my.cytron.io/tutorial/raspberry-pi-imager-updating-bootloader) and the Raspberry Pi general discussion forum for additional support.
Conclusion
Updating the bootloader on Raspberry Pi 4 and Pi 5 using the Raspberry Pi Imager is a straightforward process that ensures optimal performance and compatibility with advanced features like NVMe booting on Pi 5. By following this guide, the Cytron support team can assist users in maintaining their Raspberry Pi devices with the latest firmware, enhancing reliability and functionality for various applications.