Using the M.2 HAT+ with Raspberry Pi 5
The Raspberry Pi M.2 HAT+ M Key enables you to connect M.2 peripherals such as NVMe drives and other PCIe accessories to Raspberry Pi 5’s PCIe interface.
The M.2 HAT+ adapter board converts between the PCIe connector on Raspberry Pi 5 and a single M.2 M key edge connector. You can connect any device that uses the 2230 or 2242 form factors. The M.2 HAT+ can supply up to 3A of power.

The M.2 HAT+ uses Raspberry Pi’s HAT+ specification, which allows Raspberry Pi OS to automatically detect the HAT+ and any connected devices.
The included threaded spacers provide ample room to fit the Raspberry Pi Active Cooler beneath an M.2 HAT+.
The M.2 HAT+ is only compatible with the Raspberry Pi Case for Raspberry Pi 5 if you remove the lid and the included fan.
Features
- Single-lane PCIe 2.0 interface (500 MB/s peak transfer rate)
- Supports devices that use the M.2 M key edge connector
- Supports devices with the 2230 or 2242 form factors
- Supplies up to 3A to connected M.2 devices
- Power and activity LEDs
- Conforms to the Raspberry Pi HAT+ specification
Includes
- Ribbon cable
- 16mm GPIO stacking header
- 4 threaded spacers
- 8 screws
- 1 knurled double-flanged drive attachment screw to secure and support the M.2 peripheral
Installation
To use the Raspberry Pi M.2 HAT+, you will need a Raspberry Pi 5

Each M.2 HAT+ comes with a ribbon cable, GPIO stacking header, and mounting hardware. Complete the following instructions to install your M.2 HAT+:
First, ensure your Raspberry Pi runs the latest software. Run the following command to update:
sudo apt update && sudo apt full-upgrade
Next, ensure that your Raspberry Pi firmware is up to date. Run the following command to see what firmware you’re running:
sudo rpi-eeprom-update
If you see December 6, 2023 or a later date, proceed to the next step. If you see a date earlier than December 6, 2023, run the following command to open the Raspberry Pi Configuration CLI:
sudo raspi-config
Under Advanced Options > Bootloader Version, choose Latest. Then, exit raspi-config with Finish or the ESC key.
Run the following command to update your firmware to the latest version:
sudo rpi-eeprom-update -a
Then, reboot with sudo reboot.
Disconnect the Raspberry Pi from power before beginning installation.
The M.2 HAT+ is compatible with the Raspberry Pi 5 Active Cooler. If you have an Active Cooler, install it before installing the M.2 HAT+.
Install the spacers using four of the provided screws. Firmly press the GPIO stacking header on top of the Raspberry Pi GPIO pins; orientation does not matter as long as all pins fit into place. Disconnect the ribbon cable from the M.2 HAT+, and insert the other end into the PCIe port of your Raspberry Pi. Lift the ribbon cable holder from both sides, then insert the cable with the copper contact points facing inward, towards the USB ports. With the ribbon cable fully and evenly inserted into the PCIe port, push the cable holder down from both sides to secure the ribbon cable firmly in place.
Set the M.2 HAT+ on top of the spacers, and use the four remaining screws to secure it in place.
Insert the ribbon cable into the slot on the M.2 HAT+. Lift the ribbon cable holder from both sides, then insert the cable with the copper contact points facing up. With the ribbon cable fully and evenly inserted into the port, push the cable holder down from both sides to secure the ribbon cable firmly in place.

Remove the drive attachment screw by turning the screw counter-clockwise. Insert your M.2 SSD into the M.2 key edge connector, sliding the drive into the slot at a slight upward angle. Do not force the drive into the slot: it should slide in gently.
Push the notch on the drive attachment screw into the slot at the end of your M.2 drive. Push the drive flat against the M.2 HAT+, and insert the SSD attachment screw by turning the screw clockwise until the SSD feels secure. Do not over-tighten the screw.
Congratulations, you have successfully installed the M.2 HAT+. Connect your Raspberry Pi to power; Raspberry Pi OS will automatically detect the M.2 HAT+. If you use Raspberry Pi Desktop, you should see an icon representing the drive on your desktop. If you don’t use a desktop, you can find the drive at/dev/nvme0n1. To make your drive available for file access automatically, consider configuring automatic mounting.
Boot from NVMe
To boot from an NVMe drive attached to the M.2 HAT+, complete the following steps:
1. Format your NVMe drive using Raspberry Pi Imager. You can do this from your Raspberry Pi if you already have an SD card with a Raspberry Pi OS image.
2. Boot your Raspberry Pi into Raspberry Pi OS using an SD card or USB drive to alter the boot order in the persistent on-board EEPROM configuration.
3. In a terminal on your Raspberry Pi, run sudo raspi-config to open the Raspberry Pi Configuration CLI.
4. Under Advanced Options > Boot Order, choose NVMe/USB boot. Then, exit raspi-config with Finish or the Escape key.
5. Reboot your Raspberry Pi with sudo reboot.
For more information, see NVMe boot.
10 comments
F Trevor Gowen
I’m not sure how common this is (I’ve had two examples so far) but the NVMe SSD may not have a partition table (and, of course, any partitions!). That has to be dealt with (via gparted etc.) before any icons etc. will appear. NB: I logged this info. within a couple of threads in the forum a while ago. My own notes, with screenshots etc. are not yet fully updated within my website but should be within a day or two.
Trev.
Tom
How come the eeprom needs an update ? What changes are in this ? Can you link to a changelog ?
AndrewS
Here you go:
https://github.com/raspberrypi/rpi-eeprom/blob/master/firmware-2712/release-notes.md
W. H. Heydt
One problem I’ve encountered–having put 3 systems together this way so far–is that the supplied screws are not long enough to go through the bottom part of the case, the Pi5 PCB, and engage the threads in the standoffs. The kit really needs longer screws. Just two or three mm would do.
Cliff
Is there any way to use an NVME SSD that uses the Opal 2.0 specification for booting? I have been able to access the ssd after booting, but not actually booting from it.
Teig L Levingston
The only issue I’ve had is with the stacking header, the gpio pins aren’t accessible. You can add a longer extender but that makes the PCIE cable very tight and requires different extenders. It works though.
Júlia
Hellow, I am having the same issue. Could you let me know which longer extender have you bought, please? I found this: https://www.adafruit.com/product/2223 but I am not sure if it is large enough. What extenders have you needed to use?
Thank you!
Jason
I’m having the same problem. I can’t believe this hat can’t be stacked under other hats, it has to be on top, and it doesn’t allow for any access to the GPIO pins.
I’ve ordered one of these from Adafruit, I’ll report back when I have received and tried it: Stacking Header for Pi A+/B+/Pi 2/Pi 3 – 2×20 Extra Tall Header: https://www.adafruit.com/product/1979
Jack Howard
Hi Jason,
Any new if these extra long header pins worked?
Bob Edwards
Hi Jason,
Just looking for information. I am a Pi newbie and have put the Pi M2 hat and nvme onto my Pi 5 but I also want to attach to the new 7″ Pi display so I need to access the GPIO pins for power. I was wondering if the extended pins you suggested from Adafruit worked or did you find another workaround please? (From UK)
Cheers
Bob
Comments are closed