4 years, 8 months ago.

configure ARMC6 in mbed-cli

Installed mbed-cli on Windows 10 using install executable.

I set target: mbed.py target LPC4088

Compiling "mbed-os-example-blinky" using GCC_ARM toolchain completes successfully.

Documentation says that mbed-cli should also work with "-t ARM" (uses ARMC5 or ARMC6 whichever is available). I get:

F:\Users\Chris\Mbed Programs\mbed-os-example-blinky>mbed.py compile --profile debug -t ARM
[mbed] Working path "F:\Users\Chris\Mbed Programs\mbed-os-example-blinky" (program)
------------------------------------------------------------
Warning: We noticed that you are using Arm Compiler 5. We are
deprecating the use of Arm Compiler 5 soon. Please upgrade 
your environment to Arm Compiler 6 which is free to use with
Mbed OS. For more information, please visit 
https://os.mbed.com/docs/mbed-os/latest/tools/index.html
------------------------------------------------------------
Could not find executable for ARMC5.
Currently set search path: No path set
[mbed] ERROR: "C:\Python27\python.exe" returned error.
       Code: 2
       Path: "F:\Users\Chris\Mbed Programs\mbed-os-example-blinky"
       Command: "C:\Python27\python.exe -u F:\Users\Chris\Mbed Programs\mbed-os-example-blinky\mbed-os\tools\make.py -t ARM -m LPC4088 --profile debug --source . --build .\BUILD\LPC4088\ARM-DEBUG"
       Tip: You could retry the last command with "-v" flag for verbose output
---

If I use -t ARMC6 (not wanting to use deprecated compiler!) I get:

F:\Users\Chris\Mbed Programs\mbed-os-example-blinky>mbed.py compile --profile debug -t ARMC6
[mbed] Working path "F:\Users\Chris\Mbed Programs\mbed-os-example-blinky" (program)
Could not find executable for ARMC6.
Currently set search path: No path set
[mbed] ERROR: "C:\Python27\python.exe" returned error.
       Code: 2
       Path: "F:\Users\Chris\Mbed Programs\mbed-os-example-blinky"
       Command: "C:\Python27\python.exe -u F:\Users\Chris\Mbed Programs\mbed-os-example-blinky\mbed-os\tools\make.py -t ARMC6 -m LPC4088 --profile debug --source . --build .\BUILD\LPC4088\ARMC6-DEBUG"
       Tip: You could retry the last command with "-v" flag for verbose output
---

So it seems like the ARMCx compilers aren't installed, yet the docs say these are valid options.

Any hints appreciated.

Chris.

1 Answer

4 years, 8 months ago.

Hello Chris,

The following patch should make it work: Using ARM6 and mbed-cli.

@Zoltan: Thanks for your help. Unfortunately I'm only beginning to get familiar with git & so not at all sure how to use it to pull in the change. Pls forgive the noob questions/observations below...

I tried editing the arm.py file I found in [User]\Mbed Programs\mbed-os-example-blinky\mbed-os\tools\toolchains to match the updated file linked to in the previous question, but with no success from mbed-cli.

I also neglected to say in the my initial question that Mbed Studio compiles the example with ARMC6 with no problems. It's just the mbed-cli that is giving me problems.

Also, I can only find toolchain references within each "mbed-os" subdirectory under the individual projects/examples. Does this mean they all have separate copies of the toolchain (and also the mbed-os library)? I don't seem to find the ARM tooclhain binaries installed anywhere else on my system - is this how it's supposed to be?

posted by Chris Hoffmann 19 Aug 2019

Sorry Chris. Because Evan was happy with Daniel's answer I thought it should work.

  • It seems that the arm.py program was fixed in Mbed OS 5.12.4 so no additional modifications are needed.
  • On MS Windows machine with Mbed Studio installed the ARMC6 toolchain is usually located in the C:\Users\[USER]\AppData\Local\Mbed Studio\mbed-studio-tools\ac6 folder.
  • Taking that into account try to configure mbed-cli as described in Mbed CLI configuration.
  • Yes, normally each project has its own copy of mbed-os folder with all Python tools included. However, it's also possible to share the same mbed-os folder among more projects as explained in Managing multiple Mbed projects. Such approach is for example applied when Building offline with Qt Creator IDE. That saves resources but ones the library has been updated the new revision is used for all new builds.
