Local toolchain - Installation instructions for Mac, Windows, Linux


#1

Hey everyone!

We’ve created a neat new FAQ that will provide you with step-by-step instructions for installing the Particle toolchain locally on your Mac, Windows, or Linux machine that will allow you to develop, build, and flash firmware without a connection to the Internet!

Please enjoy!

https://docs.particle.io/faq/particle-tools/local-build


#2

Would po-util deserve a mention there? I have been working on it for months now. It automates the installation of tools on Mac and Linux, makes everyday local building, quicker, easier, and more intuitive. It supports multiple source directories (project folders), flashing code to devices over DFU using “magic baud rates” to put devices into DFU mode, and much more.

Its newest features include a full library manager, shortcuts for Particle Dev (AKA Atom), and support for building firmware for Raspberry Pi using Docker.

I know you guys don’t like to mention community made tools in your documentation, and it seems like not everyone is happy with po-util because Windows is an incompatible platform.

I’m not trying to be biased, but I really think that po-util is the optimal tool for building locally, and many users are benefitting from it.

UPDATE:

I have released an edition of po-util that can be installed with Homebrew for users on macOS. It is much easier to install and is much cleaner. It doesn’t rely on bash aliases, it has releases, is more stable and now has a man page.

$ brew tap nrobinson2000/po
$ brew install po
$ po install

#3

A slight correction is necessary for the Mac tool chain installation docs because of a pathing error.
If you enter the command listed in the installation docs “Download the gcc-arm toolchain….”

It moves the downloaded toolchain to /usr/local/gcc-arm, with the resultant directory structure below:

This cause the pathing to fail using the recommended path export below.

Checking the arm version fails with:
"-bash: /usr/local/gcc-arm/bin/arm-none-eabi-gcc: No such file or directory"

Should remove directory level “gcc-arm/gcc-arm-none-eabi-4_9-2015q3” to fix this so we get the following.


#4

The instructions for the Mac work as shown in the FAQ. If the destination directory exists prior to the mv command you will get what @rvinci showed as far as directory nesting. If the destination does not exist prior to the mv command, it should move the directory and rename the directory to gcc-arm and all should be well.

This is a great help to have the ability to see all the things being compiled/pulled together.

EDIT Alternatively, you can do the following equivalent commands:

sudo mv Downloads/gcc-arm-none-eabi-4_9-2015q3 /usr/local/
cd /usr/local
sudo mv gcc-arm-none-eabi-4_9-2015q3 gcc-arm

If you want to be really safe about the mv, add the -i option for interactive.
This will inform you of a potential conflict before the move is actually done.

sudo mv -i Downloads/gcc-arm-none-eabi-4_9-2015q3 /usr/local/
cd /usr/local
sudo mv -i gcc-arm-none-eabi-4_9-2015q3 gcc-arm

#5

Or you know you could just take the logical route and install it with homebrew:

$ brew tap PX4/homebrew-px4
$ brew update
$ brew install gcc-arm-none-eabi-49