Skip to content

Instantly share code, notes, and snippets.

@dmccreary
Last active November 6, 2022 15:42
Show Gist options
  • Save dmccreary/00e706236fedd93cd8c3981b00f70b04 to your computer and use it in GitHub Desktop.
Save dmccreary/00e706236fedd93cd8c3981b00f70b04 to your computer and use it in GitHub Desktop.
Pico Mac SDK

How to Install the Raspberry Pi Pico SDK on a Mac

I wanted to test FFT on the Raspberry Pi Pico so I could create a real-time spectrum analizer using an LED strip. I have used MicroPython and Thonny for everything up until now. But FFT is only implemented in C for performance reasons. So to get started I had to install the Raspberry Pi Pico SDK on my Mac running Montery.

The Raspbery Pi Pico SDK code is here:

https://github.com/raspberrypi/pico-sdk

I installed it but the examples did not run because brew didn't support the EABI GCC

Brew install for the arm gcc did not work

brew install gcc-arm-none-eabi 
``

```sh
which arm-none-eabi-cpp
/opt/local/bin/arm-none-eabi-cpp

The "eabi" is for Embedded Application Binary Interface. The default ARM tool chain application binary interface is the Embedded Application Binary Interface (EABI). It defines the conventions for files, data types, register mapping, stack frame and parameter passing rules. The EABI is commonly used on ARM and PowerPC CPUs.

From: https://formulae.brew.sh/cask/gcc-arm-embedded

brew install --cask gcc-arm-embedded

But the brew documentation didn't list the eabi version. But Mac Ports did:

sudo port install arm-none-eabi-gcc

https://www.macports.org/install.php

$ which port /opt/local/bin/port

cmake ..
PICO_SDK_PATH is /Users/dan/Documents/ws/pico-sdk
PICO platform is rp2040.
-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
-- The ASM compiler identification is unknown
-- Found assembler: /usr/local/bin/arm-none-eabi-gcc
CMake Error at CMakeLists.txt:6 (project):
  The CMAKE_C_COMPILER:

    /usr/local/bin/arm-none-eabi-gcc

  is not a full path to an existing compiler tool.

  Tell CMake where to find the compiler by setting either the environment
  variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
  the compiler, or to the compiler name if it is in the PATH.


CMake Error at CMakeLists.txt:6 (project):
  The CMAKE_CXX_COMPILER:

    /usr/local/bin/arm-none-eabi-g++

  is not a full path to an existing compiler tool.

  Tell CMake where to find the compiler by setting either the environment
  variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
  to the compiler, or to the compiler name if it is in the PATH.

https://developer.arm.com/downloads/-/gnu-rm

https://developer.arm.com/-/media/Files/downloads/gnu-rm/10.3-2021.10/gcc-arm-none-eabi-10.3-2021.10-mac.pkg?rev=b382d51ec8d34c3fa421cf57ce97f146&hash=86689FEB39DA7A381FF78A2E70F7ABCE

Creating symbolic links

ln -s /opt/local/bin/arm-none-eabi-gcc /usr/local/bin
ln -s /opt/local/bin/arm-none-eabi-* /usr/local/bin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment