The ARM Cortex-M processors are a very popular family of 32-bit RISC microcontrollers designed and licensed by ARM Holdings. They are intended for embedded applications requiring high performance and low power consumption. The Cortex-M processors utilize the ARMv7-M architecture and include features like a Nested Vectored Interrupt Controller, SysTick timer, and optional Floating Point Unit (FPU). Some of the most commonly used Cortex-M processors include the Cortex-M0, Cortex-M3, Cortex-M4, and Cortex-M7.
As with any microcontroller, software needs to be compiled specifically for the target Cortex-M processor. There are several compiler options available from both ARM and third parties. Some of the most popular compilers used for the ARM Cortex-M processors include:
ARM Compiler
ARM has their own proprietary compiler called ARM Compiler. It comes in different editions including a free version called ARM Compiler 6. This compiler fully supports all ARM processors including the Cortex-M series. The paid editions add additional optimizations and features. ARM Compiler generates very efficient code optimized specifically for ARM cores. It also integrates nicely into the ARM Development Studio IDE.
GNU Arm Embedded Toolchain
The GNU Arm Embedded Toolchain is a free, open source toolchain maintained by Arm Limited. It includes the Arm GCC compiler, Arm G++ compiler, Assembler, Linker, Debugger and a set of libraries and headers covering C, C++, and assembly. The GNU Arm Embedded toolchain supports all 32-bit Arm Cortex processors including the Cortex-M series. It generates reasonably optimized code. The source code is available if developers want to customize or extend it.
IAR Embedded Workbench
IAR Embedded Workbench is a very popular commercial IDE and toolchain used for embedded development. It is known for its excellent compiler optimizations and code efficiency. The IAR C/C++ compiler fully supports all Arm Cortex-M cores with specific optimizations to generate compact, fast code. It offers multiple compiler optimization levels to choose from depending on if code size or speed is more important for a project. IAR also integrates debugging, code analysis tools, and editors into a complete IDE package.
KEIL MDK-ARM
KEIL MDK-ARM is a widely used commercial toolchain for Arm processors from Arm subsidiary Keil. It features the highly optimized Keil C compiler combined with the Keil μVision IDE. The C compiler supports all Cortex-M processors and includes an extensive library of runtime and kernel functions along with silicon support. The μVision IDE provides an editor, source-level debugger, project manager, and compiler. There are various bundles and editions available depending on needs.
Texas Instruments Code Composer Studio
Code Composer Studio is an integrated development environment from Texas Instruments specifically designed for their microcontrollers. It includes the TICC compiler toolchain with advanced optimizations for TMS320 and Sitara processors. For Arm, it utilizes GCC or the IAR compiler. CCS offers full debugging capabilities and an Eclipse-based IDE. It supports all MSP430, C2000, and Arm Cortex-M based MCUs from TI. A limited free version is available.
SEGGER Embedded Studio
SEGGER Embedded Studio is a streamlined, cross-platform C/C++ IDE designed for embedded systems. It features SEGGER’s highly optimized Flasher ARM compiler that produces very compact code. Additional tools include the J-Link debug probe and performance analyzer. Embedded Studio supports all Cortex-M processors and integrates debugging, editing, compiling and flashing capabilities into one IDE.
atollic TrueSTUDIO
TrueSTUDIO is an Eclipse-based toolchain and IDE from STMicroelectronics designed for their STM32 Arm Cortex-M microcontrollers. It utilizes the GCC compiler combined with advanced editors, code generation, and debugging tools. TrueSTUDIO also allows using 3rd party compilers like ARM, IAR or KEIL toolchains. The IDE features project management, editors, code completion, and chip configurators.
Silicon Labs Simplicity Studio
Simplicity Studio from Silicon Labs is an IDE designed specifically for their EFM32 and EFR32 Arm Cortex-M based microcontrollers. It includes the Silicon Labs C/C++ Compiler, GCC compiler, IDE, and debugger optimized for their wireless and IoT edge devices. Simplicity Studio is based on Eclipse and features configurable peripherals, energy profiling, and OTA updates.
Renesas e2 studio
Renesas e2 studio is an Eclipse-based IDE for Renesas microcontrollers including the RL78, RX, and Synergy S7 series. It features the Renesas CC-RL/RX compiler, runtime libraries, emulators, and other tools specifically optimized for their MCUs. The IDE includes editors, compilers, debuggers, and project configuration tools with support for C, C++, and assembly. Free versions are available with limited features.
Microchip MPLAB X IDE
MPLAB X is the IDE from Microchip for their PIC and AVR microcontrollers. For Arm, it supports their SAM Cortex-M based MCUs using the GCC compiler. MPLAB X features editors, code configurators, compilers, debuggers and more in an Eclipse-based IDE. It can be used with the MPLAB C Compiler or the free, open source XC Compilers. MPLAB Code Configurators speed up software development.
Arduino IDE
The Arduino Software IDE is designed for Arduino boards using AVR, SAM, and ESP microcontrollers. It includes the GCC compiler and libraries for Arm Cortex-M processors on Arduino boards like the MKRZero or Nano 33 BLE. The Arduino IDE is lightweight and focused primarily on compiling, uploading code and serial monitoring. It supports C/C++ using Arduino functions and libraries.
Overall, there are many capable compilers available for the ARM Cortex-M processors from both ARM and third parties. Both commercial and free options exist. The choice comes down to your specific needs and preferences like cost, optimizations, code size, IDE integration and more. The most popular commercial compilers are ARM Compiler, IAR and KEIL toolchains. For open source, GNU GCC is very commonly used. The IDE and available libraries are also important factors for productivity and ease-of-use.
In summary, for ARM Cortex-M microcontrollers, developers generally utilize compilers offered by the microcontroller vendor or an third-party compiler like GNU GCC, ARM Compiler, IAR or KEIL, integrated into a compatible IDE.