Sunday, 10 November 2024

Raspberry Pi Hailo AI HAT+

Introduction

The Raspberry Pi AI HAT+ add-on board has a built-in Hailo 13 (8L) and 26 (8) tera-operations per second (TOPS) AI accelerator. 


Data transfer is via a PCIe interface (so is only compatible with Raspberry Pi 5s, not earlier models).

The Raspberry Pi 5 will detect the presence of the Hailo Accelerator and can use the Neural Processing Unit for supported AI tasks, including the built in O/S rpicam-apps post processing tasks.

What you need

You will need a Raspberry Pi 5, an Active Cooler, the Raspberry Pi AI HAT+ and a suitably loaded MicroSD card.

Raspberry Pi have recently started to supply high-speed preloaded MIcro SD cards.

Installation

This installation follows the general procedure described in the instructions.

However, if you wish to use a PiBow Coupe case with this build, ensure that you begin fitting the case components before installing the Active Cooler as it is not recommended to remove a previously installed Active Cooler.

So I have a PiBow Coupe case for another Raspberry Pi 5 (luckily I also ordered a Raspberry Pi Bumper case at the same time).






Install the Active Cooler

The Raspberry Pi 5 tends to run hot, so the Active Cooler (or a case with a fan) is recommended.

Now, probably the board and the SD card should be tested before installing the cooler (as removal of the active cooler is not recommended and likely to be messy).

Remove the backing paper from the Active Cooler, this shows the heat transfer pads.

Before adding the Active Cooler, remove the blanking piece from the Fan connector on the Raspberry Pi board. It is possible to remove when the Active Cooler is attached, but it is more difficult.

Orientate the Active Cooler above the Raspberry Pi board so the fan enclosure is towards the USB and Ethernet enclosures. Align the two pins with the corresponding holes in the board and ensure that the fan cable is clear. Once aligned correctly, gently push the end of the pins through the board. The spring clips will hold the pins in place.



Initial Software Set up

First ensure that the Raspberry Pi has a suitable SD card installed. I ordered a pre-loaded example

Boot and configure as per normal.

I have found that the WiFi is not detected, so had to miss out on the O/S update until the initial setup was complete and then added the WiFi. There was a slight issue with the first software update which required a call to dpkg to clear up.

As it was a clean new install the following two steps may not have been required but were undertaken.

sudo apt update

sudo apt full-upgrade

The boards firmware needs to have the required updates so run:

sudo rpi-eeprom-update

Check date, if after 6 December 2023 it is fine otherwise use raspi-config to update the bootloader to the latest version.

Then run 

sudo rpi-eeprom-update -a

Reboot (sudo reboot).

Install the AI HAT+

The AI HAT+ comprises the board itself, an extended header (of which more anon) and a fixing kit.


Note that the ribbon cable is taped to the board. Remove the tape before proceeding (carefully).

The instructions recommend removing the ribbon cable from the board, but neglect to inform you how to release it. I managed to leave it in place.

Align the stacking header with the pins on the GPIO, there is no orientation, just make sure that the pins are aligned with the holes. Push firmly down.

There are four short and four long screws included in the kit, the instructions show the smaller screws in use at the bottom, but because I was using the Bumper Case I used the longer ones, passing through the holes in the case. The spacers were then screwed into screws (not too tight).

It is at this point that the instructions suggest inserting the ribbon cable into the PCIe socket on the board. 

Lift the cover on the PCIe connector and insert the end of the ribbon cable. If you have left the cable in the board, then you will probably need to move on to attaching the AI HAT+ to the spacers before fitting the cable to the Raspberry Pi.

Use the remaining screws to attach the board.