posted by Zoltan Hudak 19 Aug 2019

Hi Zoltan,

Thanks for your comments, they are very helpful.

I did finally find the ARMC6 binaries in the location you mentioned. By that time, however, I uninstalled mbed-cli. Maybe I will try it again :)

posted by Chris Hoffmann 20 Aug 2019

Hi Zoltan (and anyone else who's interested!) I appreciate your patience...

I reinstalled mbed-cli and correctly (I thought!) configured the ARMC6 compiler from mbed-studio using the following commands:

mbed.py config -G ARMC6_PATH "c:\Users\[username]\appdata\Local\Mbed Studio\mbed-studio-tools\ac6\bin"

mbed.py config -G ARMLMD_LICENSE_PATH "f:\program files (x86)\Mbed Studio\tools-config"

So the output from mbed.py config --list

looks like:

[mbed] Working path "F:\Users\[username]\Mbed Programs\mbed-os-example-blinky" (program) [mbed] Global config: COLOR=on ARMLMD_LICENSE_FILE=f:\Program Files (x86)\Mbed Studio\tools-config TOOLCHAIN=ARM ARMC6_PATH=c:\Users\[username]\appdata\Local\Mbed Studio\mbed-studio-tools\ac6\bin

[mbed] Local config (F:\Users\[username]\Mbed Programs\mbed-os-example-blinky): TOOLCHAIN=ARM TARGET=LPC4088 TARGET_CODE=1060 TARGET_SERIAL=1060000004833F6500000000000000000000000097969902

This led me to the same situation as Evan/Daniel in your original links above, until I made the ARMLMD_LICENSE_PATH an *environment variable* in the CMD console I was using. This seemed to keep the compiler happy until it needed to assemble some mbed-os library code:

Building project mbed-os-example-blinky (LPC4088, ARMC6) Scan: mbed-os-example-blinky Compile [ 1.1%]: main.cpp Compile [ 1.2%]: BusOut.cpp Compile [ 1.3%]: rf_configuration.c Compile [ 1.5%]: AnalogIn.cpp Compile [ 1.6%]: ESP8266.cpp Compile [ 1.7%]: ESP8266Interface.cpp Compile [ 1.9%]: BusIn.cpp Compile [ 2.0%]: BusInOut.cpp Compile [ 2.2%]: except.S [ERROR] Error: A9940E: This variant of Arm Compiler is licensed only for use with Mbed Studio Product: ARM Compiler 6.11 for Mbed Studio Component: ARM Compiler 6.11 Tool: armasm [5d3b3500]

[mbed] ERROR: "C:\Python27\python.exe" returned error. Code: 1 Path: "F:\Users\[username]\Mbed Programs\mbed-os-example-blinky" Command: "C:\Python27\python.exe -u F:\Users\[username]\Mbed Programs\mbed-os-example-blinky\mbed-os\tools\make.py -t ARM -m LPC4088 --profile debug --source . --build .\BUILD\LPC4088\ARM-DEBUG" Tip: You could retry the last command with "-v" flag for verbose output ---

Is there a license variable required for the assembler too?

posted by Chris Hoffmann 20 Aug 2019

Hello Chris,

Try to create a ARMLMD_LICENSE_FILE system/environment variable and set it to ...\Mbed Studio\tools-config\ac6-license.dat. The full path depends on Mbed Studio's installation path on your system.

posted by Zoltan Hudak 20 Aug 2019

Hi Zoltan,

Ahh actually that's what I did in order to get the compiler to work at all (I used the output from mbed.py config --list as an example but it doesn't show the license file even if that's what's configured).

The environment variable is exactly per your suggestion: F:\Users\[Username]>set arm ARMLMD_LICENSE_FILE=f:\Program Files (x86)\Mbed Studio\tools-config\ac6-license.dat

I did notice that the .profile-??? files under [project]\Build\[Target]\ARM-XXX for mbed-studio contain an extra 'flags' directive: "--ide=mbed", which is missing from mbed-cli versions and thought this might be related. But these files are created by the build process so I don't know where this can be configured (or even if it will make a difference?).

posted by Chris Hoffmann 20 Aug 2019