Spacefish
Spacefish

Reputation: 323

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...

Upvotes: 4

Views: 9432

Answers (2)

David Grayson
David Grayson

Reputation: 87386

You can install arm-none-eabi-gcc on MSYS2 using its package manager. Start MSYS2 using mingw64.exe (or the equivalent shortcut) and then install the toolchain by running:

pacman -S mingw-w64-x86_64-arm-none-eabi-gcc

Now arm-none-eabi-gcc should be on your PATH without any additional work.

Upvotes: 2

David Grayson
David Grayson

Reputation: 87386

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

Upvotes: 3

Related Questions