M.2 HAT for Raspberry Pi 5


Introduction

The AI module is a 13 tera-operations per second (TOPS) neural network inference accelerator built around the Hailo-8L chip. The module uses the M.2 2242 form factor, and comes pre-installed in the M.2 HAT+, to which it connects through an M key edge connector. The M.2 HAT+ communicates between the AI module’s M.2 interface and the Raspberry Pi 5’s PCIe 2.0 interface.

When the host Raspberry Pi 5 is running an up-to-date Raspberry Pi OS image, it automatically detects the Hailo module and makes the NPU available for AI computing tasks. The built-in spam-apps camera applications in Raspberry Pi OS natively support the AI module, automatically using the NPU to run compatible post-processing tasks.

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 factor

  • Supplies up to 3A to connected M.2 devices

  • Power and activity LEDs

  • 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

Specifications

Contains a neural network inference accelerator capable of 13 tera-operations per second (TOPS)

Fully integrated into Raspberry Pi’s camera software stack

Thermal pad pre-fitted between module and HAT+ spreads heat across components, improving performance

Conforms to Raspberry Pi HAT+ specification

Supplied with 16mm stacking header, spacers, and screws to enable fitting on Raspberry Pi 5 with Raspberry Pi Active Cooler in place

Pinout

Dimensions

How to Use

Install

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+:

  1. First, ensure that your Raspberry Pi runs the latest software. Run the following command to update:

    $ sudo apt update && sudo apt full-upgrade
  2. 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 Escape key.

    Run the following command to update your firmware to the latest version:

    $ sudo rpi-eeprom-update -a

    Then, reboot with sudo reboot.

  3. Disconnect the Raspberry Pi from power before beginning installation.

  4. 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+.

  5. 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.

  6. Set the M.2 HAT+ on top of the spacers, and use the four remaining screws to secure it in place.

  7. 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.

  8. 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.

  9. 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.

  10. 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 automatically available for file access, consider configuring automatic mounting.

Warning

Always disconnect your Raspberry Pi from power before connecting or disconnecting a device from the M.2 slot.

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.

Enable PCIe Gen 3

Warning

The Raspberry Pi 5 is not certified for Gen 3.0 speeds. PCIe Gen 3.0 connections may be unstable.

To enable PCIe Gen 3 speeds, follow the instructions at enable PCIe Gen 3.0.

Last updated