Arm Toolchain#

A toolchain is a set of programming tools, like a compiler, linker, debugger, etc., that facilitate development of programs written for the same or different hardware. The Raspberry Pi Pico has RP2040 onboard which is a microcontroller based on Arm Cortex M0+ architecture. The detailed steps for installing GNU Embedded Toolchain for Arm in each operating system are provided below. Note that CMake will also be installed along with the Arm toolchain. CMake will take care of calling all the necessary programs, from the toolchain, to generate a binary file that will run on the microcontroller.

MacOS#

  • Open the terminal.

    1

    2

    3

    4

  • Check if your MacBook has Apple chip or Intel chip.

    1

    2

    3

  • If your MacBook has Apple chip then enter following commands in the terminal, continue to the next step otherwise.

    $ /usr/sbin/softwareupdate --install-rosetta --agree-to-license
    
  • Install ‘Xcode Command Line Tools’ and ‘Homebrew’ by entering following command in the terminal. The system may ask you to type your password and press ↩ Return at some point.

    $ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
    
  • Once ‘Homebrew’ is installed, it may ask you to perform some extra steps. Generally, these steps correspond to adding ‘Homebrew’ to the PATH environment. Following images show the steps I was asked to perform.

    1

    2

    3

  • Close the terminal and reopen it.

  • Enter following commands in the terminal app to install the ‘Embedded Toolchain for Arm’ and ‘CMake’.

    $ brew install cmake
    $ brew install gcc-arm-embedded
    
  • Restart your MacBook.

Windows/Linux#

  • Open Ubuntu terminal.

    1

    2

    3

    4

  • Enter following commands to install the ‘Arm Toolchain’ and ‘CMake’. Note that the $ symbol, also called a ‘Prompt’, represents start of the line, so don’t type it. The system may ask you to type your password and press ⏎ Enter at some point.

    $ sudo apt update
    $ sudo apt upgrade
    $ sudo apt install cmake gcc-arm-none-eabi libnewlib-arm-none-eabi build-essential