Arm Cortex-M: Difference between revisions

m Kai moved page ARM to Arm Cortex-M without leaving a redirect: This page informs only about the Cortex-M microcontroller cores.
No edit summary
Line 14: Line 14:
</pre>
</pre>
<br />
<br />
==== CMSIS ====
Arm specifies a standard C interface for programming Cortex-M processors, the '''C'''ortex-'''M''' '''S'''tandard '''I'''nterface (CMSIS). The Arm licensees are strongly encouraged to provide the CMSIS functions as part of their microcontroller programming SDK. Third-party software libraries usually rely on CMSIS availability.
===== Intrinsic Functions =====
{|
|+ style="text-align:left" | Functions that generate instructions not provided by ISO/IEC C
! Instruction
! CMSIS intrinsic function
|-
| CPSIE I || void __enable_irq(void)
|-
| CPSID I || void __disable_irq(void)
|-
| ISB || void __ISB(void)
|-
| DSB || void __DSB(void)
|-
| DMB || void __DMB(void)
|-
| NOP || void __NOP(void)
|-
| REV || uint32_t __REV(uint32_t int value)
|-
| REV16 || uint32_t __REV16(uint32_t int value)
|-
| REVSH || uint32_t __REVSH(uint32_t int value)
|-
| SEV || void __SEV(void)
|-
| WFE || void __WFE(void)
|-
| WFI || void __WFI(void)
|}
{|
|+ style="text-align:left" | Functions for accessing special registers
! Register
! CMSIS read function
! CMSIS write function
|-
| PRIMASK || uint32_t __get_PRIMASK (void) || void __set_PRIMASK (uint32_t value)
|-
| CONTROL || uint32_t __get_CONTROL (void) || void __set_CONTROL (uint32_t value)
|-
| MSP || uint32_t __get_MSP (void) || void __set_MSP (uint32_t TopOfMainStack)
|-
| PSP || uint32_t __get_PSP (void) || void __set_PSP (uint32_t TopOfProcStack)
|}
<br />


=== Microcontrollers ===
=== Microcontrollers ===
Line 37: Line 88:


==== Software Development Tools ====
==== Software Development Tools ====
* [[ARM Mbed]] platform with high-level API (not CMSIS), HAL library, Internet connectivity services, optional web IDE
* [[ARM Mbed]] framework that provides higher-level C++ API, with downloadable or web-based IDE.
* [https://launchpad.net/~team-gcc-arm-embedded/+archive/ubuntu/ppa GNU ARM Embedded Toolchain] for Ubuntu<br />or the [https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads latest toolchain for all Linux distros, macOS, and Windows] directly from ARM Ltd.
* [https://launchpad.net/~team-gcc-arm-embedded/+archive/ubuntu/ppa GNU ARM Embedded Toolchain] for Ubuntu<br />or the [https://developer.arm.com/open-source/gnu-toolchain/gnu-rm/downloads latest toolchain for all Linux distros, macOS, and Windows] directly from ARM Ltd.
* [https://gnu-mcu-eclipse.github.io/ GNU MCU Eclipse plugin] with good support for STM32
* [https://gnu-mcu-eclipse.github.io/ GNU MCU Eclipse plugin] with good support for STM32
Line 46: Line 97:


==== Tutorials ====
==== Tutorials ====
* [[ARM Assembly]] programming
* [[Arm Cortex-M Assembly]] programming
* [[Programming STM32F411 | Programming the Cortex-M4 development board Nucleo-64 STM32F411]]
* [[Nucleo-64 | Programming the STM Nucleo-64 boards]]
* [[Programming STM32F042 | Programming the Cortex-M0 development board Nucleo-32 STM32F042]]
* [[Nucleo-32 | Programming the STM Nucleo-32 boards]]
* [[Programming ATSAME54 | Programming the Cortex-M4 development board SAM E54 Xplained Pro]]
* [[Programming ATSAME54 | Programming the Cortex-M4 development board SAM E54 Xplained Pro]]
* [[ARM Bootloader]]
* [[ARM Bootloader]]

Revision as of 2022-09-16T15:25:34

100%


Introduction

ARM is the dominant processor architecture in mobile and embedded devices. The CPU architectures are developed by ARM Ltd. and licensed by various hardware manufacturers for use in processor design. Plenty of ARM-based processor models are available on the market, ranging from special-purpose microcontrollers to generic computing with support for consumer operating systems. The price-performance ratio and broad availability makes ARM processors ideal for use in hobbyist electronics projects.

History

The initial ARM processor architecture was developed in the mid-1980s by the British computer manufacturer Acorn Computers with the goal of creating an auxiliary processor for a business computer product. The acronym ARM stands for Acorn RISC Machine. ARM Ltd. was founded as a joint venture with the U.S. computer manufacturer Apple with the goal of developing an improved architecture that could be used for the main processor of a computer.

Cross-Compiling

If your operating system is Ubuntu Linux, running on an x64/AMD64 processor, you need the following package to cross-compile code to run on ARM Cortex series processors:

sudo apt-get install gcc-arm-none-eabi


CMSIS

Arm specifies a standard C interface for programming Cortex-M processors, the Cortex-M Standard Interface (CMSIS). The Arm licensees are strongly encouraged to provide the CMSIS functions as part of their microcontroller programming SDK. Third-party software libraries usually rely on CMSIS availability.

Intrinsic Functions
Functions that generate instructions not provided by ISO/IEC C
Instruction CMSIS intrinsic function
CPSIE I void __enable_irq(void)
CPSID I void __disable_irq(void)
ISB void __ISB(void)
DSB void __DSB(void)
DMB void __DMB(void)
NOP void __NOP(void)
REV uint32_t __REV(uint32_t int value)
REV16 uint32_t __REV16(uint32_t int value)
REVSH uint32_t __REVSH(uint32_t int value)
SEV void __SEV(void)
WFE void __WFE(void)
WFI void __WFI(void)
Functions for accessing special registers
Register CMSIS read function CMSIS write function
PRIMASK uint32_t __get_PRIMASK (void) void __set_PRIMASK (uint32_t value)
CONTROL uint32_t __get_CONTROL (void) void __set_CONTROL (uint32_t value)
MSP uint32_t __get_MSP (void) void __set_MSP (uint32_t TopOfMainStack)
PSP uint32_t __get_PSP (void) void __set_PSP (uint32_t TopOfProcStack)



Microcontrollers

ARM's family of Cortex-M processors (notably M0, M0+, M3, M4) are designed for use as energy-efficient microcontrollers, where M0+ is the cheapest and most efficient, and M4 is the fastest and most capable (offering DSP functions and a floating point unit).

Reference Manuals

Cortex-M0+
Cortex-M4


Development Boards


Software Development Tools


Tutorials



ARM64