You can refer to AI HAT+ - Raspberry Pi Documentation https://www.raspberrypi.com/documentation/accessories/ai-hat-plus.html#ai-hat-plus
In this section, learn how to set up a Raspberry Pi 5 with the AI HAT+.
We used a Raspberry Pi 5 model with the official active cooler and a 27W USB-C power supply. We recommend using the official USB-C power supply or one that supports the Raspberry Pi 5 Power Delivery protocol to ensure the motherboard can provide sufficient power to the AI HAT+.
Install the spacer using the four screws provided. Firmly press the GPIO 40pin header onto the bottom of the Raspberry Pi GPIO pins; confirm that all pins are seated in place. Disconnect the cable from the AI HAT+ and insert the other end into the PCIe port of the Raspberry Pi. Lift the cable brackets from both sides and insert the cable with the copper contacts facing inward, toward the USB port. Once the cable is fully and evenly inserted into the PCIe port, lower the cable brackets from both sides to secure the cable in place.
The installation is as shown below:
For CSI camera connection, please refer to the Raspberry Pi 5 camera case.
Note: The SD card of the Raspberry Pi 5 needs to contain a bootable image. Please refer to the image burning in the Raspberry Pi 5 tutorial we provided
The interface that appears after successful startup
UPDATE SYSTEM
Note: (The following steps are only required for DIY in your own environment. If you directly use the image we provide, you do not need to rebuild it)
sudo apt update
sudo apt full-upgrade
This will update your system to the latest Raspberry Pi core, which includes AI HAT+ driver support.
Next, make sure your Raspberry Pi firmware is up to date. Run the following command to see what firmware you are running:
xxxxxxxxxx
sudo rpi-eeprom-update
If you see a date of December 6, 2023 or later, 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:
xxxxxxxxxx
sudo raspi-config
Under Advanced Options
> Bootloader Version
, select Latest
. Then exit raspi-config
using Finish
or the Esc key.
Run the following command to update the firmware to the latest version:
xxxxxxxxxx
sudo rpi-eeprom-update -a
Then, reboot
xxxxxxxxxx
sudo reboot
Set PCIe to Gen3
To achieve optimal performance of the AI HAT+ device, it is necessary to set PCIe to Gen3. While using Gen2 is an option, it will result in reduced performance.
Open the Raspberry Pi Configuration Tool:
xxxxxxxxxx
sudo raspi-config
Select option 6 Advanced options and then option A8 PCIe speed. Select Yes to enable PCIe Gen 3 mode. Click Finish to exit.
Install hailo software
Install all necessary software to make the Raspberry Pi AI HAT+ work properly. To do this, run the following command from a terminal window:
xxxxxxxxxx
sudo apt install hailo-all
The following picture shows that the installation has been successful
This will install the following software components:
Reboot your Raspberry Pi.
xxxxxxxxxx
sudo reboot
Test the TAPPAS Core installation by running the following command:
Hailotools:
xxxxxxxxxx
gst-inspect-1.0 hailotools
Expected results:
Hailonet:
xxxxxxxxxx
gst-inspect-1.0 hailo
Expected results:
If found or not, try deleting the GStreamer registry: hailo
hailotools
xxxxxxxxxx
rm ~/.cache/gstreamer-1.0/registry.aarch64.bin
The following issues should be handled by the TAPPAS Core installation deb, but if you encounter them, you can fix them manually.
Some hosts do not support certain PCIe descriptor page sizes. If you receive an error like:
xxxxxxxxxx
[HailoRT] [error] CHECK_AS_EXPECTED failed - max_desc_page_size given 16384 is bigger than hw max desc page size 4096
Make sure that exists and contains the following line: /etc/modprobe.d/hailo_pci.conf
xxxxxxxxxx
options hailo_pci force_desc_page_size=4096
Check the configuration:
xxxxxxxxxx
cat /etc/modprobe.d/hailo_pci.conf
# expected result:
options hailo_pci force_desc_page_size=4096
In some cases (especially aarch64), you may encounter the following error, causing some GStreamer plugins to not load correctly. The error message is:
xxxxxxxxxx
bash
(gst-plugin-scanner:67): GStreamer-WARNING **: 12:20:39.178: Failed to load plugin '/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstlibav.so': /lib/aarch64-linux-gnu/libgomp.so.1: cannot allocate memory in static TLS block
This should be fixed by adding the following to your file:.bashrc
xxxxxxxxxx
echo 'export LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libgomp.so.1' >> ~/.bashrc
If you have already encountered this error, you can fix it by running the following command:
xxxxxxxxxx
export LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libgomp.so.1
rm ~/.cache/gstreamer-1.0/registry.aarch64.bin