I mentioned the stacking header earlier.
I was expecting the pins to pass all the way through the soclet on the AI HAT+, unfortunately the 16mm extended header supplied only just passes through, there is insufficient remaining header to add an additional HAT on top.
This might [possibly be by design, but in that case I would have expected a conventional socket to be fitted to the AI HAT+ board rather than a pass through one.


Fit the cable to the board.

Software installation

There is a recommendation that the PCIe interface is set to Gen 3.0. There are instructions here.

Install dependences

sudo apt install hailo-all

Reboot

Check everything is working with the following command:

hailortcli fw-control identify

If you get an error 13, check that the cable is inserted correctly.

Next steps

Test the board with a USB camera (I am not intending to use the board with a camera so I have not installed one).

That is for another post.

References:

https://shop.pimoroni.com/products/pibow-5?variant=41045302542419

https://shop.pimoroni.com/products/raspberry-pi-5?variant=41044580171859

https://shop.pimoroni.com/products/raspberry-pi-5-active-cooler

https://shop.pimoroni.com/products/raspberry-pi-ai-hat?variant=53502129701243

https://shop.pimoroni.com/products/microsd-card-with-raspberry-pi-os?variant=31703694245971

https://shop.pimoroni.com/products/raspberry-pi-5-bumper


https://www.raspberrypi.com/news/raspberry-pi-ai-hat/

https://www.raspberrypi.com/products/ai-hat/

https://cdn.shopify.com/s/files/1/0174/1800/files/Raspberry_Pi_AI_HAT_product_brief.pdf?v=1729683532

https://www.raspberrypi.com/documentation/accessories/ai-hat-plus.html

https://www.raspberrypi.com/documentation/computers/ai.html

https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#pcie-gen-3-0


https://en.wikipedia.org/wiki/AI_accelerator

https://en.wikipedia.org/wiki/Hailo_Technologies


Saturday, 27 January 2024

Raspberry PI 5 with NVME Base and SSD

 Pimoroni have recently released a base to interface a Raspberry Pi 5 to a Solid State Drive.

Components

Raspberry Pi 5 with 8GB of RAM.

A Raspberry Pi 5 Active Cooler (fan and heat sink).


The Active Cooler comes complete with pre-fitted heat sink pads.
A 500GB SSD. 

The Pimoroni NVME base.
The NVME pack contains the base plate itself, a pack of crews and nuts, a ribbon cable and some self-adhesive feet.
Of course you need a power supply.

Assembling the Raspberry Pi 5 with the active cooler

Take the Raspberry Pi 5 out of the box (remember to earth your self before opening the box).
Take the Active Cooler out of its box and check the power cable.
Remove the cap from the fan socket.

Remove the backing paper from the heat sink.
Check the operation of the spring-loaded attachment pins.

Align the pins with the relevant holes in the Raspberry Pi board.
When they are aligned, push the pins through the cooler board until they are attached to the Raspberry Pi board. Ensure alignment before releasing the pins so the heat sink material adheres to the required components. 

This is definitely not something to do when it is very warm as it makes the heat sink material very sticky.

Plug the cooler power lead into the Raspberry Pi board.

Create the OS SD card

The latest installer allows you to select the hardware, in this case a Raspberry Pi 5, as well as the operating system.

The NVME base requires 64-bit Raspberry Pi OS.

Select the 64bit Raspberry Pi OS.

Image the SD card.

Once the OS is ready, slot the SD card in and boot.

Finish the set up for the OS including a full update..

Building the NVME base

Once the Raspberry Pi is updated, shut it down and remove the power supply.
Place the Raspberry Pi 5 and the contents of the NVME pack on your work space.
Check the components:
  • NVMe Base PCB with M.2 Slot (M-Key)
  • 'PCIe Pipe' Flat Flex Cable
  • 4x Rubber feet
  • M2 bolt and 2x nuts for SSD mounting
  • 4x 7mm M2.5 standoffs for base mounting
  • 8x short M2.5 bolts for base mounting 
  • 4x long M2.5 bolts for 'pass-through' mounting with a HAT
The pack is suppllied with a number of spares, just in case.

Fit the short M2.5 bolts through the base and add the stand-offs.


Carefully remove the SSD from the packaging. In this case, there are instructions in the box showing how to remove the SSD (you use one of the finger holes and rotate it out of the plastic carrier). 

Take the M2 bolt and fit to the base for the size of SSD. Fix in place with one of the nuts.

Take the SSD drive and slot into into the slot on the board. Ensure the SSD in aligned properly and square to the connector. Fix in place with the second nut.

Take the Raspberry Pi board. Gently lift the cover on the PCIE connector.

Take the ribbon cable. The image ill face outwards when fully assembled and the Pi end is the smaller (so the text is the right way up when the NVME base is at the bottom.

Hold the cable in place (copper side towards the centre of the board) and push down the latches.

Turn the Pi upside down and bring the NVME base in.

On the NVME board, flip up the connector. Fit the ribbon cable. Once it is correcly aligned, flip the latch down.

Now screw the two boards together carefully.


Turn the Pi - NVME board sandwich (with its SSD filling) upside down.
Apply the self adhesive feet. The left hand end is easy as they can go in the top and bottom corners. The right hand ones can go just in-board of the screws.

Software installation

Switch on your Raspberry Pi.

Log in as normal (you should have already configured the SD card earlier).

The Raspberry Pi needs to have the latest updates including firmware. The normal update should  work, but you can force the update via  sudo raspi-config. Update the firmware using sudo epi-eeprom-update.

You can format the the SSD using the Raspberry Pi Imager. It should allow you to import the settings from the SDD card (locale, WiFi etc).

Once that has completed run sudo raspi-config in a terminal window.

Go to the Advanced section and change the boot order to boot from the SSD.

Reboot.

The Raspberry Pi will boot from the SSD.

Shut down, and carefully remove the SD card and put it in a safe place.

References

Raspberry Pi 5

https://shop.pimoroni.com/products/raspberry-pi-5?variant=41044580171859

Raspberry Pi 5 Active cooler

https://shop.pimoroni.com/products/raspberry-pi-5-active-cooler

NVME Base

https://shop.pimoroni.com/products/nvme-base?variant=41219587178579

Assembling the NVME Base video

https://www.youtube.com/watch?v=odG7FbptgWQ


Sunday, 24 December 2023

Adafruit RP2040 Prop-Maker Feather board

 The Adafruit RP2040 Prop-Maker Feather combines the RP2040 processor with a driver for Neopixels, QT Stemma socket, speaker and a battery charger socket.

The board uses a USB-C connector. 
It has a six screw terminals for the three leads for the Neopixels, two for the speaker and one for a button. 
There is a three pin connector for a servo.
The battery connection is top left. It is important to note that this board includes a charging circuit so only use chargeable LiPo batteries or follow the instructions to isolate the charging circuit.


It is important to note that as a power saving feature the Neopixel driver, the servo and the speaker amplifier are only powered when the GPIO23 pin is high (I spent a while trying to find out why the Neopixels were not lighting up until I remembered).

Here is the board operating a Neopixel strip. 


Code to follow.

ADAFRUIT Metro RP2040 Arduino UNO format microcontroller.

 The Adafruit Metro RP2040 takes the Arduino format and adds the Raspberry Pi RP2040.

In addition to the normal UNO I/O, there is a micro-SD socket and Stemma QT socket.


PIMORONI PicoVision dual RP2040

 PIMORONI have released a clever board that combines a Pico W with a second RP2040 chip and supporting electronics complete with an HDMI shaped output, a 3.5mm headphone socket and a micro-SD card reader.

It is available on its own or as part of a complete box set.

I bought the complete box set.

The Pico Vision uses a complete Pico-W board as the main microcontroller, which is attached to the Pico Vision board.
The second RP2040 acts as a GPU.
One of the clever items in the box is a USB splitter cable which allows a USB device to be plugged into the board while the socket is also powering the board.

Now to actually use it.