Setup Raspberry pi Pico

I've read the setup instructions for this sample project: swift-embedded-examples/pico-blink-sdk/README.md at main · apple/swift-embedded-examples · GitHub

At the moment I don't fully understand how this will work on MacOS. Do I actually need the Arm Embedded Toolchain or can I just install the Swift Toolchain?

This is my first time working with a microcontroller. Does anyone have any tips for me on how to set it up on MacOS to run the example project?

For that particular example (the pico-blink-sdk) you require both a swift toolchain from the development snapshot and the pico sdk. Those are enough to build that example (no need to download the Arm Embedded Toolchain).

1 Like

Thank you for your response. In this case I don’t need to set all of these environment variables?

$ cd pico-blink-sdk
$ export TOOLCHAINS='<toolchain-name>'
$ export PICO_BOARD=pico
$ export PICO_SDK_PATH='<path-to-your-pico-sdk>'
$ export PICO_TOOLCHAIN_PATH='<path-to-the-arm-toolchain>'
$ cmake -B build -G Ninja .
$ cmake --build build

You do need to set all of these. Are you hitting a particular failure? If yes, can you post the error message you're getting?

1 Like

In this case I also need the arm-toolchain?

Yes, because the ARM toolchain provides the C/C++ compiler, the linker, and other tools. The "pico-blink-sdk" sample relies on C/C++ source code, libraries and linking processes from the Pico SDK, and that's what the ARM toolchain is needed for. Without it it would be technically possible to compile the Swift source code, but you wouldn't be able to produce a full firmware result without the other parts.

1 Like

And the CMake is also a compiler?