Adafruit Feather M0: Can't find SPI.h, then can't find Adafruit_ZeroDMA.h

I’ve been working on a project using the Adafruit Feather 32u4 and outgrew it.
So I decided to switch the project over to the Adafruit Feather M0.
Unfortunately, the build then failed with
atal error: SPI.h: No such file or directory

So I added SPI to lib_deps in platformio.ini.
The build now fails with fatal error: Adafruit_ZeroDMA.h: No such file or directory

Adding Adafruit_ZeroDMA to lib_deps results in Warning! Could not find the package with 'Adafruit_ZeroDMA' requirements for your system 'darwin_x86_64'
First, what do I need to add to lib_deps to build for the Feather M0?
Second, why does it think that my platform is darwin_x86_64?

Are you running on a Mac? Darwin is Mac OS (kernel).

What’s your full platformio.ini?

Edit:

That’s wrong, per

the library name is as seen above.

Your lib_deps should look something like

lib_deps =
   SPI
   adafruit/Adafruit Zero DMA Library @ ^1.0.8
1 Like

First, thanks for the fast reply. :slight_smile:

  • Yep. I’m on a Mac. What does that have to do with the build?

  • Ah. Using the library name you supplied works! Thanks.
    How/where do I find the correct names for these libraries?

When you wrote lib_deps = Adafruit_ZeroDMA it tries to find this ‘package’ (a library is also a package in PlatformIO terms) but couldn’t find it, so in the error message it outputted the platform you’re on (e.g. Windows x86_64, Darwin, Linux, …) as side information. Packages can also be e.g. compilers / toolchains, and then the packages have to declare the correct platform, since you can’t run a Windows binary on Mac fo example. This is unimportant for libraries, which don’t depend on the host computer’s platform.

Right at the top bar there’s

grafik

the library registry. Also PIO gives you a direct search link after the compiler error message…

grafik

…which nicely leads you to the library search page…

…which directly feeds you how to install the library.

1 Like

Got it. Thanks very much.
Searching for the missing header did, indeed, show me the correct package.