BPI M4 and google coral M.2

Hello,

I’m trying to install drivers for the google coral M2 on banana pi m4. I’m using the BPI-M4/BPI-W2 Ubuntu Server 16.04 image from the bpi website. Following the get started guide from google (https://coral.ai/docs/m2/get-started), it looks like the installation script from google is looking for kernel headers

any idea how I can manage this problem? I’m quite new to linux but I like to learn :slight_smile:
thanks

Which kernel have you running (run “uname -a” in your system)?

Maybe you can download sources for this kernel from github to /usr/src/linux

Hi Frank, thanks for your help. The kernel is 4.9.119-BPI-M4-Kernel and I think I can download it from here https://github.com/BPI-SINOVOIP/BPI-M4-bsp. Browsing through the files I cannot find the headers, to get them should I compile it? Never did that but I hope I can find some guide

headers are the source of linux kernel…

I think you should download content of linux-rtk to the folder i mentioned above and try again

Maybe foldername have to be

/usr/src/linux-headers-$(uname -r)

But structure imho is normal linux-source

just tried with either linux or linux-header-etc but no luck sadly :frowning: the error is the same, kernel source for this kernel does not seem to be installed

something like this does not work? Do not try to create a folder with $(…) it is evaluated to your kernel version

git clone https://github.com/BPI-SINOVOIP/BPI-M4-bsp
ln -s $(pwd)/BPI-M4-bsp/linux-rtk /usr/src/linux-headers-$(uname -r)

Can you post the script containing the error-message? Then i can look for condition which brings up the message

yup I tried to git clone and made the symbolic link to /usr/src I don’t know how to locate the installing script, maybe inside the .deb package? I tried to decompress it but I could not find any cue, nothing in pre/post scriptsgasket-dkms_1.0-9_all.deb (43,6 KB)

It looks like the package have installed linux headers for 4.4.111-snapdragon…just try to compare with your github-folder…else i have no more idea…

Maybe the source/build-symlink in /lib/modules/$(uname -r)

Hi Frank, github content files are very similar with snapdragon stuff. About modules I’ve already source/build inside the correct kernel folder. I’m writing with google coral support, If I can find a solution I’ll let you know. For the moment thank you very much for your help :slight_smile: Do you think would be a possibility recompile the kernel with coral module?

when I try to load the coral drivers (gasket, apex) I get these errors:

[ 418.976141] gasket: module_layout: kernel tainted.
[ 418.976170] Disabling lock debugging due to kernel taint
[ 423.373659] apex 0000:01:00.0: can’t enable device: BAR 0 [mem 0x00000000-0x00003fff 64bit pref] not claimed
[ 423.373699] apex 0000:01:00.0: BAR 2: no space for [mem size 0x00100000 64bit pref]
[ 423.373712] apex 0000:01:00.0: BAR 2: failed to assign [mem size 0x00100000 64bit pref]
[ 423.373730] apex 0000:01:00.0: BAR 0: assigned [mem 0x98064000-0x98067fff 64bit pref]
[ 423.374483] apex 0000:01:00.0: enabling device (0000 -> 0002)
[ 423.375621] apex 0000:01:00.0: Cannot get BAR2 base address
[ 423.375963] apex 0000:01:00.0: error adding gasket device
[ 423.376161] apex: probe of 0000:01:00.0 failed with error -12

any idea if is possible to fix it? thanks

I have the M.2 Dual Edge TPU. inserted in the M.2 slot.

The “2020-05-18-ubuntu-18.04-mate-desktop-bpi-M4-aarch64-sd-emmc.img” (posted on this forum ) img running on an inserted SD gets me to a point where the TPU is detected via “lspci -x | grep 089a”

There are no errors during install but I don’t see “ls /dev/apex_0” when following the listed coral.ai steps

UPDATE

No luck whatsoever!

@sinovoip could you please look into Coral M.2 TPU’s compatibility on your BPI-M4. You’ re product is one of the few SBCs that have an M.2 E key. If you’ re team can get the Coral M.2 TPU running we’ll use and promote your boards in our project.