Can not compile: arm-none-eabi-g++: command not found

Hello,

i am new to platformio, due i want to compile Marlin FW I installed PlatformIO in Atom and VistualStudio (tested both) on my Mac (MacOS Mojave)

Everyting worked fine but until i want to compile:

Processing LPC1768 (platform: https://github.com/p3p/pio-nxplpc-arduino-lpc176x/archive/master.zip; framework:
 arduino; board: nxp_lpc1768)
--------------------------------------------------------------------------------
PackageManager: Installing toolchain-gccarmnoneeabi @ >=1.80201.181221
Downloading...
Unpacking...
toolchain-gccarmnoneeabi @ 1.80201.181221 has been successfully installed!
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/nxplpc-arduino-lpc176x/nxp_lpc1768.html
PLATFORM: NXP Arduino LPC176x 0.0.2 > NXP LPC1768
HARDWARE: LPC1768 100MHz, 31.80KB RAM, 464KB Flash
DEBUG: Current (cmsis-dap) On-board (cmsis-dap) External (blackmagic, jlink)
PACKAGES: framework-arduino-lpc176x 0.1.3
Converting Marlin.ino
sh: arm-none-eabi-g++: command not found
*** Error 127
AssertionError: :
  File "/Users/frank/.platformio/penv/lib/python2.7/site-packages/platformio/builder/main.py", line 126:
    env.SConscript("$BUILD_SCRIPT")
  File "/Users/frank/.platform

I think the issue is that ā€œarm-none-eabi-g++ā€ can not be found, but this is a part of toolchain-gccarmnoneeabiā€¦ the installation suceeded and i can see that package in the folter ./platformio/packages/toolchain-gccarmnoneeabi

I already added that path to my system Path environment, without sucess.

Nay hints to make this working? Please not that i am new to platformio :wink:

Thank you in advanced

What is pio --version?

Hello the PIO Version is 4.0.3

You should try the most recent version first. Open a PIO terminal and to a pio upgrade --dev to get on 4.1.0a1, then restart VSCode, clean and recompile the project. Does the error persist?

i upgraded nowā€¦

i am using atom right nowā€¦ i clicked on clean and then buildā€¦ the terminal appears only for some milliseconds and closes.

i looked into the documentation and startet in the terminal ā€œplatformio run --target cleanā€
After that i got the same error :frowning:

What is the content of your Marlin.ino file? If itā€™s like this with only comments and no actual code, please delete the file. Maybe there is an error when attempting to convert the .ino to a .cpp file if there is no actual code content.

I am having the same problem. Removing the Marlin.ino has not solved my problem. Now Im getting something like this multiple times

Compiling .pio/build/LPC1768/src/src/HAL/HAL_LPC1768/DebugMonitor.cpp.o
sh: arm-none-eabi-g++: command not found

and then farther down Iā€™m getting

*** [.pio/build/LPC1768/src/src/HAL/HAL_LPC1768/DebugMonitor.cpp.o] Error 127

Does it matter that it installs toolchain-gccarmnoneeabi
every time it I try to compile?

ā€¦ yes probably, might be a symptom of it not being able to handle the compiler toolchain package and not being able to use it afterwards.

Well strictly put this is a 3rd party platform outside of PlatformIOā€™s normal ecosystem and itā€™s also pointing to a custom release of the compiler

But I think Iā€™ve figured out the problem. You see if you actually download the compiler from the link above, itā€™s for Linux x64. Extract it and look at arm-none-eabi-g++.

>file "arm-none-eabi-g++"
arm-none-eabi-g++; ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 3.2.0, from '8@%rdi 8@%rsi', stripped

Of course this wonā€™t work an Apple machine as Iā€™ll infer from the appley-looking path

@JonathanFStewart, are you also using an Apple machine?

I donā€™t really know why a custom platform needed to be created for this, there already is the GitHub - platformio/platform-nxplpc: NXP LPC: development platform for PlatformIO platform for NXP chips. Why not make an addition to this repository?

You could try and get the compiler for Apple/Windows by overriding the package, that is, add to the environment in the platformio.ini the lines

platform_packages = toolchain-gccarmnoneeabi@https://dl.bintray.com/platformio/dl-packages/toolchain-gccarmnoneeabi-darwin_x86_64-1.80201.181220.tar.gz

(Windows: Your Gateway to Embedded Software Development Excellence Ā· PlatformIO), though Iā€™m unsure whether it will accept HTTP links to archives, examples only show git repos are package names.

You may also attempt to just download the file above, remove the contents of the toolchain-gccarmnoneabi folder and replace it with the contents of the archive above.

Where is the exact marlin branch and platformio.ini you are using for reproduction?

@maxgerhardt yes I am also on an Apple machine. I have installed the arm tool chain and can run it from the terminal/CL but I canā€™t seem to get platform IO to recognize its already installed and just to use it.

The marlin branch I am using is here

the Platformio.ini file is also there, The only change I am making is changing line 21 from

default_envs = megaatmega2560

to

default_envs = LPC1768

to make it compile for the board I am using

