Skip to main content

Raspberry Pi 5 uses PCIe hat/dual hat

Introduction

This tutorial mainly introduces the hardware connection configuration of M.2 Hat/dual Hat and how to make the Raspberry Pi boot from the SSD.And introduces two installation methods, with and without casing.

Getting Start

Hardware Preparation

For installation without a casing, you need to prepare the following materials:

  • ① Raspberry Pi 5
  • ② M.2 Hat/dual Hat
  • ③ SSD/AI Kit PCIe devices
  • ④ PCIe devices fixing screw
  • ⑤ PCIe connection cable between M.2 Hat and Raspberry Pi
  • ⑥ Screw sleeve、long screws and nuts
pir

For installation with a casing, you need to prepare the following materials:

  • ① Raspberry Pi 5
  • ② M.2 Hat/dual Hat
  • ③ SSD/AI Kit PCIe devices
  • ④ PCIe devices fixing screw
  • ⑤ PCIe connection cable between M.2 Hat and Raspberry Pi
  • ⑥ Long screws and nuts
  • outer casing
pir

Installation

pir

Step 1: Insert the PCIe connection cable into the M.2 Hat, paying attention to the insertion direction of the cable. Insert the PCIe interface of the M.2 Hat with the metal side facing downwards, as shown in the figure after insertion:

pir

Step 2: Insert the PCIe connection cable into Raspberry Pi 5.

pir

Please pay attention to the insertion direction of the cable. Insert the PCIe interface of Raspberry Pi 5 with the metal side facing up, as shown in the figure after insertion:

pir

Step 3: Overlap the Raspberry Pi 5 with the M.2 Hat and insert the screw sleeve into the screw.

pir

Then insert the screws into the screw holes of Raspberry Pi 5 and M.2 Hat, as shown in the figure:

pir

Step 4: Screw the stud into the screw and secure the screw to the circuit board, as shown in the figure:

pir

Step 5: Insert the SSD and AI Kit into M.2 dual Hat

pir

Then insert the fixing screws to secure the SSD and AI Kit in the M.2 Hat, as shown in the figure:

pir

Use SD Card Copier tool to flash OS onto the NVME SSD On Raspberry Pi OS

This method works if you have an SD card and have booted the device successfully. Please make sure your system is the latest Raspberry Pi system (Bookworm or later) and and your RPi 5 firmware is updated to 2023-12-06 (Dec 6th) or newer, otherwise it may not recognize the NVME-related configurations.

Step 1:Ensure that your Raspberry Pi system is up-to-date (Bookworm or later), enter the following command to update the RPi 5 firmware:

  sudo apt update && sudo apt upgrade -y
sudo rpi-eeprom-update # If it is not post-December 2023 type the following into a terminal to start the configuration tool
sudo raspi-config

Scroll down to Advanced Options and press Enter:

pir

Scroll down to Bootloader Version and press Enter:

pir

And finally choose Latest, and press Enter:

pir

Select No here - you want the latest bootloader.

pir

And exit from the tool by selecting Finish:

pir

If asked to reboot, select Yes.

pir

Step 2:Cick Applications =>Accessories =>SD Card Copier on the main screen, run the SD Card Copier program, and copy the OS to the NVME ssd as shown in the figure below.

pir

Setting the Raspberry Pi to boot from the NVMe SSD

If you have easy access to your SD card slot you could turn off your Pi, pop out the SD card and (if everything's working as expected) it should automagically boot from your NVMe drive the next time you start it up. If you want to leave the SD card where it is and still boot from NVMe though, you'll need to change the boot order.

Step 1:Enter the following command:

  sudo raspi-config

Scroll down to Advanced Options and press Enter:

pir

Step 2:Scroll down to Boot Order and press Enter:

pir

Step 3:Choose NVMe/USB Boot and press Enter:

pir

Configuration will be confirmed. Press Enter:

pir

Step 4:Return to the first screen by selecting Back or pressing the Esc key. Then navigate to Finish using the right cursor key.

pir

You will be asked whether you want to reboot now. Click Yes:

pir

Modify PCIe speed

M.2 Hat supports PCIe Gen 2 and PCIe Gen 3 modes

Step 1: Enter the following command to open the /boot/firmware/config.txt file

sudo nano /boot/firmware/config.txt

Step 2:Add the following to the [all] section at the end of the /boot/firmware/config.txt file:

dtparam=pciex1_gen=3

Save the file and reboot again, you may see a speed increase!.

Tech Support & Product Discussion

Thank you for choosing our products! We are here to provide you with different support to ensure that your experience with our products is as smooth as possible. We offer several communication channels to cater to different preferences and needs.

Loading Comments...