Setup Toolchain for Mac OS from Scratch¶
Package Manager¶
To set up the toolchain from scratch, rather than downloading a pre-compiled toolchain, you will need to install either the MacPorts or Homebrew package manager.
MacPorts needs a full XCode installation, while Homebrew only needs XCode command line tools.
See Customized Setup of Toolchain section for some of the reasons why installing the toolchain from scratch may be necessary.
Install Prerequisites¶
install pip:
install pyserial:
install CMake & Ninja build:
If you have Homebrew, you can run:
If you have MacPorts, you can run:
Compile the Toolchain from Source¶
Install dependencies:
Create a case-sensitive filesystem image:
Mount it:
Create a symlink to your work directory:
Go into the newly created directory:
Download crosstool-NG
and build it:
Build the toolchain:
Toolchain will be built in ~/esp/ctng-volume/crosstool-NG/builds/xtensa-esp32s2-elf
. To use it, you need to add ~/esp/ctng-volume/crosstool-NG/builds/xtensa-esp32s2-elf/bin
to PATH
environment variable.
Next Steps¶
To carry on with development environment setup, proceed to Step 2. Get ESP-IDF.