3

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

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Spacefish
  • 305
  • 4
  • 11

2 Answers2

3

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

David Grayson
  • 84,103
  • 24
  • 152
  • 189
  • Thank you. I used a similar solution: I edited the msys2_shell.cmd file in the msys64 directory and uncommented "set MSYS2_PATH_TYPE=inherit". The path to the particular .exe was set in the windows path directory. I don't know if this is a clean solution but it worked for me. – Spacefish May 21 '19 at 21:32
  • Could a user with high-enough rep for a 1 character edit please change "argm-non-eabi-gcc" to "arm-non-eabi-gcc" in the above answer? Thanks! – AJM Jul 22 '20 at 13:00
0

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.

David Grayson
  • 84,103
  • 24
  • 152
  • 189