Search code examples
c++armmsys2gnu-toolchainxpack

Installing and using arm-none-eabi-gcc on MSYS2


I am trying to build an embedded program using "make all" with the GNU ARM toolchain, but it is not working yet.

I installed it with xpm according to this website with the xpm installer:

https://gnu-mcu-eclipse.github.io/toolchain/arm/install/

Now when I try to build my program using "make all", I get following error:

$ make all

Collecting dependencies for: Bsp/....cpp /bin/sh: Zeile 1: arm-none-eabi-gcc: Command not found- ...

The file is of course located in the xpack location:

C:\Users\\AppData\Roaming\xPacks

while the normal mingw64 binaries are in another location. How exactly can I use arm-none-eabi-gcc now or how can I edit the PATH variables of msys2 to use the xpm packages?

There is also a similar toolchain here:

https://launchpad.net/~team-gcc-arm-embedded/+archive/ubuntu/ppa

But I guess I can not install this without something like Linux subsystem...


Solution

  • If you downloaded arm-none-eabi-gcc separately from MSYS2, then after starting your MSYS2 shell, you need to add whatever directory contains arm-none-eabi-gcc.exe to your PATH environment variable by running a command like this:

    export PATH=$PATH:/c/Users/path/to/bindir/
    

    You can test it by running arm-none-eabi-gcc in the shell with no arguments, and also running which arm-none-eabi-gcc.

    The main place to download such a toolchain is here:

    https://developer.arm.com/Tools%20and%20Software/GNU%20Toolchain