Keil Logo

GCC: Using a GNU GCC Compiler Toolchain in the IDE


Information in this article applies to:

  • GNU C Compiler for ARM All Versions
  • µVision V3.21 and Later

QUESTION

Does the µVision IDE support the GNU toolchain? Is there a way to select a different version of a GNU ARM toolchain? What are the steps required?

When I try to translate with the some GNU toolchains I get the following error messages:

--- Error: can't execute 'as'
--- Error: can't execute 'gcc'

What causes this error?

ANSWER

There have been many different variants of the GCC compiler for ARM devices. Modern versions of Keil still support the GCC compiler, but now uses the GNU Arm Embedded Toolchain. To use this toolchain with Keil, do the following.

  1. Download the GNU Arm Embedded Toolchain from the Arm Developer website.
  2. Follow these steps to configure a Keil Project to use the GNU Arm Embedded Toolchain.
  3. To debug a project that uses the GCC toolchain, there is an extra step needed. See µVision DEBUGGER: SOURCE LEVEL DEBUGGING WITH GNU ARM.

Note: As an alternative to use the GCC toolchain, the ARM compilers support some GCC extensions, and have comparability with GCC.

ANSWER FOR µVISION VERSIONS 3.21 to 4.00

To use GNU toolchain variants, µVision V3.21 allows you to specify a GNU-Tool-Prefix. If this parameter is not configured properly, you may get the error message shown above.

To select the GNU toolchain open the dialog Project - Components, Environment, Books - Folders/Extensions.

Use GNU Tools selects the GNU development tools for a project. The setting Cygnus Folder specifies the path to the GNU installation folder. The GNU-Tool-Prefix allows you to use GNU toolchain variants.

Examples for the various GNU versions:

GNU V3.22 with uclib:

  • GNU-Tool-Prefix: arm-uclibc-
  • Cygnus Folder: C:\Cygnus

CodeSourcery G++ with new-lib:

  • GNU-Tool-Prefix: arm-none-eabi-
  • Cygnus Folder: C:\Program Files\CodeSourcery\Sourcery G++\

GNUARM V4 with standard library:

  • GNU-Tool-Prefix: arm-elf-
  • Cygnus Folder: C:\Program Files\GNUARM\

MORE INFORMATION

SEE ALSO

FORUM THREADS

The following Discussion Forum threads may provide information related to this topic.

Last Reviewed: Thursday, August 9, 2018


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.