Last active
July 23, 2024 07:59
-
-
Save dataslayermedia/714ec5a9601249d9ee754919dea49c7e to your computer and use it in GitHub Desktop.
Install Coral AI PCIe Edge TPU on Raspberry Pi 5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd / | |
sudo apt update | |
echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" | sudo tee /etc/apt/sources.list.d/coral-edgetpu.list | |
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - | |
sudo apt-get update | |
sudo apt-get install libedgetpu1-std | |
sudo apt install -y devscripts debhelper | |
sudo apt install dkms | |
sudo apt-get install dh-dkms | |
# Clone the Gasket driver repository | |
sudo git clone https://github.com/google/gasket-driver.git | |
# Change directory to the cloned repository | |
cd gasket-driver | |
# Build the Gasket driver package | |
sudo debuild -us -uc -tc -b | |
# Go back to the parent directory | |
cd .. | |
# Install the built Gasket driver package | |
sudo dpkg -i gasket-dkms_1.0-18_all.deb | |
sudo sh -c "echo 'SUBSYSTEM==\"apex\", MODE=\"0660\", GROUP=\"apex\"' >> /etc/udev/rules.d/65-apex.rules" | |
sudo groupadd apex | |
sudo adduser $USER apex | |
# Update the boot configuration for Raspberry Pi | |
echo "kernel=kernel8.img" | sudo tee -a /boot/firmware/config.txt | |
# Back up the Device Tree Blob (DTB) | |
sudo cp /boot/firmware/bcm2712-rpi-5-b.dtb /boot/firmware/bcm2712-rpi-5-b.dtb.bak | |
# Decompile the DTB into a DTS file | |
sudo dtc -I dtb -O dts /boot/firmware/bcm2712-rpi-5-b.dtb -o ~/test.dts | |
# Modify the Device Tree Source (DTS) | |
sudo sed -i '/pcie@110000 {/,/};/{/msi-parent = <[^>]*>;/{s/msi-parent = <[^>]*>;/msi-parent = <0x67>;/}}' ~/test.dts | |
# Recompile the DTS back into a DTB | |
sudo dtc -I dts -O dtb ~/test.dts -o ~/test.dtb | |
# Replace the old DTB with the new one | |
sudo mv ~/test.dtb /boot/firmware/bcm2712-rpi-5-b.dtb | |
sudo reboot now |
Hello,
I rollback the modifications made on my own to DTS to keep raspberry pi's original version.
I want to test device tree overlay proposed by the supplier.
I just add the line dtoverlay=pineboards-hat-ai
on /boot/firmware/config.txt
,
If you have a kernel greater then 6.6.30 I recommend to use this method instead of modifying the DTS yourself.
Thanks @mikegapinski for the link to the tutorial.
Generally, the address changes each time RPI updates the device tree, so you’d need to update it on every update. The overlay is the only way around it.
Od: Marcos Cunha ***@***.***>
Data: czwartek, 18 lipca 2024 o 08:40
Do: marcoscunha ***@***.***>
DW: Mention ***@***.***>
Temat: Re: dataslayermedia/coral-ai-pcie-edge-tpu-raspberrypi-5-setup
@marcoscunha commented on this gist.
…________________________________
Hello,
I rollback the modifications made on my own to DTS to keep raspberry pi's original version.
I want to test device tree overlay proposed by the supplier.
I just add the line dtoverlay=pineboards-hat-ai on /boot/firmware/config.txt,
If you have a kernel greater then 6.6.30 I recommend to use this method instead of modifying the DTS yourself.
Thanks @mikegapinski<https://github.com/mikegapinski> for the link to the tutorial.
—
Reply to this email directly, view it on GitHub<https://gist.github.com/dataslayermedia/714ec5a9601249d9ee754919dea49c7e#gistcomment-5125202> or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAHDCB4DEVU7WLWXIDLWSNTZM5PNZBFKMF2HI4TJMJ2XIZLTSKBKK5TBNR2WLJDUOJ2WLJDOMFWWLO3UNBZGKYLEL5YGC4TUNFRWS4DBNZ2F6YLDORUXM2LUPGBKK5TBNR2WLJDHNFZXJJDOMFWWLK3UNBZGKYLEL52HS4DFVRZXKYTKMVRXIX3UPFYGLK2HNFZXIQ3PNVWWK3TUUZ2G64DJMNZZDAVEOR4XAZNEM5UXG5FFOZQWY5LFVEYTENZVGYZDEMJUU52HE2LHM5SXFJTDOJSWC5DF>.
You are receiving this email because you were mentioned.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi all,
I have the Dual Coral TPU with Pineberry board and a raspberry pi 5.
The kernel version is
6.6.31+rpt-rpi-v8
and the distro is the Debian Bookworm Lite.Changing the DTS of
msi-parent
ofpcie@11000
from0x027
to0x66
or0x67
did not work for me.I need indeed to change it to
0x6e
, which is the value on phandle, to make it works.Thanks for this discussion!