PlatformIO will not use installed compilers from the commandline, as it is supposed to use specific versions of compilers sourced from the packages/toolchain-armgccnoneeabi folders.

In addition to what is said above you could also try an easier thing: Remove the toolchain-armgccnoneeabi folder, go to your ~/.platformio/platforms/nxplpc-arduino-lpc176x folder, edit the manifest.json (file shown above) and replace the url link with the link for darwin x86_64 from the post below. It should attempt to redownload the compiler from PlatformIO and use it.

That would still leave the question open on why a special compiler release had to be madeā€¦ If it not works, the original author of the repository should be asked what changed.

I think I figured out what the problem is/was. I had to open Xcode and accept the license agreement :weary: I remember this being a problem for other Arduino stuff in the past. Its working now though. Thanks @maxgerhardt

Well actually that of course wonā€™t work because it doesnā€™t reference the manifest.json on disk but on the web.

You can edit your ~/.platformio/platforms/nxplpc-arduino-lpc176x/platform.json and replace the https://raw.githubusercontent.com/p3p/pio-nxplpc-arduino-lpc176x/master/manifest.json line with https://gist.githubusercontent.com/maxgerhardt/632204307236b865c42b36ce83c8cc22/raw/77bc71ad307b716d34ae74fb78d24c4847367a56/manifest.json which has the right URL for darwin in it.

Well good that itā€™s working but this is not really the proper way to solve it. It downloads a package which is meant for Linux, tries to execute arm-none-eabi-g++, canā€™t execute the actually downloaded package but magically picks one youā€™ve installed in the shell (I didnā€™t really think this would work actually o_O). So maybe try that above for a cleaner solution.

2 Likes

THHHHAAAAANNNNNKKK YOU!!! The manual package helped!

I tried the solution of Max. I donā€™t get the error directly now but after 8 minutes of loading I get the error:

PackageManager: Installing toolchain-gccarmnoneeabi @ >=1.80201.181221
Downloadingā€¦
Unpackingā€¦
Warning! Package Mirror: Package version 1.80201.181220 doesnā€™t satisfy requirements >=1.80201.181221
Error: Could not install ā€˜toolchain-gccarmnoneeabiā€™ with version requirements ā€˜>=1.80201.181221ā€™ for your system ā€˜darwin_x86_64ā€™.
Please try this solution ā†’ Redirecting...

I changed 1.80201.181221 in the JSON file in 1.80201.181220 and now it works. Thanks Max!

Hi,
I also have this problem. Not be able to compile the ā€œdefault_envs = LPC1768ā€
During the compilation I`m receiving these errors in Atom:

Marlin\src\lcd\extensible_ui\lib\ftdi_eve_touch_ui\ftdi_eve_lib\extended\unicodeā€¦/ā€¦/ā€¦/ā€¦/ā€¦/ā€¦/ā€¦/inc/ā€¦/HAL/./HAL_LPC1768/MarlinSerial.h:27:10: fatal error: ā€¦/ā€¦/inc/MarlinConfigPre.h: No such file or directory.
And:
*** [.pio\build\LPC1768\src\src\lcd\extensible_ui\lib\ftdi_eve_touch_ui\ftdi_eve_lib\extended\unicode\font_bitmaps.cpp.o] Error 1

DUE_debug IGNORED
LPC1768 FAILED 00:00:09.731
LPC1769 IGNORED

The only things i changes was the LPC1768 in the Platformio.ini.
and the
#define MOTHERBOARD BOARD_BIGTREE_SKR_V1_3 in the Configuration.h

Has someone found a solution for this?

Greetings
Palermo

Have the solutions above not helped? Which platform are you on?

I`m Running Windows 10,
I replaced the link as you suggested in folder .platformio\platforms\nxplpc-arduino-lpc176x

ā€œversionā€: ā€œ0.1.1ā€,
ā€œpackageRepositoriesā€: [
ā€œhttps://gist.githubusercontent.com/maxgerhardt/632204307236b865c42b36ce83c8cc22/raw/77bc71ad307b716d34ae74fb78d24c4847367a56/manifest.jsonā€,

This is how it look right now.
My feeling is that I`m doing something little wrong

Hm this still references darwin aka Mac OS. Out of my head I canā€™t remember why or how exactly it worked. But have you tried reverting all your local changes and added

platform_packages = toolchain-gccarmnoneeabi@http://dl.platformio.org/packages/toolchain-gccarmnoneeabi-windows_x86-1.80201.190214.tar.gz

in the target environment of the platformio.ini?

What I need to do is this?:
[env:LPC1769]
platform = toolchain-gccarmnoneeabi@http://dl.platformio.org/packages/toolchain-gccarmnoneeabi-windows_x86-1.80201.190214.tar.gz
board = nxp_lpc1769
build_flags = -DU8G_HAL_LINKS -IMarlin/src/HAL/HAL_LPC1768/include -IMarlin/src/HAL/HAL_LPC1768/u8g ${common.build_flags}

Change the platform with your suggested link in platformio.ini?

No not the platform, just keep everything normal and add the above platform_packages ni the environment instead.