commit 609eb878d15adad9773a624e65d23ec3f5e90469 Author: 刘正航 <1915581435@qq.com> Date: Thu Apr 16 16:55:01 2026 +0800 New diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..21cf074 --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1,119 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## 项目概述 + +基于 **STM32F103ZET6**(ARM Cortex-M3,72MHz,512KB Flash,64KB SRAM)的 **MFT 步进电机控制器** 固件。应用程序通过 **DRV8880 驱动芯片** 控制步进电机,支持 UART 串口命令接口和数码管显示。 + +代码源自 **安富莱 STM32-V4** 开发板 BSP 模板。 + +## 内存布局 + +| 区域 | 地址范围 | 说明 | +|------|----------|------| +| Bootloader | 0x0800 0000 - 0x0800 7FFF | 32KB IAP 引导程序 | +| 应用程序 | 0x0800 8000 - 0x080F FFFF | 主固件(约 480KB) | +| SRAM1 | 0x2000 0000 - 0x2000 FFFF | 64KB 内部 RAM | + +**重要**:`main()` 中 `SCB->VTOR = 0x08008000` 设置应用程序的中断向量表偏移。 + +## 构建系统 + +这是一个 **Keil MDK / IAR EWARM** 项目,没有 Makefile 或 CMake。需要在 IDE 中构建: + +### Keil MDK +- 工程文件:`Project/MDK-ARM/project.uvprojx` +- 两个 Target:**Flash**(从内部 Flash 运行)和 **CpuRAM**(从 RAM 运行,用于调试) +- 输出文件:`Project/output(mdk).hex` +- VS Code C/C++ 配置在 `Project/MDK-ARM/.vscode/c_cpp_properties.json`,包含头文件路径和宏定义 + +### IAR EWARM +- 工作区:`Project/EWARMv6/Project.www` +- 输出文件:`Project/output(iar).hex` + +### 编译器宏定义 +- `USE_STDPERIPH_DRIVER` — 启用 ST 标准外设库 +- `STM32F10X_HD` — 大容量器件(512KB Flash) +- `VECT_TAB_SRAM` — 仅用于 RAM 调试目标 + +### 栈/堆大小 +在启动汇编文件中配置(`Stack_Size EQU 0x00008000`,`Heap_Size EQU 0x00000400`)。 + +## 代码架构 + +``` +Motor/ +├── Bootloader/ # IAP 引导程序(独立工程,基于 ST HAL 库) +│ ├── Drivers/ # BSP(LCD、LED、KEY、STMFLASH、数码管) +│ ├── Middlewares/ # 第三方库 +│ └── User/ # 引导程序应用代码 +├── Libraries/ # ST/ARM 提供的库(不要修改) +│ ├── CMSIS/ # ARM CMSIS 头文件 + startup_stm32f103xe.s +│ ├── STM32F10x_StdPeriph_Driver/ # 标准外设库 +│ └── STM32_USB-FS-Device_Driver/ # USB Device 库 +├── User/ # 应用源代码(主要工作区) +│ ├── app/ # 应用层 +│ │ ├── src/main.c # 入口、电机控制逻辑、UART 命令解析 +│ │ └── inc/main.h # 应用头文件 +│ └── bsp/ # 板级支持包(硬件抽象层) +│ ├── bsp.c/h # BSP 初始化、周期定时器(1ms/10ms)、空闲循环 +│ ├── src/ # BSP 驱动实现 +│ └── inc/ # BSP 驱动头文件 +├── Project/ # IDE 工程文件 + 构建输出 +│ ├── MDK-ARM/ # Keil MDK 工程 +│ ├── EWARMv6/ # IAR EWARM 工作区 +│ └── bin_file/ # 生成的二进制文件 +└── Doc/ # 文档(中文) +``` + +## 关键源文件 + +| 文件 | 功能 | +|------|------| +| `User/app/src/main.c` | 主入口、UART 命令解析、电机控制状态机 | +| `User/bsp/bsp.c` | 硬件初始化、周期任务分发 | +| `User/bsp/src/bsp_step_moto.c` | 步进电机控制(脉冲计数、启动/停止) | +| `User/bsp/src/bsp_drv8880.c` | DRV8880 电机驱动接口 | +| `User/bsp/src/bsp_tim_pwm.c` | 定时器 PWM 生成电机脉冲 | +| `User/bsp/src/bsp_usart_dma.c` | UART + DMA 串口通信 | +| `User/bsp/src/bsp_digital_tube.c` | 数码管(7 段)显示 | +| `User/bsp/src/bsp_key.c` | 按键扫描和键值处理 | +| `User/bsp/src/bsp_beep.c` | 蜂鸣器音调生成 | + +## UART 命令接口 + +通过 USART1(PA9/PA10,115200 波特率)通信。支持的命令: + +| 命令 | 功能 | +|------|------| +| `?` | 获取当前位置角度 | +| `s` | 停止电机 | +| `z` | 将当前位置设为零点 | +| `MF` | 打印系统信息 | +| `[r:频率:角度]` | 以指定转速旋转到绝对角度 | +| `[rr:频率:角度]` | 以指定转速旋转相对角度 | + +常量:`MAX_SPEED = 400`,`STEP_PER_LAP = 8461`(每转步数)。 + +## BSP 架构 + +BSP 采用周期定时器驱动模型: +- `bsp_RunPer1ms()` — 每 1ms 调用一次(数码管刷新) +- `bsp_RunPer10ms()` — 每 10ms 调用一次(按键扫描、蜂鸣器处理) +- `bsp_Idle()` — 在主循环空闲时调用 + +`bsp.h` 是所有 BSP 模块的统一入口。应用程序只需 `#include "bsp.h"`。 + +## Bootloader(独立工程) + +位于 `Bootloader/`,是一个基于 STM32 HAL 库的 IAP 引导程序(主应用使用 StdPeriph 库,两者不同)。通过 UART 接收固件并烧录到 0x08008000。作为独立的 Keil 工程构建,位于 `Bootloader/Projects/` 下。 + +## 注意事项 + +- 源文件使用 GBK/中文编码 — 在 UTF-8 编辑器中可能显示乱码 +- 工程中积累了多个用户的重复 `.uvgui` 文件 — 可忽略 +- `Bootloader/keilkill.bat` 用于清理 Keil 临时文件 +- `CopyHex_Flash.bat` 用于复制编译生成的 hex 文件 +- `Libraries/` 目录是厂商提供的代码,应避免修改 +- 主应用使用 StdPeriph 库;Bootloader 使用 HAL 库 — 两者是独立的代码体系 diff --git a/Doc/01.例程功能说明.txt b/Doc/01.例程功能说明.txt new file mode 100644 index 0000000..6c521f4 --- /dev/null +++ b/Doc/01.例程功能说明.txt @@ -0,0 +1,74 @@ +/* +********************************************************************************************************* +* +* STM32-V4 -̹˵ +* +* : V4-005_Դ̣ӲPWM +* +* Ƽ༭TABΪ4 Ķļ +* +********************************************************************************************************* +*/ + +1̼ + + ʾSTM32-V4尲װķΪԴʹPA8š + + ʵֹܣ + 1 K1K2K3ֱͬķ + 2 ͨҡҼԵڷƵʡ + ʾ: + 1. K1 - ʾ(̶Ƶ1.5KHz) + 2. K2 - 10 + 3. K3 - 3 + 4. ҡ - Ƶ - 100Hz + 5. ҡҼ - Ƶ + 100Hz + + Դ˵: + 1bsp_beep.c ǷļͨлԴԴ ԴҪʹTIMӲ + PWM + //#define BEEP_HAVE_POWER /* бʾԴֱͨGPIO, PWM */ + + 2bsp_tim_pwm.c ǶʱPWMļSetTIMOutPWM()GPIOΪPWM״̬ + void bsp_SetTIMOutPWM(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, TIM_TypeDef* TIMx, uint8_t _ucChannel, + uint32_t _ulFreq, uint32_t _ulDutyCycle); + + 3bsp.c УҪÿ10msһBEEP_Pro()úƷʱ + void bsp_RunPer10ms(void) + { + bsp_KeyScan(); /* ÿ10msɨ谴һ */ + + BEEP_Pro(); /* ʱ */ + } + + 4 BEEP_KeyTone(); ǷʾĺƵʹ̶1.5KHz + BEEP_Start()ʼСúǷģ10msʱжϷPWMֹͣ + BEEP_Stop() ֹС + +2ִн + ʹUSBתRS232ߣӿRS232ӿڵUSBӿڡ SecureCRT + + Ǵڽִн + ************************************************************* + * : V4-005_Դ̣ӲPWM + * ̰汾 : 1.0 + * : 2015-08-30 + * ̼汾 : 3.6.1 + * CMSIS汾 : 3.01 + * + * QQ : 1295744630 + * Email : armfly@qq.com + * Copyright www.armfly.com + ************************************************************* + ʾ: + 1. K1 - ʾ(̶Ƶ1.5KHz) + 2. K2 - 10 + 3. K3 - 3 + 4. ҡ - Ƶ - 100Hz + 5. ҡҼ - Ƶ + 100Hz + Ƶ = 1500Hz + + +3ļ¼ +2015-08-30 V1.0 װ + diff --git a/Doc/02.开发环境说明.txt b/Doc/02.开发环境说明.txt new file mode 100644 index 0000000..38f49eb --- /dev/null +++ b/Doc/02.开发环境说明.txt @@ -0,0 +1,257 @@ +/* +********************************************************************************************************* +* +* STM32-V4 -˵ +* +* ڣ2015-08-30 +* +* Ƽ༭TABΪ4 Ķļ +* +********************************************************************************************************* +*/ + +1CPUڲԴ + CPUͺ : STM32F103ZET6 / LQFP-144 / ARM 32-bit Cortex-M3 + Ƶ : 72MHz + ڲFlash : 512KB + ڲSRAM : 64KB + ʱ : 11 + UART : 5 + SPI : 3 (2ɸΪI2S) + I2C : 2 + ADC : 312λADC + DAC : 2·12λDAC + CAN : 1 CAN 2.0B + SDIO : 1 + USB : USB2.0ȫ()ⲿPHY + +2FSMC洢ַ + CPUڲ FLASH 0x0800 0000 - 0x080F FFFF,512K(0x80000)ֽ + CPUڲ SRAM1 0x2000 0000 - 0x2000 FFFF,64K(0x10000)ֽ + + ⲿ NOR Flash 0x6400 0000 - 0x64FF FFFF,16M(0x1000000)ֽ + ⲿ SRAM 0x6800 0000 - 0x681F FFFF,1M(0x100000)ֽ + DM9000AоƬַ0x6C10 0000, 0x6C10 0008, ռ2˿ڵַ + TFT LCDַ 0x6C00 0000, 0x6C00 0002, ռ2˿ڵַ + OLEDַ 0x6C20 0000, 0x6C20 0002, ռ2˿ڵַ + ⲿ NAND Flash0x7000 0000, 128M(0xC800000)ֽ + + +3I2Cַ + ַ + 1 EEPROM AT24C128 0xA0 + 2 ƵCODECоƬWM8978 0x34 + 3 FMSi4704 0x22 + 4 MPU-6050 0xD0 + 5 նȴ BH1750FVI 0x46 + 6 ѹ BMP180 0xEE + 7 HMC5883L 0x3C õģ飬ѡ䡿 + +4 + --- DZ䣬ѡ + ȻSTM32ִ֧ISPسDz֧ߵԡʹôأЧʼͣǿƼһ߿Чʡ + - ST-LINK V2 : ST˾ķس͵Ըٳ֧STM8STM32һSTM8S + STM32Ļ ǽ鹺J-Link + - J-LINK V8,V9 : Segger˾ķس͵Ըٳ֧ARMϵС + + USBתRS232ߡ--- + - ڴPCûӲˡǶڵƬڻǺõġĺ̶ܶҪͨڴӡϢ + - һHL-340ͺŵUSBתRS232ߡ֧WIN XP, WIN7 WIN8 ϵͳ + + + - 뻷 IAR EWARMv6 KEIL MDK uV4밴ѡ綼ϤƼʹKEIL MDK (uV4) + - SecureCRT : һĹǿijն˹ߣҪʾӴڴӡϢ + - UltraEdit : һԴ༭ + - SourceInsight : һԴ + +5͵Է + ˵̾ṩ KEIL IAṚֹÿ2TargetһFlashѲеģһCpuRAMеġ밴Ҫѡ + ҪFlashеijµ̣ѡCPU RAMС + >>>> ЩԳܴRAMռִС + + Keil MDKV4.54 + - ִв˵ Project -> Open project \Project\MDK-ARM(uV4)\project.uvproj ǹļ + - ִв˵ Project -> Rebuild all target files ±еļ: + - ִв˵ Debug->Start/Stop Debug Session (Ctrl+F5) : + + ע1ѡCPU RAMʱʹLoadťسֱStart DebugɡΪLoadťרصFlashġ + ע2Keil MDKΪ˱ַ澯ҪC/C++ѡ --diag_suppress=870 + ע3Ϊ߱Чʡȱʡر˹ Output - Browse InformationʹҼҺ塣 + Ҫܣѡء + + IAR EWARMV6.30 + - ִв˵ File -> Open Workspace (ļ: Project\EWARMv6\Project.www) + - ִв˵ Project -> Rebuild All (±) + - ִв˵ Project -> Download and Debug(Ctrl+D) (װس) + +6ļ˵ +Libraries : ŵ3ṩĿԴ룬ЩһdzIJ֤Ĵ롣 + CMSIS : CMSISARM˾ҲͬоƬӦһܺģṩں衢ʵʱϵͳм豸֮ͨýӿڡ + STM32F10x_StdPeriph_Driver : STM32F10XϵMCUı̼Դ + STM32_USB-FS-Device_Driver : USB Device Library + +User : ûԼдԴ + bsp : 弶ְ֧Board Surport PacketҲӲײ. òڹ̼Ӧó֮䡣 + fonts : ŵֿⳣ + +project : ŸߵĹļеʱļHEXļڴļ + MDK-ARM(uV4) : KEIL˾MDK uVision 4ļ + EWARMv6 : IAR˾EWARM ļ + +7Դ˵ +Flash : TargetƣFlash CpuRAM + USER : main.c Լûó + BSP : 弶ְ֧Board Support Packet,Ӳײļ + CMSIS : CMSISIӿļ system_stm32f4xx.c + StdPeriph_Drivers: STM328SϵMCUĹ̼Դ + MDK-ARM : ļԴ,IAR EWARMv6 + Doc : һЩĵtxtļ + +8Դļ˵ + - main.c : ûmain()ļ + - stm32f1xx_it.c : джϷ ˼쳣ж⣬ǽISRŵԵģС + - stm32f10x_assert.c : ŶԺ һģ + - bsp.c : ײӲӲʼں + - Ŀļ(ڴ).bat : ִɾOBJ,LISTļԴѹ + +9CеԤ ڹиģ + USE_STDPERIPH_DRIVER - űʾʹST˾ı + VECT_TAB_SRAM - űʾжλCPUڲRAM CPUڲRAMеĹ̲Ҫӣ + +10Ѻջ + KEIL MDK, öѺջĴСͨļstart_stm32f10x_hd.s ļʵֵģ磺 + Stack_Size EQU 0x00008000 + Heap_Size EQU 0x00000400 + + IAR EWARM, ֱڹнļ + - ˵ project -> options -> ѡLinker -> Configҳ -> Editť -> лCSTACK/HEAP + 磺 + CSTACK = 0x8000 + HEAP = 0x400 + +11Ŀļ + project 棬бõ hex ļû÷ֱ output(flash).hex CPUڲflash + \Project\output(mdk).hex - KEIL MDKõļλCPU ڲFlash + \Project\output(iar).hex - IARõļλCPU ڲFlash + \Project\MDK-ARM(uV4)\Flash\List\output.map - DZļıʽԲ鿴ÿĵַͿռ + +¼1 STM32-V4 GPIO + GPIO, һ140GPIOGPIOA C GPIOH ÿ16GPIOI ֻ12 + PA0/WKUP WKUPť -- K1 + PA1/DM9000AE_INT ̫оƬDM9000AEж + PA2/USART2_TX 2 + PA3/USART2_RX 2գGPRSģ + PA4/DAC_OU DAC1 + PA5/SPI1_SCK SPIʱ/DAC2 + PA6/SPI1_MISO SPIMISO + PA7/SPI1_MOSI SPIMOSI + PA8/IR_TX + PA9/USART1_TX 1ͣRS232 + PA10/USART1_RX 1գRS232 + PA11/USBDM ȫ(12Mbps)USBӿD- + PA12/USBDP ȫ(12Mbps)USBӿD+ + PA13/JTMS-SWDIO SWDԽӿ + PA14/JTCK-SWCLK SWDԽӿʱ + PA15/ESP8266_GPIO2 WIFIģIO + + PB0/IR_RX ңؽչ + PB1/LCD_PWM LCDƣRA8875ãRA8875ƣ + PB2-BOOT1/RS485_TXEN RS485ʹ + PB3/NRF24L01_CE NRF24L01ʹ + PB4/TRST/GPRS_TERM_ON WIFIԴ/GPRSģ鿪ź + PB5/TP_BUSY/VS1053_DREQ BUSY/VS1053BǷ + PB6/I2C1_SCL I2C1ʱӿ + PB7/I2C1_SDA I2C1ݿ + PB8/CANRX CAN + PB9/CANTX CAN + PB10/USART3_TX 3ͣRS485շоƬ + PB11/USART3_RX 3գRS485շоƬ + PB12/I2S2_WS I2SƵӿѡź + PB13/I2S2_CK I2SƵӿʱź + PB14/USB_PULLUPENBLE USBʹ + PB15/I2S2_SD WM8978¼ + + PC0/ADC123_IN10 ADC - ʾͨ1 + PC1/ADC123_IN11 ADC - ʾͨ2 + PC2/ ADC123_IN12/GPRS_RESET ADC/ESP8266ⲿӲλ + PC3/ ADC123_IN13/NRF24L01_CSN ADC/NRF24L01Ƭѡźѡ + PC4/ ADC12_IN14 ɵADC + PC5/ TP_INT жϣRA8875жϣ + PC6/I2S2_MCK I2SƵӿʱԴ + PC7/ SD_INSERT SD + PC8/SDIO_D0 SDIOD0 + PC9/SDIO_D1 SDIOD1 + PC10/SDIO_D2 SDIOD2 + PC11/SDIO_D3 SDIOD3 + PC12/SDIO_CK SDIOʱ + PC13/TAMPER K1//PS/2ʱӿ + PC14-OSC32_IN 32768Hzʱ + PC15-OSC32_OUT 32768Hzʱ + + PD0/ FSMC_D2 FSMCD2 + PD1/FSMC_D3 FSMCD3 + PD2/SDIO_CMD SDIO + PD3/JOY_D ҡ¼ + PD4/FSMC_NOE FSMC߶źţNʾЧOE = Output Enable + PD5/FSMC_NWE FSMCдźţNʾЧWE = Write Enable + PD6/FSMC_NWAIT FSMCߵȴź + PD7/FSMC_NCE2 FSMCƬѡNCE2 + PD8/FSMC_D13 FSMCD13 + PD9/FSMC_D14 FSMCD14 + PD10/FSMC_D15 FSMCD15 + PD11/FSMC_A16 FSMCַA16 + PD12/FSMC_A17 FSMCַA17 + PD13/FSMC_A18 FSMCַA18 + PD14/FSMC_D0 FSMCD0 + PD15/FSMC_D1 FSMCD1 + + PE0/FSMC_NBL0 FSMCֽѡźţSRAM + PE1/FSMC_NBL1 FSMCֽѡźţSRAM + PE2/CH376T_INT CH376TоƬжź + PE3/FSMC_A19 FSMCַA19 + PE4/FSMC_A20 FSMCַA20 + PE5/FSMC_A21 FSMCַA21 + PE6/FSMC_A22 FSMCַA22 + PE7/FSMC_D4 FSMCD4 + PE8/FSMC_D5 FSMCD5 + PE9/FSMC_D6 FSMCD6 + PE10/FSMC_D7 FSMCD7 + PE11/FSMC_D8 FSMCD8 + PE12/FSMC_D9 FSMCD9 + PE13/FSMC_D10 FSMCD10 + PE14/FSMC_D11 FSMCD11 + PE15/FSMC_D12 FSMCD12 + + PF0/FSMC_A0 FSMCַA0 + PF1/FSMC_A1 FSMCַA1 + PF2/FSMC_A2 FSMCַA2 + PF3/FSMC_A3 FSMCַA3 + PF4/FSMC_A4 FSMCַA4 + PF5/FSMC_A5 FSMCַA5 + PF6/MPU-6050_INT/NRF24L01_IRQ SPI (NRF24L01 / MPU-6050ж) + PF7/ESP8266_GPIO0/LED2 ESP8266ѡ״̬/LED2 + PF8/VS1053B_XDCS/LED3 VS1053BƬѡ/LED3 + PF9/VS1053B_XCS/LED4 VS1053BƬѡź/LED4 + PF10/CH376T_SCS CH376T SPIƬѡ + PF11/SF_CS/LED1 ƴFlashƬѡ/LED1 + PF12/FSMC_A6 FSMCַA6 + PF13/FSMC_A7 FSMCַA7 + PF14/FSMC_A8 FSMCַA8 + PF15/FSMC_A9 FSMCַA + + PG0/FSMC_A10 FSMCַA10 + PG1/FSMC_A11 FSMCַA11 + PG2/FSMC_A12 FSMCַA12 + PG3/FSMC_A13 FSMCַA13 + PG4/FSMC_A14 FSMCַA14 + PG5/FSMC_A15 FSMCַA15 + PG6/FSMC_INT2 NAND Flashæź + PG7/JOY_OK ҡOK + PG8/PS/2_DATA/DS18B20_DQ PS/2ӿ/DS18B20 + PG9/FSMC_NE2 FSMCƬѡNE2 + PG10/FSMC_NE3 FSMCƬѡNE3 + PG11/TP_NCS 3.5оƬƬѡRA8875SPIӿڵƬѡ + PG12/FSMC_NE4 FSMCƬѡNE4 + PG13/JOY_R ҡҼ + PG14/JOY_L ҡ + PG15/JOY_U ҡϼ \ No newline at end of file diff --git a/Libraries/CMSIS/CMSIS END USER LICENCE AGREEMENT.pdf b/Libraries/CMSIS/CMSIS END USER LICENCE AGREEMENT.pdf new file mode 100644 index 0000000..c8feab4 Binary files /dev/null and b/Libraries/CMSIS/CMSIS END USER LICENCE AGREEMENT.pdf differ diff --git a/Libraries/CMSIS/Device/ST/STM32F10x/Include/stm32f10x.h b/Libraries/CMSIS/Device/ST/STM32F10x/Include/stm32f10x.h new file mode 100644 index 0000000..2a6f12a --- /dev/null +++ b/Libraries/CMSIS/Device/ST/STM32F10x/Include/stm32f10x.h @@ -0,0 +1,8388 @@ +/** + ****************************************************************************** + * @file stm32f10x.h + * @author MCD Application Team + * @version V3.6.1 + * @date 09-March-2012 + * @brief CMSIS Cortex-M3 Device Peripheral Access Layer Header File. + * This file contains all the peripheral register's definitions, bits + * definitions and memory mapping for STM32F10x Connectivity line, + * High density, High density value line, Medium density, + * Medium density Value line, Low density, Low density Value line + * and XL-density devices. + * + * The file is the unique include file that the application programmer + * is using in the C source code, usually in main.c. This file contains: + * - Configuration section that allows to select: + * - The device used in the target application + * - To use or not the peripherals drivers in application code(i.e. + * code will be based on direct access to peripherals registers + * rather than drivers API), this option is controlled by + * "#define USE_STDPERIPH_DRIVER" + * - To change few application-specific parameters such as the HSE + * crystal frequency + * - Data structures and the address mapping for all peripherals + * - Peripheral's registers declarations and bits definition + * - Macros to access peripherals registers hardware + * + ****************************************************************************** + * @attention + * + *
+
+
+
|
+
+
+
+
|
+
+
+
+
|
+
+
+
+
|
+
![]() |
+
+
+ CMSIS-CORE
+ Version 3.01
+
+ CMSIS-CORE support for Cortex-M processor-based devices
+ |
+
+
+
+
CMSIS-CORE uses the common coding rules for CMSIS components that are documented under Introduction .
+CMSIS-CORE violates the following MISRA-C:2004 rules:
+![]() |
+
+
+ CMSIS-CORE
+ Version 3.01
+
+ CMSIS-CORE support for Cortex-M processor-based devices
+ |
+
+
+
+
The table below associates some common register names used in CMSIS to the register names used in Technical Reference Manuals.
+| CMSIS Register Name | Cortex-M3 and Cortex-M4 | Cortex-M0 and Cortex-M0+ | Register Name |
|---|---|---|---|
| Nested Vectored Interrupt Controller (NVIC) Register Access | |||
| NVIC->ISER[] | NVIC_ISER0..7 | ISER | Interrupt Set-Enable Registers |
| NVIC->ICER[] | NVIC_ICER0..7 | ICER | Interrupt Clear-Enable Registers |
| NVIC->ISPR[] | NVIC_ISPR0..7 | ISPR | Interrupt Set-Pending Registers |
| NVIC->ICPR[] | NVIC_ICPR0..7 | ICPR | Interrupt Clear-Pending Registers |
| NVIC->IABR[] | NVIC_IABR0..7 | - | Interrupt Active Bit Register |
| NVIC->IP[] | NVIC_IPR0..59 | IPR0..7 | Interrupt Priority Register |
| NVIC->STIR | STIR | - | Software Triggered Interrupt Register |
| System Control Block (SCB) Register Access | |||
| SCB->CPUID | CPUID | CPUID | CPUID Base Register |
| SCB->ICSR | ICSR | ICSR | Interrupt Control and State Register |
| SCB->VTOR | VTOR | - | Vector Table Offset Register |
| SCB->AIRCR | AIRCR | AIRCR | Application Interrupt and Reset Control Register |
| SCB->SCR | SCR | SCR | System Control Register |
| SCB->CCR | CCR | CCR | Configuration and Control Register |
| SCB->SHP[] | SHPR1..3 | SHPR2..3 | System Handler Priority Registers |
| SCB->SHCSR | SHCSR | SHCSR | System Handler Control and State Register |
| SCB->CFSR | CFSR | - | Configurable Fault Status Registers |
| SCB->HFSR | HFSR | - | HardFault Status Register |
| SCB->DFSR | DFSR | - | Debug Fault Status Register |
| SCB->MMFAR | MMFAR | - | MemManage Fault Address Register |
| SCB->BFAR | BFAR | - | BusFault Address Register |
| SCB->AFSR | AFSR | - | Auxiliary Fault Status Register |
| SCB->PFR[] | ID_PFR0..1 | - | Processor Feature Registers |
| SCB->DFR | ID_DFR0 | - | Debug Feature Register |
| SCB->ADR | ID_AFR0 | - | Auxiliary Feature Register |
| SCB->MMFR[] | ID_MMFR0..3 | - | Memory Model Feature Registers |
| SCB->ISAR[] | ID_ISAR0..4 | - | Instruction Set Attributes Registers |
| SCB->CPACR | CPACR | - | Coprocessor Access Control Register |
| System Control and ID Registers not in the SCB (SCnSCB) Register Access | |||
| SCnSCB->ICTR | ICTR | - | Interrupt Controller Type Register |
| SCnSCB->ACTLR | ACTLR | - | Auxiliary Control Register |
| System Timer (SysTick) Control and Status Register Access | |||
| SysTick->CTRL | STCSR | SYST_CSR | SysTick Control and Status Register |
| SysTick->LOAD | STRVR | SYST_RVR | SysTick Reload Value Register |
| SysTick->VAL | STCVR | SYST_CVR | SysTick Current Value Register |
| SysTick->CALIB | STCR | SYST_CALIB | SysTick Calibaration Value Register |
| Data Watchpoint and Trace (DWT) Register Access | |||
| DWT->CTRL | DWT_CTRL | - | Control Register |
| DWT->CYCCNT | DWT_CYCCNT | - | Cycle Count Register |
| DWT->CPICNT | DWT_CPICNT | - | CPI Count Register |
| DWT->EXCCNT | DWT_EXCCNT | - | Exception Overhead Count Register |
| DWT->SLEEPCNT | DWT_SLEEPCNT | - | Sleep Count Register |
| DWT->LSUCNT | DWT_LSUCNT | - | LSU Count Register |
| DWT->FOLDCNT | DWT_FOLDCNT | - | Folded-instruction Count Register |
| DWT->PCSR | DWT_PCSR | - | Program Counter Sample Register |
| DWT->COMP0..3 | DWT_COMP0..3 | - | Comparator Register 0..3 |
| DWT->MASK0..3 | DWT_MASK0..3 | - | Mask Register 0..3 |
| DWT->FUNCTION0..3 | DWT_FUNCTION0..3 | - | Function Register 0..3 |
| Instrumentation Trace Macrocell (ITM) Register Access | |||
| ITM->PORT[] | ITM_STIM0..31 | - | Stimulus Port Registers |
| ITM->TER | ITM_TER | - | Trace Enable Register |
| ITM->TPR | ITM_TPR | - | ITM Trace Privilege Register |
| ITM->TCR | ITM_TCR | - | Trace Control Register |
| Trace Port Interface (TPIU) Register Access | |||
| TPI->SSPSR | TPIU_SSPR | - | Supported Parallel Port Size Register |
| TPI->CSPSR | TPIU_CSPSR | - | Current Parallel Port Size Register |
| TPI->ACPR | TPIU_ACPR | - | Asynchronous Clock Prescaler Register |
| TPI->SPPR | TPIU_SPPR | - | Selected Pin Protocol Register |
| TPI->FFSR | TPIU_FFSR | - | Formatter and Flush Status Register |
| TPI->FFCR | TPIU_FFCR | - | Formatter and Flush Control Register |
| TPI->FSCR | TPIU_FSCR | - | Formatter Synchronization Counter Register |
| TPI->TRIGGER | TRIGGER | - | TRIGGER |
| TPI->FIFO0 | FIFO data 0 | - | Integration ETM Data |
| TPI->ITATBCTR2 | ITATBCTR2 | - | ITATBCTR2 |
| TPI->ITATBCTR0 | ITATBCTR0 | - | ITATBCTR0 |
| TPI->FIFO1 | FIFO data 1 | - | Integration ITM Data |
| TPI->ITCTRL | TPIU_ITCTRL | - | Integration Mode Control |
| TPI->CLAIMSET | CLAIMSET | - | Claim tag set |
| TPI->CLAIMCLR | CLAIMCLR | - | Claim tag clear |
| TPI->DEVID | TPIU_DEVID | - | TPIU_DEVID |
| TPI->DEVTYPE | TPIU_DEVTYPE | - | TPIU_DEVTYPE |
| Memory Protection Unit (MPU) Register Access | |||
| MPU->TYPE | MPU_TYPE | - | MPU Type Register |
| MPU->CTRL | MPU_CTRL | - | MPU Control Register |
| MPU->RNR | MPU_RNR | - | MPU Region Number Register |
| MPU->RBAR | MPU_RBAR | - | MPU Region Base Address Register |
| MPU->RASR | MPU_RASR | - | MPU Region Attribute and Size Register |
| MPU->RBAR_A1..3 | MPU_RBAR_A1..3 | - | MPU alias Register |
| MPU->RSAR_A1..3 | MPU_RSAR_A1..3 | - | MPU alias Register |
| Floating Point Unit (FPU) Register Access [only Cortex-M4 with FPU] | |||
| FPU->FPCCR | FPCCR | - | FP Context Control Register |
| FPU->FPCAR | FPCAR | - | FP Context Address Register |
| FPU->FPDSCR | FPDSCR | - | FP Default Status Control Register |
| FPU->MVFR0..1 | MVFR0..1 | - | Media and VFP Feature Registers |
![]() |
+
+
+ CMSIS-CORE
+ Version 3.01
+
+ CMSIS-CORE support for Cortex-M processor-based devices
+ |
+
+
+
+
ARM supplies CMSIS-CORE template files for the all supported Cortex-M processors and various compiler vendors. Refer to the list of Tested and Verified Toolchains for compliancy. These template files include the following:
+The detailed file structure of the CMSIS-CORE is shown in the following picture.
+
+The CMSIS-CORE template files should be extended by the silicon vendor to reflect the actual device and device peripherals. Silicon vendors add in this context the:
+| Template File | Description |
|---|---|
| ".\Device\_Template_Vendor\Vendor\Device\Source\ARM\startup_Device.s" | Startup file template for ARM C/C++ Compiler. |
| ".\Device\_Template_Vendor\Vendor\Device\Source\GCC\startup_Device.s" | Startup file template for GNU GCC ARM Embedded Compiler. |
| ".\Device\_Template_Vendor\Vendor\Device\Source\G++\startup_Device.s" | Startup file template for GNU Sourcery G++ Compiler. |
| ".\Device\_Template_Vendor\Vendor\Device\Source\IAR\startup_Device.s" | Startup file template for IAR C/C++ Compiler. |
| ".\Device\_Template_Vendor\Vendor\Device\Source\system_Device.c" | Generic system_Device.c file for system configuration (i.e. processor clock and memory bus system). |
| ".\Device\_Template_Vendor\Vendor\Device\Include\Device.h" | Generic device header file. Needs to be extended with the device-specific peripheral registers. Optionally functions that access the peripherals can be part of that file. |
| ".\Device\_Template_Vendor\Vendor\Device\Include\system_Device.h" | Generic system device configuration include file. |
In addition ARM provides the following core header files that do not need any modifications.
+| Core Header Files | Description |
|---|---|
| core_<cpu>.h | Defines the core peripherals and provides helper functions that access the core registers. This file is available for all supported processors:
|
| core_cmInstr.h | Defines intrinsic functions to access special Cortex-M instructions. |
| core_cmFunc.h | Defines functions to access the Cortex-M core peripherals. |
| core_cm4_simd.h | Defines intrinsic functions to access the Cortex-M4 SIMD instructions. |
Copy the complete folder including files and replace:
+Each template file contains comments that start with ToDo: that describe a required modification. The template files contain placeholders:
+| Placeholder | Replaced with |
|---|---|
| <Device> | the specific device name or device family name; i.e. LPC17xx. |
| <DeviceInterrupt> | a specific interrupt name of the device; i.e. TIM1 for Timer 1. |
| <DeviceAbbreviation> | short name or abbreviation of the device family; i.e. LPC. |
| Cortex-M# | the specific Cortex-M processor name; i.e. Cortex-M3. |
The adaption of the template files is described in detail on the following pages:
+ +![]() |
+
+
+ CMSIS-CORE
+ Version 3.01
+
+ CMSIS-CORE support for Cortex-M processor-based devices
+ |
+
+
+
+
ARM provides CMSIS-CORE files for the supported ARM Processors and for various compiler vendors. These files can be used when standard ARM processors should be used in a project. The table below lists the folder and device names of the ARM processors.
+| Folder | Processor | Description |
|---|---|---|
| ".\Device\ARM\ARMCM0" | Cortex-M0 | Contains Include and Source template files configured for the Cortex-M0 processor. The device name is ARMCM0 and the name of the Device Header File <device.h> is <ARMCM0.h>. |
| ".\Device\ARM\ARMCM0plus" | Cortex-M0+ | Contains Include and Source template files configured for the Cortex-M0+ processor. The device name is ARMCM0plus and the name of the Device Header File <device.h> is <ARMCM0plus.h>. |
| ".\Device\ARM\ARMCM3" | Cortex-M3 | Contains Include and Source template files configured for the Cortex-M3 processor. The device name is ARMCM3 and the name of the Device Header File <device.h> is <ARMCM3.h>. |
| ".\Device\ARM\ARMCM4" | Cortex-M4 | Contains Include and Source template files configured for the Cortex-M4 processor. The device name is ARMCM4 and the name of the Device Header File <device.h> is <ARMCM4.h>. |
| ".\Device\ARM\ARMSC000" | SecurCore SC000 | Contains Include and Source template files configured for the SecurCore SC000 processor. The device name is ARMSC000 and the name of the Device Header File <device.h> is <ARMSC000.h>. |
| ".\Device\ARM\ARMSC300" | SecurCore SC300 | Contains Include and Source template files configured for the SecurCore SC300 processor. The device name is ARMSC300 and the name of the Device Header File <device.h> is <ARMSC300.h>. |
The CMSIS Processor and Core Peripheral files allow also to create generic libraries. The CMSIS-DSP Libraries are an example for such a generic library.
+To build a generic Library set the define __CMSIS_GENERIC and include the relevant core_<cpu>.h CMSIS CPU & Core Access header file for the processor. The define __CMSIS_GENERIC disables device-dependent features such as the SysTick timer and the Interrupt System. Refer to Configuration of the Processor and Core Peripherals for a list of the available core_<cpu>.h header files.
+Example:
+The following code section shows the usage of the core_<cpu>.h header files to build a generic library for Cortex-M0, Cortex-M3, or Cortex-M4. To select the processor the source code uses the define CORTEX_M4, CORTEX_M3, or CORTEX_M0. By using this header file, the source code can access the functions for Core Register Access, Intrinsic Functions for CPU Instructions, Intrinsic Functions for SIMD Instructions [only Cortex-M4], and Debug Access.
+#define __CMSIS_GENERIC /* disable NVIC and Systick functions */ + +#if defined (CORTEX_M4) + #include "core_cm4.h" +#elif defined (CORTEX_M3) + #include "core_cm3.h" +#elif defined (CORTEX_M0) + #include "core_cm0.h" +#elif defined (CORTEX_M0PLUS) + #include "core_cm0plus.h" +#else + #error "Processor not specified or unsupported." +#endif +
![]() |
+
+
+ CMSIS-CORE
+ Version 3.01
+
+ CMSIS-CORE support for Cortex-M processor-based devices
+ |
+
+
+
+
To use the CMSIS-CORE the following files are added to the embedded application:
+The Startup File startup_<device>.s is executed after reset and calls SystemInit. After the system initialization control is transferred to the C/C++ run-time library which performs initialization and calls the main function in the user code. In addition the Startup File startup_<device>.s contains all exception and interrupt vectors and implements a default function for every interrupt. It may also contain stack and heap configurations for the user application.
+The System Configuration Files system_<device>.c and system_<device>.h performs the setup for the processor clock. The variable SystemCoreClock indicates the CPU clock speed. System and Clock Configuration describes the minimum feature set. In addition the file may contain functions for the memory BUS setup and clock re-configuration.
+The Device Header File <device.h> is the central include file that the application programmer is using in the C source code. It provides the following features:
+
+The CMSIS-CORE are device specific. In addition, the Startup File startup_<device>.s is also compiler vendor specific. The various compiler vendor tool chains may provide folders that contain the CMSIS files for each supported device. Using CMSIS with generic ARM Processors explains how to use CMSIS-CORE for ARM processors.
+For example, the following files are provided in MDK-ARM to support the STM32F10x Connectivity Line device variants:
+| File | Description |
|---|---|
| ".\ARM\Startup\ST\STM32F10x\startup_stm32f10x_cl.s" | Startup File startup_<device>.s for the STM32F10x Connectivity Line device variants. |
| ".\ARM\Startup\ST\STM32F10x\system_stmf10x.c" | System Configuration Files system_<device>.c and system_<device>.h for the STM32F10x device families. |
| ".\ARM\INC\ST\STM32F10x\stm32f10x.h" | Device Header File <device.h> for the STM32F10x device families. |
| ".\ARM\INC\ST\STM32F10x\system_stm32f10x.h" | system_Device.h Template File for the STM32F10x device families. |
Thereafter, the functions described under Reference can be used in the application.
+A typical example for using the CMSIS layer is provided below. The example is based on a STM32F10x Device.
+#include <stm32f10x.h> // File name depends on device used + +uint32_t volatile msTicks; // Counter for millisecond Interval + +void SysTick_Handler (void) { // SysTick Interrupt Handler + msTicks++; // Increment Counter +} + +void WaitForTick (void) { + uint32_t curTicks; + + curTicks = msTicks; // Save Current SysTick Value + while (msTicks == curTicks) { // Wait for next SysTick Interrupt + __WFE (); // Power-Down until next Event/Interrupt + } +} + +void TIM1_UP_IRQHandler (void) { // Timer Interrupt Handler + ; // Add user code here +} + +void timer1_init(int frequency) { // Set up Timer (device specific) + NVIC_SetPriority (TIM1_UP_IRQn, 1); // Set Timer priority + NVIC_EnableIRQ (TIM1_UP_IRQn); // Enable Timer Interrupt +} + + +void Device_Initialization (void) { // Configure & Initialize MCU + if (SysTick_Config (SystemCoreClock / 1000)) { // SysTick 1mSec + : // Handle Error + } + timer1_init (); // setup device-specific timer +} + + +// The processor clock is initialized by CMSIS startup + system file +void main (void) { // user application starts here + Device_Initialization (); // Configure & Initialize MCU + while (1) { // Endless Loop (the Super-Loop) + __disable_irq (); // Disable all interrupts + Get_InputValues (); // Read Values + __enable_irq (); // Enable all interrupts + Calculation_Response (); // Calculate Results + Output_Response (); // Output Results + WaitForTick (); // Synchronize to SysTick Timer + } +} +
![]() |
+
+
+ CMSIS-CORE
+ Version 3.01
+
+ CMSIS-CORE support for Cortex-M processor-based devices
+ |
+
+
+
+
| APSR_Type | Union type to access the Application Program Status Register (APSR) |
| CONTROL_Type | Union type to access the Control Registers (CONTROL) |
| CoreDebug_Type | Structure type to access the Core Debug Register (CoreDebug) |
| DWT_Type | Structure type to access the Data Watchpoint and Trace Register (DWT) |
| FPU_Type | Structure type to access the Floating Point Unit (FPU) |
| IPSR_Type | Union type to access the Interrupt Program Status Register (IPSR) |
| ITM_Type | Structure type to access the Instrumentation Trace Macrocell Register (ITM) |
| MPU_Type | Structure type to access the Memory Protection Unit (MPU) |
| NVIC_Type | Structure type to access the Nested Vectored Interrupt Controller (NVIC) |
| SCB_Type | Structure type to access the System Control Block (SCB) |
| SCnSCB_Type | Structure type to access the System Control and ID Register not in the SCB |
| SysTick_Type | Structure type to access the System Timer (SysTick) |
| TPI_Type | Structure type to access the Trace Port Interface Register (TPI) |
| xPSR_Type | Union type to access the Special-Purpose Program Status Registers (xPSR) |
![]() |
+
+
+ CMSIS-CORE
+ Version 3.01
+
+ CMSIS-CORE support for Cortex-M processor-based devices
+ |
+
+
+
+
![]() |
+
+
+ CMSIS-CORE
+ Version 3.01
+
+ CMSIS-CORE support for Cortex-M processor-based devices
+ |
+
+
+
+
The Device Header File <device.h> contains the following sections that are device specific:
+Reference describes the standard features and functions of the Device Header File <device.h> in detail.
+Device Header File <device.h> contains the enumeration IRQn_Type that defines all exceptions and interrupts of the device.
+Example:
+The following example shows the extension of the interrupt vector table for the LPC1100 device family.
+typedef enum IRQn +{ +/****** Cortex-M0 Processor Exceptions Numbers ***************************************************/ + NonMaskableInt_IRQn = -14, + HardFault_IRQn = -13, + SVCall_IRQn = -5, + PendSV_IRQn = -2, + SysTick_IRQn = -1, +/****** LPC11xx/LPC11Cxx Specific Interrupt Numbers **********************************************/ + WAKEUP0_IRQn = 0, + WAKEUP1_IRQn = 1, + WAKEUP2_IRQn = 2, + : : + : : + EINT1_IRQn = 30, + EINT0_IRQn = 31, +} IRQn_Type; +
The Device Header File <device.h> configures the Cortex-M or SecurCore processor and the core peripherals with #defines that are set prior to including the file core_<cpu>.h.
+The following tables list the #defines along with the possible values for each processor core. If these #defines are missing default values are used.
+core_cm0.h
+| #define | Value Range | Default | Description |
|---|---|---|---|
| __CM0_REV | 0x0000 | 0x0000 | Core revision number ([15:8] revision number, [7:0] patch number) |
| __NVIC_PRIO_BITS | 2 | 2 | Number of priority bits implemented in the NVIC (device specific) |
| __Vendor_SysTickConfig | 0 .. 1 | 0 | If this define is set to 1, then the default SysTick_Config function is excluded. In this case, the file device.h must contain a vendor specific implementation of this function. |
core_cm0plus.h
+| #define | Value Range | Default | Description |
|---|---|---|---|
| __CM0PLUS_REV | 0x0000 | 0x0000 | Core revision number ([15:8] revision number, [7:0] patch number) |
| __NVIC_PRIO_BITS | 2 | 2 | Number of priority bits implemented in the NVIC (device specific) |
| __Vendor_SysTickConfig | 0 .. 1 | 0 | If this define is set to 1, then the default SysTick_Config function is excluded. In this case, the file device.h must contain a vendor specific implementation of this function. |
core_cm3.h
+| #define | Value Range | Default | Description |
|---|---|---|---|
| __CM3_REV | 0x0101 | 0x0200 | 0x0200 | Core revision number ([15:8] revision number, [7:0] patch number) |
| __NVIC_PRIO_BITS | 2 .. 8 | 4 | Number of priority bits implemented in the NVIC (device specific) |
| __MPU_PRESENT | 0 .. 1 | 0 | Defines if a MPU is present or not |
| __Vendor_SysTickConfig | 0 .. 1 | 0 | If this define is set to 1, then the default SysTick_Config function is excluded. In this case, the file device.h must contain a vendor specific implementation of this function. |
core_cm4.h
+| #define | Value Range | Default | Description |
|---|---|---|---|
| __CM4_REV | 0x0000 | 0x0000 | Core revision number ([15:8] revision number, [7:0] patch number) |
| __NVIC_PRIO_BITS | 2 .. 8 | 4 | Number of priority bits implemented in the NVIC (device specific) |
| __MPU_PRESENT | 0 .. 1 | 0 | Defines if a MPU is present or not |
| __FPU_PRESENT | 0 .. 1 | 0 | Defines if a FPU is present or not |
| __Vendor_SysTickConfig | 0 .. 1 | 0 | If this define is set to 1, then the default SysTick_Config function is excluded. In this case, the file device.h must contain a vendor specific implementation of this function. |
core_sc000.h
+| #define | Value Range | Default | Description |
|---|---|---|---|
| __SC000_REV | 0x0000 | 0x0000 | Core revision number ([15:8] revision number, [7:0] patch number) |
| __NVIC_PRIO_BITS | 2 | 2 | Number of priority bits implemented in the NVIC (device specific) |
| __MPU_PRESENT | 0 .. 1 | 0 | Defines if a MPU is present or not |
| __Vendor_SysTickConfig | 0 .. 1 | 0 | If this define is set to 1, then the default SysTick_Config function is excluded. In this case, the file device.h must contain a vendor specific implementation of this function. |
core_sc300.h
+| #define | Value Range | Default | Description |
|---|---|---|---|
| __SC300_REV | 0x0000 | 0x0000 | Core revision number ([15:8] revision number, [7:0] patch number) |
| __NVIC_PRIO_BITS | 2 .. 8 | 4 | Number of priority bits implemented in the NVIC (device specific) |
| __MPU_PRESENT | 0 .. 1 | 0 | Defines if a MPU is present or not |
| __Vendor_SysTickConfig | 0 .. 1 | 0 | If this define is set to 1, then the default SysTick_Config function is excluded. In this case, the file device.h must contain a vendor specific implementation of this function. |
Example
+The following code exemplifies the configuration of the Cortex-M4 Processor and Core Peripherals.
+#define __CM4_REV 0x0001 /* Core revision r0p1 */ +#define __MPU_PRESENT 1 /* MPU present or not */ +#define __NVIC_PRIO_BITS 3 /* Number of Bits used for Priority Levels */ +#define __Vendor_SysTickConfig 0 /* Set to 1 if different SysTick Config is used */ +#define __FPU_PRESENT 1 /* FPU present or not */ +. +. +#include <core_cm4.h> /* Cortex-M4 processor and core peripherals */ +
Defines in the core_cpu.h file identify the version of the CMSIS-CORE and the processor used. The following shows the defines in the various core_cpu.h files that may be used in the Device Header File <device.h> to verify a minimum version or ensure that the right processor core is used.
+core_cm0.h
+#define __CM0_CMSIS_VERSION_MAIN (0x03) /* [31:16] CMSIS HAL main version */ +#define __CM0_CMSIS_VERSION_SUB (0x00) /* [15:0] CMSIS HAL sub version */ +#define __CM0_CMSIS_VERSION ((__CM0_CMSIS_VERSION_MAIN << 16) | \ + __CM0_CMSIS_VERSION_SUB ) /* CMSIS HAL version number */ +... +#define __CORTEX_M (0x00) /* Cortex-M Core */ +
core_cm0plus.h
+#define __CM0PLUS_CMSIS_VERSION_MAIN (0x03) /* [31:16] CMSIS HAL main version */ +#define __CM0PLUS_CMSIS_VERSION_SUB (0x00) /* [15:0] CMSIS HAL sub version */ +#define __CM0PLUS_CMSIS_VERSION ((__CM0P_CMSIS_VERSION_MAIN << 16) | \ + __CM0P_CMSIS_VERSION_SUB ) /* CMSIS HAL version number */ +... +#define __CORTEX_M (0x00) /* Cortex-M Core */ +
core_cm3.h
+#define __CM3_CMSIS_VERSION_MAIN (0x03) /* [31:16] CMSIS HAL main version */ +#define __CM3_CMSIS_VERSION_SUB (0x00) /* [15:0] CMSIS HAL sub version */ +#define __CM3_CMSIS_VERSION ((__CM3_CMSIS_VERSION_MAIN << 16) | \ + __CM3_CMSIS_VERSION_SUB ) /* CMSIS HAL version number */ +... +#define __CORTEX_M (0x03) /* Cortex-M Core */ +
core_cm4.h
+#define __CM4_CMSIS_VERSION_MAIN (0x03) /* [31:16] CMSIS HAL main version */ +#define __CM4_CMSIS_VERSION_SUB (0x00) /* [15:0] CMSIS HAL sub version */ +#define __CM4_CMSIS_VERSION ((__CM4_CMSIS_VERSION_MAIN << 16) | \ + __CM4_CMSIS_VERSION_SUB ) /* CMSIS HAL version number */ +... +#define __CORTEX_M (0x04) /* Cortex-M Core */ +
core_sc000.h
+#define __SC000_CMSIS_VERSION_MAIN (0x03) /* [31:16] CMSIS HAL main version */ +#define __SC000_CMSIS_VERSION_SUB (0x00) /* [15:0] CMSIS HAL sub version */ +#define __SC000_CMSIS_VERSION ((__SC000_CMSIS_VERSION_MAIN << 16) | \ + __SC000_CMSIS_VERSION_SUB ) /* CMSIS HAL version number */ +... +#define __CORTEX_SC (0) /* Cortex secure core */ +
core_sc300.h
+#define __SC300_CMSIS_VERSION_MAIN (0x03) /* [31:16] CMSIS HAL main version */ +#define __SC300_CMSIS_VERSION_SUB (0x00) /* [15:0] CMSIS HAL sub version */ +#define __SC300_CMSIS_VERSION ((__SC300_CMSIS_VERSION_MAIN << 16) | \ + __SC300_CMSIS_VERSION_SUB ) /* CMSIS HAL version number */ +... +#define __CORTEX_SC (300) /* Cortex secure core */ +
The Device Header File <device.h> contains for each peripheral:
+The section Peripheral Access shows examples for peripheral definitions.
+The silicon vendor needs to extend the Device.h template file with the CMSIS features described above. In addition the Device Header File <device.h> may contain functions to access device-specific peripherals. The system_Device.h Template File which is provided as part of the CMSIS specification is shown below.
+/**************************************************************************//**
+ * @file <Device>.h
+ * @brief CMSIS Cortex-M# Core Peripheral Access Layer Header File for
+ * Device <Device>
+ * @version V3.01
+ * @date 06. March 2012
+ *
+ * @note
+ * Copyright (C) 2010-2012 ARM Limited. All rights reserved.
+ *
+ * @par
+ * ARM Limited (ARM) is supplying this software for use with Cortex-M
+ * processor based microcontrollers. This file can be freely distributed
+ * within development tools that are supporting such ARM based processors.
+ *
+ * @par
+ * THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
+ * OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
+ * ARM SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
+ * CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
+ *
+ ******************************************************************************/
+
+
+#ifndef <Device>_H /* ToDo: replace '<Device>' with your device name */
+#define <Device>_H
+
+#ifdef __cplusplus
+ extern "C" {
+#endif
+
+/* ToDo: replace '<Device>' with your device name; add your doxyGen comment */
+/** @addtogroup <Device>_Definitions <Device> Definitions
+ This file defines all structures and symbols for <Device>:
+ - registers and bitfields
+ - peripheral base address
+ - peripheral ID
+ - Peripheral definitions
+ @{
+*/
+
+
+/******************************************************************************/
+/* Processor and Core Peripherals */
+/******************************************************************************/
+/** @addtogroup <Device>_CMSIS Device CMSIS Definitions
+ Configuration of the Cortex-M# Processor and Core Peripherals
+ @{
+*/
+
+/*
+ * ==========================================================================
+ * ---------- Interrupt Number Definition -----------------------------------
+ * ==========================================================================
+ */
+
+typedef enum IRQn
+{
+/****** Cortex-M# Processor Exceptions Numbers ***************************************************/
+
+/* ToDo: use this Cortex interrupt numbers if your device is a CORTEX-M0 device */
+ NonMaskableInt_IRQn = -14, /*!< 2 Non Maskable Interrupt */
+ HardFault_IRQn = -13, /*!< 3 Hard Fault Interrupt */
+ SVCall_IRQn = -5, /*!< 11 SV Call Interrupt */
+ PendSV_IRQn = -2, /*!< 14 Pend SV Interrupt */
+ SysTick_IRQn = -1, /*!< 15 System Tick Interrupt */
+
+/* ToDo: use this Cortex interrupt numbers if your device is a CORTEX-M3 / Cortex-M4 device */
+ NonMaskableInt_IRQn = -14, /*!< 2 Non Maskable Interrupt */
+ MemoryManagement_IRQn = -12, /*!< 4 Memory Management Interrupt */
+ BusFault_IRQn = -11, /*!< 5 Bus Fault Interrupt */
+ UsageFault_IRQn = -10, /*!< 6 Usage Fault Interrupt */
+ SVCall_IRQn = -5, /*!< 11 SV Call Interrupt */
+ DebugMonitor_IRQn = -4, /*!< 12 Debug Monitor Interrupt */
+ PendSV_IRQn = -2, /*!< 14 Pend SV Interrupt */
+ SysTick_IRQn = -1, /*!< 15 System Tick Interrupt */
+
+/****** Device Specific Interrupt Numbers ********************************************************/
+/* ToDo: add here your device specific external interrupt numbers
+ according the interrupt handlers defined in startup_Device.s
+ eg.: Interrupt for Timer#1 TIM1_IRQHandler -> TIM1_IRQn */
+ <DeviceInterrupt>_IRQn = 0, /*!< Device Interrupt */
+} IRQn_Type;
+
+
+/*
+ * ==========================================================================
+ * ----------- Processor and Core Peripheral Section ------------------------
+ * ==========================================================================
+ */
+
+/* Configuration of the Cortex-M# Processor and Core Peripherals */
+/* ToDo: set the defines according your Device */
+/* ToDo: define the correct core revision
+ __CM0_REV if your device is a CORTEX-M0 device
+ __CM3_REV if your device is a CORTEX-M3 device
+ __CM4_REV if your device is a CORTEX-M4 device */
+#define __CM#_REV 0x0201 /*!< Core Revision r2p1 */
+#define __NVIC_PRIO_BITS 2 /*!< Number of Bits used for Priority Levels */
+#define __Vendor_SysTickConfig 0 /*!< Set to 1 if different SysTick Config is used */
+#define __MPU_PRESENT 0 /*!< MPU present or not */
+/* ToDo: define __FPU_PRESENT if your devise is a CORTEX-M4 */
+#define __FPU_PRESENT 0 /*!< FPU present or not */
+
+/*@}*/ /* end of group <Device>_CMSIS */
+
+
+/* ToDo: include the correct core_cm#.h file
+ core_cm0.h if your device is a CORTEX-M0 device
+ core_cm3.h if your device is a CORTEX-M3 device
+ core_cm4.h if your device is a CORTEX-M4 device */
+#include <core_cm#.h> /* Cortex-M# processor and core peripherals */
+/* ToDo: include your system_<Device>.h file
+ replace '<Device>' with your device name */
+#include "system_<Device>.h" /* <Device> System include file */
+
+
+/******************************************************************************/
+/* Device Specific Peripheral registers structures */
+/******************************************************************************/
+/** @addtogroup <Device>_Peripherals <Device> Peripherals
+ <Device> Device Specific Peripheral registers structures
+ @{
+*/
+
+#if defined ( __CC_ARM )
+#pragma anon_unions
+#endif
+
+/* ToDo: add here your device specific peripheral access structure typedefs
+ following is an example for a timer */
+
+/*------------- 16-bit Timer/Event Counter (TMR) -----------------------------*/
+/** @addtogroup <Device>_TMR <Device> 16-bit Timer/Event Counter (TMR)
+ @{
+*/
+typedef struct
+{
+ __IO uint32_t EN; /*!< Offset: 0x0000 Timer Enable Register */
+ __IO uint32_t RUN; /*!< Offset: 0x0004 Timer RUN Register */
+ __IO uint32_t CR; /*!< Offset: 0x0008 Timer Control Register */
+ __IO uint32_t MOD; /*!< Offset: 0x000C Timer Mode Register */
+ uint32_t RESERVED0[1];
+ __IO uint32_t ST; /*!< Offset: 0x0014 Timer Status Register */
+ __IO uint32_t IM; /*!< Offset: 0x0018 Interrupt Mask Register */
+ __IO uint32_t UC; /*!< Offset: 0x001C Timer Up Counter Register */
+ __IO uint32_t RG0 /*!< Offset: 0x0020 Timer Register */
+ uint32_t RESERVED1[2];
+ __IO uint32_t CP; /*!< Offset: 0x002C Capture register */
+} <DeviceAbbreviation>_TMR_TypeDef;
+/*@}*/ /* end of group <Device>_TMR */
+
+
+#if defined ( __CC_ARM )
+#pragma no_anon_unions
+#endif
+
+/*@}*/ /* end of group <Device>_Peripherals */
+
+
+/******************************************************************************/
+/* Peripheral memory map */
+/******************************************************************************/
+/* ToDo: add here your device peripherals base addresses
+ following is an example for timer */
+/** @addtogroup <Device>_MemoryMap <Device> Memory Mapping
+ @{
+*/
+
+/* Peripheral and SRAM base address */
+#define <DeviceAbbreviation>_FLASH_BASE (0x00000000UL) /*!< (FLASH ) Base Address */
+#define <DeviceAbbreviation>_SRAM_BASE (0x20000000UL) /*!< (SRAM ) Base Address */
+#define <DeviceAbbreviation>_PERIPH_BASE (0x40000000UL) /*!< (Peripheral) Base Address */
+
+/* Peripheral memory map */
+#define <DeviceAbbreviation>TIM0_BASE (<DeviceAbbreviation>_PERIPH_BASE) /*!< (Timer0 ) Base Address */
+#define <DeviceAbbreviation>TIM1_BASE (<DeviceAbbreviation>_PERIPH_BASE + 0x0800) /*!< (Timer1 ) Base Address */
+#define <DeviceAbbreviation>TIM2_BASE (<DeviceAbbreviation>_PERIPH_BASE + 0x1000) /*!< (Timer2 ) Base Address */
+/*@}*/ /* end of group <Device>_MemoryMap */
+
+
+/******************************************************************************/
+/* Peripheral declaration */
+/******************************************************************************/
+/* ToDo: add here your device peripherals pointer definitions
+ following is an example for timer */
+
+/** @addtogroup <Device>_PeripheralDecl <Device> Peripheral Declaration
+ @{
+*/
+
+#define <DeviceAbbreviation>_TIM0 ((<DeviceAbbreviation>_TMR_TypeDef *) <DeviceAbbreviation>TIM0_BASE)
+#define <DeviceAbbreviation>_TIM1 ((<DeviceAbbreviation>_TMR_TypeDef *) <DeviceAbbreviation>TIM0_BASE)
+#define <DeviceAbbreviation>_TIM2 ((<DeviceAbbreviation>_TMR_TypeDef *) <DeviceAbbreviation>TIM0_BASE)
+/*@}*/ /* end of group <Device>_PeripheralDecl */
+
+/*@}*/ /* end of group <Device>_Definitions */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* <Device>_H */
+![]() |
+
+
+ CMSIS-CORE
+ Version 3.01
+
+ CMSIS-CORE support for Cortex-M processor-based devices
+ |
+
+
+
+
![]() |
+
+
+ CMSIS-CORE
+ Version 3.01
+
+ CMSIS-CORE support for Cortex-M processor-based devices
+ |
+
+
+
+
![]() |
+
+
+ CMSIS-CORE
+ Version 3.01
+
+ CMSIS-CORE support for Cortex-M processor-based devices
+ |
+
+
+
+
![]() |
+
+
+ CMSIS-CORE
+ Version 3.01
+
+ CMSIS-CORE support for Cortex-M processor-based devices
+ |
+
+
+
+
![]() |
+
+
+ CMSIS-CORE
+ Version 3.01
+
+ CMSIS-CORE support for Cortex-M processor-based devices
+ |
+
+
+
+
![]() |
+
+
+ CMSIS-CORE
+ Version 3.01
+
+ CMSIS-CORE support for Cortex-M processor-based devices
+ |
+
+
+
+
![]() |
+
+
+ CMSIS-CORE
+ Version 3.01
+
+ CMSIS-CORE support for Cortex-M processor-based devices
+ |
+
+
+
+
![]() |
+
+
+ CMSIS-CORE
+ Version 3.01
+
+ CMSIS-CORE support for Cortex-M processor-based devices
+ |
+
+
+
+
+Functions | |
| uint32_t | __get_CONTROL (void) |
| Read the CONTROL register. | |
| void | __set_CONTROL (uint32_t control) |
| Set the CONTROL Register. | |
| uint32_t | __get_IPSR (void) |
| Read the IPSR register. | |
| uint32_t | __get_APSR (void) |
| Read the APSR register. | |
| uint32_t | __get_xPSR (void) |
| Read the xPSR register. | |
| uint32_t | __get_PSP (void) |
| Read the PSP register. | |
| void | __set_PSP (uint32_t topOfProcStack) |
| Set the PSP register. | |
| uint32_t | __get_MSP (void) |
| Read the MSP register. | |
| void | __set_MSP (uint32_t topOfMainStack) |
| Set the MSP register. | |
| uint32_t | __get_PRIMASK (void) |
| Read the PRIMASK register bit. | |
| void | __set_PRIMASK (uint32_t priMask) |
| Set the Priority Mask bit. | |
| uint32_t | __get_BASEPRI (void) |
| Read the BASEPRI register [not for Cortex-M0 variants]. | |
| void | __set_BASEPRI (uint32_t basePri) |
| Set the BASEPRI register [not for Cortex-M0 variants]. | |
| uint32_t | __get_FAULTMASK (void) |
| Read the FAULTMASK register [not for Cortex-M0 variants]. | |
| void | __set_FAULTMASK (uint32_t faultMask) |
| Set the FAULTMASK register [not for Cortex-M0 variants]. | |
| uint32_t | __get_FPSCR (void) |
| Read the FPSCR register [only for Cortex-M4]. | |
| void | __set_FPSCR (uint32_t fpscr) |
| Set the FPSC register [only for Cortex-M4]. | |
| void | __enable_irq (void) |
| Globally enables interrupts and configurable fault handlers. | |
| void | __disable_irq (void) |
| Globally disables interrupts and configurable fault handlers. | |
| void | __enable_fault_irq (void) |
| Enables interrupts and all fault handlers [not for Cortex-M0 variants]. | |
| void | __disable_fault_irq (void) |
| Disables interrupts and all fault handlers [not for Cortex-M0 variants]. | |
The following functions provide access to Cortex-M core registers.
+| void __disable_fault_irq | +( | +void | +) | ++ |
The function disables interrupts and all fault handlers by setting the F-bit in the CPSR. The function uses the instruction CPSID f.
+| void __disable_irq | +( | +void | +) | ++ |
The function disables interrupts and all configurable fault handlers by setting the I-bit in the CPSR. The function uses the instruction CPSID i.
+| void __enable_fault_irq | +( | +void | +) | ++ |
The function enables interrupts and all fault handlers by clearing the F-bit in the CPSR. The function uses the instruction CPSIE f.
+| void __enable_irq | +( | +void | +) | ++ |
The function enables interrupts and all configurable fault handlers by clearing the I-bit in the CPSR. The function uses the instruction CPSIE i.
+| uint32_t __get_APSR | +( | +void | +) | ++ |
The function reads the Application Program Status Register (APSR) using the instruction MRS.
+
+ The APSR contains the current state of the condition flags from instructions executed previously. The APSR is essential for controlling conditional branches. The following flags are used:
SEL instruction to perform byte-based selection from two registers.| uint32_t __get_BASEPRI | +( | +void | +) | ++ |
The function returns the Base Priority Mask register (BASEPRI) using the instruction MRS.
+
+ BASEPRI defines the minimum priority for exception processing. When BASEPRI is set to a non-zero value, it prevents the activation of all exceptions with the same or lower priority level as the BASEPRI value.
| uint32_t __get_CONTROL | +( | +void | +) | ++ |
The function reads the CONTROL register value using the instruction MRS.
+
+ The CONTROL register controls the stack used and the privilege level for software execution when the processor is in thread mode and, if implemented, indicates whether the FPU state is active. This register uses the following bits:
+
| uint32_t __get_FAULTMASK | +( | +void | +) | ++ |
The function reads the Fault Mask register (FAULTMASK) value using the instruction MRS.
+
+ FAULTMASK prevents activation of all exceptions except for the Non-Maskable Interrupt (NMI).
| uint32_t __get_FPSCR | +( | +void | +) | ++ |
The function reads the Floating-Point Status Control Register (FPSCR) value.
+
+ FPSCR provides all necessary User level controls of the floating-point system.
| uint32_t __get_IPSR | +( | +void | +) | ++ |
The function reads the Interrupt Program Status Register (IPSR) using the instruction MRS.
+
+ The ISPR contains the exception type number of the current Interrupt Service Routine (ISR). Each exception has an assocciated unique IRQn number. The following bits are used:
| uint32_t __get_MSP | +( | +void | +) | ++ |
The function reads the Main Status Pointer (MSP) value using the instruction MRS.
+
+ Physically two different stack pointers (SP) exist:
Register R13 banks the SP. The SP selection is determined by the bit[1] of the CONTROL register:
+| uint32_t __get_PRIMASK | +( | +void | +) | ++ |
The function reads the Priority Mask register (PRIMASK) value using the instruction MRS.
+
+ PRIMASK is a 1-bit-wide interrupt mask register. When set, it blocks all interrupts apart from the non-maskable interrupt (NMI) and the hard fault exception. The PRIMASK prevents activation of all exceptions with configurable priority.
| uint32_t __get_PSP | +( | +void | +) | ++ |
The function reads the Program Status Pointer (PSP) value using the instruction MRS.
+
+ Physically two different stack pointers (SP) exist:
Register R13 banks the SP. The SP selection is determined by the bit[1] of the CONTROL register:
+| uint32_t __get_xPSR | +( | +void | +) | ++ |
The function reads the combined Program Status Register (xPSR) using the instruction MRS.
+
+ xPSR provides information about program execution and the APSR flags. It consists of the following PSRs:
In addition to the flags described in __get_APSR and __get_IPSR, the register provides the following flags:
+| void __set_BASEPRI | +( | +uint32_t | +basePri | ) | ++ |
The function sets the Base Priority Mask register (BASEPRI) value using the instruction MSR.
+
+ BASEPRI defines the minimum priority for exception processing. When BASEPRI is set to a non-zero value, it prevents the activation of all exceptions with the same or lower priority level as the BASEPRI value.
| [in] | basePri | BASEPRI value to set |
| void __set_CONTROL | +( | +uint32_t | +control | ) | ++ |
The function sets the CONTROL register value using the instruction MSR.
+
+ The CONTROL register controls the stack used and the privilege level for software execution when the processor is in thread mode and, if implemented, indicates whether the FPU state is active. This register uses the following bits:
+
| [in] | control | CONTROL register value to set |
| void __set_FAULTMASK | +( | +uint32_t | +faultMask | ) | ++ |
The function sets the Fault Mask register (FAULTMASK) value using the instruction MSR.
+
+ FAULTMASK prevents activation of all exceptions except for Non-Maskable Interrupt (NMI). FAULTMASK can be used to escalate a configurable fault handler (BusFault, usage fault, or memory management fault) to hard fault level without invoking a hard fault. This allows the fault handler to pretend to be the hard fault handler, whith the ability to:
| [in] | faultMask | FAULTMASK register value to set |
| void __set_FPSCR | +( | +uint32_t | +fpscr | ) | ++ |
The function sets the Floating-Point Status Control Register (FPSCR) value.
+
+ FPSCR provides all necessary User level control of the floating-point system.
+
| [in] | fpscr | FPSCR value to set |
| void __set_MSP | +( | +uint32_t | +topOfMainStack | ) | ++ |
The function sets the Main Status Pointer (MSP) value using the instruction MSR.
+
+ Physically two different stack pointers (SP) exist:
Register R13 banks the SP. The SP selection is determined by the bit[1] of the CONTROL register:
+| [in] | topOfMainStack | MSP value to set |
| void __set_PRIMASK | +( | +uint32_t | +priMask | ) | ++ |
The function sets the Priority Mask register (PRIMASK) value using the instruction MSR.
+
+ PRIMASK is a 1-bit-wide interrupt mask register. When set, it blocks all interrupts apart from the non-maskable interrupt (NMI) and the hard fault exception. The PRIMASK prevents activation of all exceptions with configurable priority.
| [in] | priMask | Priority Mask
|
| void __set_PSP | +( | +uint32_t | +topOfProcStack | ) | ++ |
The function sets the Program Status Pointer (PSP) value using the instruction MSR.
+
+ Physically two different stack pointers (SP) exist:
Register R13 banks the SP. The SP selection is determined by the bit[1] of the CONTROL register:
+| [in] | topOfProcStack | PSP value to set |
![]() |
+
+
+ CMSIS-CORE
+ Version 3.01
+
+ CMSIS-CORE support for Cortex-M processor-based devices
+ |
+
+
+
+
+Variables | |
| volatile int32_t | ITM_RxBuffer |
| external variable to receive characters | |
+Functions | |
| uint32_t | ITM_SendChar (uint32_t ch) |
| Transmits a character via channel 0. | |
| int32_t | ITM_ReceiveChar (void) |
| ITM Receive Character. | |
| int32_t | ITM_CheckChar (void) |
| ITM Check Character. | |
CMSIS provides additional debug functions to enlarge the Debug Access. Data can be transmitted via a certain global buffer variable towards the target system.
+The Cortex-M3 / Cortex-M4 incorporates the Instrumented Trace Macrocell (ITM) that provides together with the Serial Viewer Output (SVO) trace capabilities for the microcontroller system. The ITM has 32 communication channels; two ITM communication channels are used by CMSIS to output the following information:
+In a debug session, uVision uses the Debug (printf) Viewer window to display data.
+Direction: Microcontroller --> uVision:
+Direction: uVision --> Microcontroller:
+Example for the usage of the ITM Channel 31 for RTOS Kernels:
+// check if debugger connected and ITM channel enabled for tracing +if ((CoreDebug->DEMCR & CoreDebug_DEMCR_TRCENA) && + (ITM->TCR & ITM_TCR_ITMENA) && + (ITM->TER & (1UL >> 31))) { + + // transmit trace data + while (ITM->PORT31_U32 == 0); + ITM->PORT[31].u8 = task_id; // id of next task + while (ITM->PORT[31].u32 == 0); + ITM->PORT[31].u32 = task_status; // status information +} +
| volatile int32_t ITM_RxBuffer | +
| int32_t ITM_CheckChar | +( | +void | +) | ++ |
This function reads the external variable ITM_RxBuffer and checks whether a character is available or not.
+| int32_t ITM_ReceiveChar | +( | +void | +) | ++ |
This function inputs a character via the external variable ITM_RxBuffer. It returns when no debugger is connected that has booked the output. It is blocking when a debugger is connected, but the previously sent character has not been transmitted.
+| uint32_t ITM_SendChar | +( | +uint32_t | +ch | ) | ++ |
This function transmits a character via the ITM channel 0. It returns when no debugger is connected that has booked the output. It is blocking when a debugger is connected, but the previously sent character has not been transmitted.
+| [in] | ch | Character to transmit |
![]() |
+
+
+ CMSIS-CORE
+ Version 3.01
+
+ CMSIS-CORE support for Cortex-M processor-based devices
+ |
+
+
+
+
Describes programming of interrupts and exception functions. +More...
++Enumerations | |
| enum | IRQn_Type { + NonMaskableInt_IRQn = -14, + + HardFault_IRQn = -13, + + MemoryManagement_IRQn = -12, + + BusFault_IRQn = -11, + + UsageFault_IRQn = -10, + + SVCall_IRQn = -5, + + DebugMonitor_IRQn = -4, + + PendSV_IRQn = -2, + + SysTick_IRQn = -1, + + WWDG_STM_IRQn = 0, + + PVD_STM_IRQn = 1 + + } |
| Definition of IRQn numbers. More... | |
+Functions | |
| void | NVIC_SetPriorityGrouping (uint32_t PriorityGroup) |
| Set priority grouping [not for Cortex-M0 variants]. | |
| uint32_t | NVIC_GetPriorityGrouping (void) |
| Read the priority grouping [not for Cortex-M0 variants]. | |
| void | NVIC_EnableIRQ (IRQn_Type IRQn) |
| Enable an external interrupt. | |
| void | NVIC_DisableIRQ (IRQn_Type IRQn) |
| Disable an external interrupt. | |
| uint32_t | NVIC_GetPendingIRQ (IRQn_Type IRQn) |
| Get the pending interrupt. | |
| void | NVIC_SetPendingIRQ (IRQn_Type IRQn) |
| Set an interrupt to pending. | |
| void | NVIC_ClearPendingIRQ (IRQn_Type IRQn) |
| Clear an interrupt from pending. | |
| uint32_t | NVIC_GetActive (IRQn_Type IRQn) |
| Get the interrupt active status [not for Cortex-M0 variants]. | |
| void | NVIC_SetPriority (IRQn_Type IRQn, uint32_t priority) |
| Set the priority for an interrupt. | |
| uint32_t | NVIC_GetPriority (IRQn_Type IRQn) |
| Get the priority of an interrupt. | |
| uint32_t | NVIC_EncodePriority (uint32_t PriorityGroup, uint32_t PreemptPriority, uint32_t SubPriority) |
| Encodes Priority [not for Cortex-M0 variants]. | |
| void | NVIC_DecodePriority (uint32_t Priority, uint32_t PriorityGroup, uint32_t *pPreemptPriority, uint32_t *pSubPriority) |
| Decode the interrupt priority [not for Cortex-M0 variants]. | |
| void | NVIC_SystemReset (void) |
| Reset the system. | |
ARM provides a template file startup_device for each supported compiler. The file must be adapted by the silicon vendor to include interrupt vectors for all device-specific interrupt handlers. Each interrupt handler is defined as a weak function to an dummy handler. These interrupt handlers can be used directly in application software without being adapted by the programmer.
+The table below describes the core exception names and their availability in various Cortex-M cores.
+| Core Exception Name | IRQn Value | M0 | M0p | M3 | M4 | SC000 | SC300 | Description |
|---|---|---|---|---|---|---|---|---|
| NonMaskableInt_IRQn | -14 |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ | Non Maskable Interrupt |
| HardFault_IRQn | -13 |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ | Hard Fault Interrupt |
| MemoryManagement_IRQn | -12 |
+
+
+ |
+
+
+ |
+
+
+ | Memory Management Interrupt | |||
| BusFault_IRQn | -11 |
+
+
+ |
+
+
+ |
+
+
+ | Bus Fault Interrupt | |||
| UsageFault_IRQn | -10 |
+
+
+ |
+
+
+ |
+
+
+ | Usage Fault Interrupt | |||
| SVCall_IRQn | -5 |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ | SV Call Interrupt |
| DebugMonitor_IRQn | -4 |
+
+
+ |
+
+
+ |
+
+
+ | Debug Monitor Interrupt | |||
| PendSV_IRQn | -2 |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ | Pend SV Interrupt |
| SysTick_IRQn | -1 |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ |
+
+
+ | System Tick Interrupt |
The following exception names are fixed and define the start of the vector table for Cortex-M0 variants:
+__Vectors DCD __initial_sp ; Top of Stack + DCD Reset_Handler ; Reset Handler + DCD NMI_Handler ; NMI Handler + DCD HardFault_Handler ; Hard Fault Handler + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD SVC_Handler ; SVCall Handler + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD PendSV_Handler ; PendSV Handler + DCD SysTick_Handler ; SysTick Handler +
The following exception names are fixed and define the start of the vector table for a Cortex-M3:
+__Vectors DCD __initial_sp ; Top of Stack + DCD Reset_Handler ; Reset Handler + DCD NMI_Handler ; NMI Handler + DCD HardFault_Handler ; Hard Fault Handler + DCD MemManage_Handler ; MPU Fault Handler + DCD BusFault_Handler ; Bus Fault Handler + DCD UsageFault_Handler ; Usage Fault Handler + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD SVC_Handler ; SVCall Handler + DCD DebugMon_Handler ; Debug Monitor Handler + DCD 0 ; Reserved + DCD PendSV_Handler ; PendSV Handler + DCD SysTick_Handler ; SysTick Handler +
The following is an examples for device-specific interrupts:
+; External Interrupts + DCD WWDG_IRQHandler ; Window Watchdog + DCD PVD_IRQHandler ; PVD through EXTI Line detect + DCD TAMPER_IRQHandler ; Tamper +
Device-specific interrupts must have a dummy function that can be overwritten in user code. Below is an example for this dummy function.
+Default_Handler PROC + EXPORT WWDG_IRQHandler [WEAK] + EXPORT PVD_IRQHandler [WEAK] + EXPORT TAMPER_IRQHandler [WEAK] + : + : + WWDG_IRQHandler + PVD_IRQHandler + TAMPER_IRQHandler + : + : + B . + ENDP +
The user application may simply define an interrupt handler function by using the handler name as shown below.
+void WWDG_IRQHandler(void) +{ + ... +} +
The code below shows the usage of the CMSIS NVIC functions NVIC_SetPriorityGrouping(), NVIC_GetPriorityGrouping(), NVIC_SetPriority(), NVIC_GetPriority(), NVIC_EncodePriority(), and NVIC_DecodePriority() with an LPC1700.
+#include "LPC17xx.h" + +uint32_t priorityGroup; /* Variables to store priority group and priority */ +uint32_t priority; +uint32_t preemptPriority; +uint32_t subPriority; + + +int main (void) { + + NVIC_SetPriorityGrouping(5); /* Set priority group to 5: + Bit[7..6] preempt priority Bits, + Bit[5..3] subpriority Bits + (valid for five priority bits) */ + + priorityGroup = NVIC_GetPriorityGrouping(); /* Get used priority grouping */ + + priority = NVIC_EncodePriority(priorityGroup, 1, 6); /* Encode priority with 6 for subpriority and 1 for preempt priority + Note: priority depends on the used priority grouping */ + + NVIC_SetPriority(UART0_IRQn, priority); /* Set new priority */ + + priority = NVIC_GetPriority(UART0_IRQn); /* Retrieve priority again */ + + NVIC_DecodePriority(priority, priorityGroup, &preemptPriority, &subPriority); + + while(1); +} +
The code below shows the usage of the CMSIS NVIC functions NVIC_EnableIRQ(), NVIC_GetActive() with an LPC1700.
+#include "LPC17xx.h" + +uint32_t active; /* Variable to store interrupt active state */ + + +void TIMER0_IRQHandler(void) { /* Timer 0 interrupt handler */ + + if (LPC_TIM0->IR & (1 << 0)) { /* Check if interrupt for match channel 0 occured */ + LPC_TIM0->IR |= (1 << 0); /* Acknowledge interrupt for match channel 0 occured */ + } + active = NVIC_GetActive(TIMER0_IRQn); /* Get interrupt active state of timer 0 */ +} + + +int main (void) { + /* Set match channel register MR0 to 1 millisecond */ + LPC_TIM0->MR0 = (((SystemCoreClock / 1000) / 4) - 1); /* 1 ms? */ + + LPC_TIM0->MCR = (3 << 0); /* Enable interrupt and reset for match channel MR0 */ + + NVIC_EnableIRQ(TIMER0_IRQn); /* Enable NVIC interrupt for timer 0 */ + + LPC_TIM0->TCR = (1 << 0); /* Enable timer 0 */ + + while(1); +} +
| enum IRQn_Type | +
The core exception enumeration names for IRQn values are defined in the file device.h.
+Negative IRQn values represent processor core exceptions (internal interrupts). Positive IRQn values represent device-specific exceptions (external interrupts). The first device-specific interrupt has the IRQn value 0.
+The table below describes the core exception names and their availability in various Cortex-M cores.
+| void NVIC_ClearPendingIRQ | +( | +IRQn_Type | +IRQn | ) | ++ |
This function removes the pending state of the specified interrupt IRQn. IRQn cannot be a negative number.
+| [in] | IRQn | Interrupt number |
| void NVIC_DecodePriority | +( | +uint32_t | +Priority, | +
| + | + | uint32_t | +PriorityGroup, | +
| + | + | uint32_t * | +pPreemptPriority, | +
| + | + | uint32_t * | +pSubPriority | +
| + | ) | ++ |
This function decodes an interrupt priority value with the priority group PriorityGroup to preemptive priority value pPreemptPriority and subpriority value pSubPriority. In case of a conflict between priority grouping and available priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set.
+| [in] | Priority | Priority |
| [in] | PriorityGroup | Priority group |
| [out] | *pPreemptPriority | Preemptive priority value (starting from 0) |
| [out] | *pSubPriority | Subpriority value (starting from 0) |
| void NVIC_DisableIRQ | +( | +IRQn_Type | +IRQn | ) | ++ |
This function disables the specified device-specific interrupt IRQn. IRQn cannot be a negative value.
+| [in] | IRQn | Number of the external interrupt to disable |
| void NVIC_EnableIRQ | +( | +IRQn_Type | +IRQn | ) | ++ |
This function enables the specified device-specific interrupt IRQn. IRQn cannot be a negative value.
+| [in] | IRQn | Interrupt number |
| uint32_t NVIC_EncodePriority | +( | +uint32_t | +PriorityGroup, | +
| + | + | uint32_t | +PreemptPriority, | +
| + | + | uint32_t | +SubPriority | +
| + | ) | ++ |
This function encodes the priority for an interrupt with the priority group PriorityGroup, preemptive priority value PreemptPriority, and subpriority value SubPriority. In case of a conflict between priority grouping and available priority bits (__NVIC_PRIO_BITS) the smallest possible priority group is set.
+| [in] | PriorityGroup | Priority group |
| [in] | PreemptPriority | Preemptive priority value (starting from 0) |
| [in] | SubPriority | Subpriority value (starting from 0) |
| uint32_t NVIC_GetActive | +( | +IRQn_Type | +IRQn | ) | ++ |
This function reads the Interrupt Active Register (NVIC_IABR0-NVIC_IABR7) in NVIC and returns the active bit of the interrupt IRQn.
+| [in] | IRQn | Interrupt number |
| uint32_t NVIC_GetPendingIRQ | +( | +IRQn_Type | +IRQn | ) | ++ |
This function returns the pending status of the specified interrupt IRQn.
+| [in] | IRQn | Interrupt number |
| uint32_t NVIC_GetPriority | +( | +IRQn_Type | +IRQn | ) | ++ |
This function reads the priority for the specified interrupt IRQn. IRQn can can specify any device-specific (external) interrupt, or core (internal) interrupt.
+The returned priority value is automatically aligned to the implemented priority bits of the microcontroller.
+| [in] | IRQn | Interrupt number |
| uint32_t NVIC_GetPriorityGrouping | +( | +void | +) | ++ |
This functuion returns the priority grouping (flag PRIGROUP in AIRCR[10:8]).
+| void NVIC_SetPendingIRQ | +( | +IRQn_Type | +IRQn | ) | ++ |
This function sets the pending bit for the specified interrupt IRQn. IRQn cannot be a negative value.
+| [in] | IRQn | Interrupt number |
| void NVIC_SetPriority | +( | +IRQn_Type | +IRQn, | +
| + | + | uint32_t | +priority | +
| + | ) | ++ |
Sets the priority for the interrupt specified by IRQn.IRQn can can specify any device-specific (external) interrupt, or core (internal) interrupt. The priority specifies the interrupt priority value, whereby lower values indicate a higher priority. The default priority is 0 for every interrupt. This is the highest possible priority.
+The priority cannot be set for every core interrupt. HardFault and NMI have a fixed (negative) priority that is higher than any configurable exception or interrupt.
+| [in] | IRQn | Interrupt Number |
| [in] | priority | Priority to set |
| void NVIC_SetPriorityGrouping | +( | +uint32_t | +PriorityGroup | ) | ++ |
The function sets the priority grouping PriorityGroup using the required unlock sequence. PriorityGroup is assigned to the field PRIGROUP (register AIRCR[10:8]). This field determines the split of group priority from subpriority. Only values from 0..7 are used. In case of a conflict between priority grouping and available priority bits (__NVIC_PRIO_BITS), the smallest possible priority group is set.
+| [in] | PriorityGroup | Priority group |
| void NVIC_SystemReset | +( | +void | +) | ++ |
This function requests a system reset by setting the SYSRESETREQ flag in the AIRCR register.
+![]() |
+
+
+ CMSIS-CORE
+ Version 3.01
+
+ CMSIS-CORE support for Cortex-M processor-based devices
+ |
+
+
+
+
Initialize and start the SysTick timer. +More...
++Functions | |
| uint32_t | SysTick_Config (uint32_t ticks) |
| System Tick Timer Configuration. | |
The System Tick Time (SysTick) generates interrupt requests on a regular basis. This allows an OS to carry out context switching to support multiple tasking. For applications that do not require an OS, the SysTick can be used for time keeping, time measurement, or as an interrupt source for tasks that need to be executed regularly.
+The code below shows the usage of the function SysTick_Config() with an LPC1700.
+#include "LPC17xx.h" + +uint32_t msTicks = 0; /* Variable to store millisecond ticks */ + + +void SysTick_Handler(void) { /* SysTick interrupt Handler. + msTicks++; See startup file startup_LPC17xx.s for SysTick vector */ +} + + +int main (void) { + uint32_t returnCode; + + returnCode = SysTick_Config(SystemCoreClock / 1000); /* Configure SysTick to generate an interrupt every millisecond */ + + if (returnCode != 0) { /* Check return code for errors */ + // Error Handling + } + + while(1); +} +
| uint32_t SysTick_Config | +( | +uint32_t | +ticks | ) | ++ |
Initialises and starts the System Tick Timer and its interrupt. After this call, the SysTick timer creates interrupts with the specified time interval. Counter is in free running mode to generate periodical interrupts.
+| [in] | ticks | Number of ticks between two interrupts |
![]() |
+
+
+ CMSIS-CORE
+ Version 3.01
+
+ CMSIS-CORE support for Cortex-M processor-based devices
+ |
+
+
+
+
+Functions | |
| void | __NOP (void) |
| No Operation. | |
| void | __WFI (void) |
| Wait For Interrupt. | |
| void | __WFE (void) |
| Wait For Event. | |
| void | __SEV (void) |
| Send Event. | |
| void | __ISB (void) |
| Instruction Synchronization Barrier. | |
| void | __DSB (void) |
| Data Synchronization Barrier. | |
| void | __DMB (void) |
| Data Memory Barrier. | |
| uint32_t | __REV (uint32_t value) |
| Reverse byte order (32 bit) | |
| uint32_t | __REV16 (uint32_t value) |
| Reverse byte order (16 bit) | |
| int32_t | __REVSH (int32_t value) |
| Reverse byte order in signed short value. | |
| uint32_t | __RBIT (uint32_t value) |
| Reverse bit order of value [not for Cortex-M0 variants]. | |
| uint32_t | __ROR (uint32_t value, uint32_t shift) |
| Rotate a value right by a number of bits. | |
| uint8_t | __LDREXB (volatile uint8_t *addr) |
| LDR Exclusive (8 bit) [not for Cortex-M0 variants]. | |
| uint16_t | __LDREXH (volatile uint16_t *addr) |
| LDR Exclusive (16 bit) [not for Cortex-M0 variants]. | |
| uint32_t | __LDREXW (volatile uint32_t *addr) |
| LDR Exclusive (32 bit) [not for Cortex-M0 variants]. | |
| uint32_t | __STREXB (uint8_t value, volatile uint8_t *addr) |
| STR Exclusive (8 bit) [not for Cortex-M0 variants]. | |
| uint32_t | __STREXH (uint16_t value, volatile uint16_t *addr) |
| STR Exclusive (16 bit) [not for Cortex-M0 variants]. | |
| uint32_t | __STREXW (uint32_t value, volatile uint32_t *addr) |
| STR Exclusive (32 bit) [not for Cortex-M0 variants]. | |
| void | __CLREX (void) |
| Remove the exclusive lock [not for Cortex-M0 variants]. | |
| uint32_t | __SSAT (unint32_t value, uint32_t sat) |
| Signed Saturate [not for Cortex-M0 variants]. | |
| uint32_t | __USAT (uint32_t value, uint32_t sat) |
| Unsigned Saturate [not for Cortex-M0 variants]. | |
| uint8_t | __CLZ (uint32_t value) |
| Count leading zeros [not for Cortex-M0 variants]. | |
The following functions generate specific Cortex-M instructions that cannot be directly accessed by the C/C++ Compiler.
+| void __CLREX | +( | +void | +) | ++ |
This function removes the exclusive lock which is created by LDREX [not for Cortex-M0 variants].
+ +| uint8_t __CLZ | +( | +uint32_t | +value | ) | ++ |
This function counts the number of leading zeros of a data value [not for Cortex-M0 variants].
+| [in] | value | Value to count the leading zeros |
| void __DMB | +( | +void | +) | ++ |
This function ensures the apparent order of the explicit memory operations before and after the instruction, without ensuring their completion.
+ +| void __DSB | +( | +void | +) | ++ |
This function acts as a special kind of Data Memory Barrier. It completes when all explicit memory accesses before this instruction complete.
+ +| void __ISB | +( | +void | +) | ++ |
Instruction Synchronization Barrier flushes the pipeline in the processor, so that all instructions following the ISB are fetched from cache or memory, after the instruction has been completed.
+ +| uint8_t __LDREXB | +( | +volatile uint8_t * | +addr | ) | ++ |
This function performs a exclusive LDR command for 8 bit value [not for Cortex-M0 variants].
+| [in] | *addr | Pointer to data |
| uint16_t __LDREXH | +( | +volatile uint16_t * | +addr | ) | ++ |
This function performs a exclusive LDR command for 16 bit values [not for Cortex-M0 variants].
+| [in] | *addr | Pointer to data |
| uint32_t __LDREXW | +( | +volatile uint32_t * | +addr | ) | ++ |
This function performs a exclusive LDR command for 32 bit values [not for Cortex-M0 variants].
+| [in] | *addr | Pointer to data |
| void __NOP | +( | +void | +) | ++ |
This function does nothing. This instruction can be used for code alignment purposes.
+ +| uint32_t __RBIT | +( | +uint32_t | +value | ) | ++ |
This function reverses the bit order of the given value [not for Cortex-M0 variants].
+| [in] | value | Value to reverse |
| uint32_t __REV | +( | +uint32_t | +value | ) | ++ |
This function reverses the byte order in integer value.
+| [in] | value | Value to reverse |
| uint32_t __REV16 | +( | +uint32_t | +value | ) | ++ |
This function reverses the byte order in two unsigned short values.
+| [in] | value | Value to reverse |
| int32_t __REVSH | +( | +int32_t | +value | ) | ++ |
This function reverses the byte order in a signed short value with sign extension to integer.
+| [in] | value | Value to reverse |
| uint32_t __ROR | +( | +uint32_t | +value, | +
| + | + | uint32_t | +shift | +
| + | ) | ++ |
This function rotates a value right by a specified number of bits.
+| [in] | value | Value to be shifted right |
| [in] | shift | Number of bits in the range [1..31] |
| void __SEV | +( | +void | +) | ++ |
Send Event is a hint instruction. It causes an event to be signaled to the CPU.
+ +| uint32_t __SSAT | +( | +unint32_t | +value, | +
| + | + | uint32_t | +sat | +
| + | ) | ++ |
This function saturates a signed value [not for Cortex-M0 variants].
+| [in] | value | Value to be saturated |
| [in] | sat | Bit position to saturate to [1..32] |
| uint32_t __STREXB | +( | +uint8_t | +value, | +
| + | + | volatile uint8_t * | +addr | +
| + | ) | ++ |
This function performs a exclusive STR command for 8 bit values [not for Cortex-M0 variants].
+| [in] | value | Value to store |
| [in] | *addr | Pointer to location |
| uint32_t __STREXH | +( | +uint16_t | +value, | +
| + | + | volatile uint16_t * | +addr | +
| + | ) | ++ |
This function performs a exclusive STR command for 16 bit values [not for Cortex-M0 variants].
+| [in] | value | Value to store |
| [in] | *addr | Pointer to location |
| uint32_t __STREXW | +( | +uint32_t | +value, | +
| + | + | volatile uint32_t * | +addr | +
| + | ) | ++ |
This function performs a exclusive STR command for 32 bit values [not for Cortex-M0 variants].
+| [in] | value | Value to store |
| [in] | *addr | Pointer to location |
| uint32_t __USAT | +( | +uint32_t | +value, | +
| + | + | uint32_t | +sat | +
| + | ) | ++ |
This function saturates an unsigned value [not for Cortex-M0 variants].
+| [in] | value | Value to be saturated |
| [in] | sat | Bit position to saturate to [0..31] |
| void __WFE | +( | +void | +) | ++ |
Wait For Event is a hint instruction that permits the processor to enter a low-power state until an events occurs:
+| void __WFI | +( | +void | +) | ++ |
WFI is a hint instruction that suspends execution until one of the following events occurs:
+![]() |
+
+
+ CMSIS-CORE
+ Version 3.01
+
+ CMSIS-CORE support for Cortex-M processor-based devices
+ |
+
+
+
+
Access to dedicated SIMD instructions. +More...
++Functions | |
| uint32_t | __SADD8 (uint32_t val1, uint32_t val2) |
| GE setting quad 8-bit signed addition. | |
| uint32_t | __QADD8 (uint32_t val1, uint32_t val2) |
| Q setting quad 8-bit saturating addition. | |
| uint32_t | __SHADD8 (uint32_t val1, uint32_t val2) |
| Quad 8-bit signed addition with halved results. | |
| uint32_t | __UADD8 (uint32_t val1, uint32_t val2) |
| GE setting quad 8-bit unsigned addition. | |
| uint32_t | __UQADD8 (uint32_t val1, uint32_t val2) |
| Quad 8-bit unsigned saturating addition. | |
| uint32_t | __UHADD8 (uint32_t val1, uint32_t val2) |
| Quad 8-bit unsigned addition with halved results. | |
| uint32_t | __SSUB8 (uint32_t val1, uint32_t val2) |
| GE setting quad 8-bit signed subtraction. | |
| uint32_t | __QSUB8 (uint32_t val1, uint32_t val2) |
| Q setting quad 8-bit saturating subtract. | |
| uint32_t | __SHSUB8 (uint32_t val1, uint32_t val2) |
| Quad 8-bit signed subtraction with halved results. | |
| uint32_t | __USUB8 (uint32_t val1, uint32_t val2) |
| GE setting quad 8-bit unsigned subtract. | |
| uint32_t | __UQSUB8 (uint32_t val1, uint32_t val2) |
| Quad 8-bit unsigned saturating subtraction. | |
| uint32_t | __UHSUB8 (uint32_t val1, uint32_t val2) |
| Quad 8-bit unsigned subtraction with halved results. | |
| uint32_t | __SADD16 (uint32_t val1, uint32_t val2) |
| GE setting dual 16-bit signed addition. | |
| uint32_t | __QADD16 (uint32_t val1, uint32_t val2) |
| Q setting dual 16-bit saturating addition. | |
| uint32_t | __SHADD16 (uint32_t val1, uint32_t val2) |
| Dual 16-bit signed addition with halved results. | |
| uint32_t | __UADD16 (uint32_t val1, uint32_t val2) |
| GE setting dual 16-bit unsigned addition. | |
| uint32_t | __UQADD16 (uint32_t val1, uint32_t val2) |
| Dual 16-bit unsigned saturating addition. | |
| uint32_t | __UHADD16 (uint32_t val1, uint32_t val2) |
| Dual 16-bit unsigned addition with halved results. | |
| uint32_t | __SSUB16 (uint32_t val1, uint32_t val2) |
| GE setting dual 16-bit signed subtraction. | |
| uint32_t | __QSUB16 (uint32_t val1, uint32_t val2) |
| Q setting dual 16-bit saturating subtract. | |
| uint32_t | __SHSUB16 (uint32_t val1, uint32_t val2) |
| Dual 16-bit signed subtraction with halved results. | |
| uint32_t | __USUB16 (uint32_t val1, uint32_t val2) |
| GE setting dual 16-bit unsigned subtract. | |
| uint32_t | __UQSUB16 (uint32_t val1, uint32_t val2) |
| Dual 16-bit unsigned saturating subtraction. | |
| uint32_t | __UHSUB16 (uint32_t val1, uint32_t val2) |
| Dual 16-bit unsigned subtraction with halved results. | |
| uint32_t | __SASX (uint32_t val1, uint32_t val2) |
| GE setting dual 16-bit addition and subtraction with exchange. | |
| uint32_t | __QASX (uint32_t val1, uint32_t val2) |
| Q setting dual 16-bit add and subtract with exchange. | |
| uint32_t | __SHASX (uint32_t val1, uint32_t val2) |
| Dual 16-bit signed addition and subtraction with halved results. | |
| uint32_t | __UASX (uint32_t val1, uint32_t val2) |
| GE setting dual 16-bit unsigned addition and subtraction with exchange. | |
| uint32_t | __UQASX (uint32_t val1, uint32_t val2) |
| Dual 16-bit unsigned saturating addition and subtraction with exchange. | |
| uint32_t | __UHASX (uint32_t val1, uint32_t val2) |
| Dual 16-bit unsigned addition and subtraction with halved results and exchange. | |
| uint32_t | __SSAX (uint32_t val1, uint32_t val2) |
| GE setting dual 16-bit signed subtraction and addition with exchange. | |
| uint32_t | __QSAX (uint32_t val1, uint32_t val2) |
| Q setting dual 16-bit subtract and add with exchange. | |
| uint32_t | __SHSAX (uint32_t val1, uint32_t val2) |
| Dual 16-bit signed subtraction and addition with halved results. | |
| uint32_t | __USAX (uint32_t val1, uint32_t val2) |
| GE setting dual 16-bit unsigned subtract and add with exchange. | |
| uint32_t | __UQSAX (uint32_t val1, uint32_t val2) |
| Dual 16-bit unsigned saturating subtraction and addition with exchange. | |
| uint32_t | __UHSAX (uint32_t val1, uint32_t val2) |
| Dual 16-bit unsigned subtraction and addition with halved results and exchange. | |
| uint32_t | __USAD8 (uint32_t val1, uint32_t val2) |
| Unsigned sum of quad 8-bit unsigned absolute difference. | |
| uint32_t | __USADA8 (uint32_t val1, uint32_t val2, uint32_t val3) |
| Unsigned sum of quad 8-bit unsigned absolute difference with 32-bit accumulate. | |
| uint32_t | __SSAT16 (uint32_t val1, const uint32_t val2) |
| Q setting dual 16-bit saturate. | |
| uint32_t | __USAT16 (uint32_t val1, const uint32_t val2) |
| Q setting dual 16-bit unsigned saturate. | |
| uint32_t | __UXTB16 (uint32_t val) |
| Dual extract 8-bits and zero-extend to 16-bits. | |
| uint32_t | __UXTAB16 (uint32_t val1, uint32_t val2) |
| Extracted 16-bit to 32-bit unsigned addition. | |
| uint32_t | __SXTB16 (uint32_t val) |
| Dual extract 8-bits and sign extend each to 16-bits. | |
| uint32_t | __SXTAB16 (uint32_t val1, uint32_t val2) |
| Dual extracted 8-bit to 16-bit signed addition. | |
| uint32_t | __SMUAD (uint32_t val1, uint32_t val2) |
| Q setting sum of dual 16-bit signed multiply. | |
| uint32_t | __SMUADX (uint32_t val1, uint32_t val2) |
| Q setting sum of dual 16-bit signed multiply with exchange. | |
| uint32_t | __SMLAD (uint32_t val1, uint32_t val2, uint32_t val3) |
| Q setting dual 16-bit signed multiply with single 32-bit accumulator. | |
| uint32_t | __SMLADX (uint32_t val1, uint32_t val2, uint32_t val3) |
| Q setting pre-exchanged dual 16-bit signed multiply with single 32-bit accumulator. | |
| uint64_t | __SMLALD (uint32_t val1, uint32_t val2, uint64_t val3) |
| Dual 16-bit signed multiply with single 64-bit accumulator. | |
| unsigned long long | __SMLALDX (uint32_t val1, uint32_t val2, unsigned long long val3) |
| Dual 16-bit signed multiply with exchange with single 64-bit accumulator. | |
| uint32_t | __SMUSD (uint32_t val1, uint32_t val2) |
| Dual 16-bit signed multiply returning difference. | |
| uint32_t | __SMUSDX (uint32_t val1, uint32_t val2) |
| Dual 16-bit signed multiply with exchange returning difference. | |
| uint32_t | __SMLSD (uint32_t val1, uint32_t val2, uint32_t val3) |
| Q setting dual 16-bit signed multiply subtract with 32-bit accumulate. | |
| uint32_t | __SMLSDX (uint32_t val1, uint32_t val2, uint32_t val3) |
| Q setting dual 16-bit signed multiply with exchange subtract with 32-bit accumulate. | |
| uint64_t | __SMLSLD (uint32_t val1, uint32_t val2, uint64_t val3) |
| Q setting dual 16-bit signed multiply subtract with 64-bit accumulate. | |
| unsigned long long | __SMLSLDX (uint32_t val1, uint32_t val2, unsigned long long val3) |
| Q setting dual 16-bit signed multiply with exchange subtract with 64-bit accumulate. | |
| uint32_t | __SEL (uint32_t val1, uint32_t val2) |
| Select bytes based on GE bits. | |
| uint32_t | __QADD (uint32_t val1, uint32_t val2) |
| Q setting saturating add. | |
| uint32_t | __QSUB (uint32_t val1, uint32_t val2) |
| Q setting saturating subtract. | |
| uint32_t | __PKHBT (uint32_t val1, uint32_t val2, uint32_t val3) |
| Halfword packing instruction. Combines bits[15:0] of val1 with bits[31:16] of val2 levitated with the val3. | |
| uint32_t | __PKHTB (uint32_t val1, uint32_t val2, uint32_t val3) |
| Halfword packing instruction. Combines bits[31:16] of val1 with bits[15:0] of val2 right-shifted with the val3. | |
Single Instruction Multiple Data (SIMD) extensions are provided only for Cortex-M4 cores to simplify development of application software. SIMD extensions increase the processing capability without materially increasing the power consumption. The SIMD extensions are completely transparent to the operating system (OS), allowing existing OS ports to be used.
+SIMD Features:
+Examples:
+Addition: Add two values using SIMD function
+uint32_t add_halfwords(uint32_t val1, uint32_t val2)
+{
+ return __SADD16(val1, val2);
+}
+Subtraction: Subtract two values using SIMD function
+uint32_t sub_halfwords(uint32_t val1, uint32_t val2)
+{
+ return __SSUB16(val1, val2);
+}
+Multiplication: Performing a multiplication using SIMD function
+uint32_t dual_mul_add_products(uint32_t val1, uint32_t val2)
+{
+ return __SMUAD(val1, val2);
+}
+| uint32_t __PKHBT | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2, | +
| + | + | uint32_t | +val3 | +
| + | ) | ++ |
Combine a halfword from one register with a halfword from another register. The second argument can be left-shifted before extraction of the halfword. The registers PC and SP are not allowed as arguments. This instruction does not change the flags.
+| val1 | first 16-bit operands |
| val2 | second 16-bit operands |
| val3 | value for left-shifting val2. Value range [0..31]. |
res[15:0] = val1[15:0] + res[31:16] = val2[31:16]<<val3 +
| uint32_t __PKHTB | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2, | +
| + | + | uint32_t | +val3 | +
| + | ) | ++ |
Combines a halfword from one register with a halfword from another register. The second argument can be right-shifted before extraction of the halfword. The registers PC and SP are not allowed as arguments. This instruction does not change the flags.
+| val1 | second 16-bit operands |
| val2 | first 16-bit operands |
| val3 | value for right-shifting val2. Value range [1..32]. |
res[15:0] = val2[15:0]>>val3 + res[31:16] = val1[31:16] +
| uint32_t __QADD | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to obtain the saturating add of two integers.
+ The Q bit is set if the operation saturates.
| val1 | first summand of the saturating add operation. |
| val2 | second summand of the saturating add operation. |
res[31:0] = SAT(val1 + SAT(val2 * 2)) +
| uint32_t __QADD16 | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to perform two 16-bit integer arithmetic additions in parallel, saturating the results to the 16-bit signed integer range -215 <= x <= 215 - 1.
+| val1 | first two 16-bit summands. |
| val2 | second two 16-bit summands. |
res[15:0] = val1[15:0] + val2[15:0] + res[31:16] = val1[31:16] + val2[31:16] +
| uint32_t __QADD8 | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to perform four 8-bit integer additions, saturating the results to the 8-bit signed integer range -27 <= x <= 27 - 1.
+| val1 | first four 8-bit summands. |
| val2 | second four 8-bit summands. |
res[7:0] = val1[7:0] + val2[7:0] + res[15:8] = val1[15:8] + val2[15:8] + res[23:16] = val1[23:16] + val2[23:16] + res[31:24] = val1[31:24] + val2[31:24] +
| uint32_t __QASX | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to exchange the halfwords of the one operand, then add the high halfwords and subtract the low halfwords, saturating the results to the 16-bit signed integer range -215 <= x <= 215 - 1.
+| val1 | first operand for the subtraction in the low halfword, and the first operand for the addition in the high halfword. |
| val2 | second operand for the subtraction in the high halfword, and the second operand for the addition in the low halfword. |
res[15:0] = val1[15:0] - val2[31:16] + res[31:16] = val1[31:16] + val2[15:0] +
| uint32_t __QSAX | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to exchange the halfwords of one operand, then subtract the high halfwords and add the low halfwords, saturating the results to the 16-bit signed integer range -215 <= x <= 215 - 1.
+| val1 | first operand for the addition in the low halfword, and the first operand for the subtraction in the high halfword. |
| val2 | second operand for the addition in the high halfword, and the second operand for the subtraction in the low halfword. |
res[15:0] = val1[15:0] + val2[31:16] + res[31:16] = val1[31:16] - val2[15:0] +
| uint32_t __QSUB | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to obtain the saturating subtraction of two integers.
+ The Q bit is set if the operation saturates.
| val1 | minuend of the saturating subtraction operation. |
| val2 | subtrahend of the saturating subtraction operation. |
res[31:0] = SAT(val1 - SAT(val2 * 2)) +
| uint32_t __QSUB16 | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to perform two 16-bit integer subtractions, saturating the results to the 16-bit signed integer range -215 <= x <= 215 - 1.
+| val1 | first two 16-bit operands. |
| val2 | second two 16-bit operands. |
res[15:0] = val1[15:0] - val2[15:0] + res[31:16] = val1[31:16] - val2[31:16] +
| uint32_t __QSUB8 | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to perform four 8-bit integer subtractions, saturating the results to the 8-bit signed integer range -27 <= x <= 27 - 1.
+| val1 | first four 8-bit operands. |
| val2 | second four 8-bit operands. |
res[7:0] = val1[7:0] - val2[7:0] + res[15:8] = val1[15:8] - val2[15:8] + res[23:16] = val1[23:16] - val2[23:16] + res[31:24] = val1[31:24] - val2[31:24] +
| uint32_t __SADD16 | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to perform two 16-bit signed integer additions.
+ The GE bits in the APSR are set according to the results of the additions.
| val1 | first two 16-bit summands. |
| val2 | second two 16-bit summands. |
res[15:0] = val1[15:0] + val2[15:0] + res[31:16] = val1[31:16] + val2[31:16] +
| uint32_t __SADD8 | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function performs four 8-bit signed integer additions. The GE bits of the APSR are set according to the results of the additions.
+| val1 | first four 8-bit summands. |
| val2 | second four 8-bit summands. |
res[7:0] = val1[7:0] + val2[7:0] + res[15:8] = val1[15:8] + val2[15:8] + res[23:16] = val1[23:16] + val2[23:16] + res[31:24] = val1[31:24] + val2[31:24] +
| uint32_t __SASX | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function inserts an SASX instruction into the instruction stream generated by the compiler. It enables you to exchange the halfwords of the second operand, add the high halfwords and subtract the low halfwords.
+ The GE bits in the APRS are set according to the results.
| val1 | first operand for the subtraction in the low halfword, and the first operand for the addition in the high halfword. |
| val2 | second operand for the subtraction in the high halfword, and the second operand for the addition in the low halfword. |
res[15:0] = val1[15:0] - val2[31:16] + res[31:16] = val1[31:16] + val2[15:0] +
| uint32_t __SEL | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function inserts a SEL instruction into the instruction stream generated by the compiler. It enables you to select bytes from the input parameters, whereby the bytes that are selected depend upon the results of previous SIMD instruction function. The results of previous SIMD instruction function are represented by the Greater than or Equal flags in the Application Program Status Register (APSR). The __SEL function works equally well on both halfword and byte operand function results. This is because halfword operand operations set two (duplicate) GE bits per value.
+| val1 | four selectable 8-bit values. |
| val2 | four selectable 8-bit values. |
| uint32_t __SHADD16 | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to perform two signed 16-bit integer additions, halving the results.
+| val1 | first two 16-bit summands. |
| val2 | second two 16-bit summands. |
res[15:0] = val1[15:0] + val2[15:0] >> 1 + res[31:16] = val1[31:16] + val2[31:16] >> 1 +
| uint32_t __SHADD8 | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to perform four signed 8-bit integer additions, halving the results.
+| val1 | first four 8-bit summands. |
| val2 | second four 8-bit summands. |
res[7:0] = val1[7:0] + val2[7:0] >> 1 + res[15:8] = val1[15:8] + val2[15:8] >> 1 + res[23:16] = val1[23:16] + val2[23:16] >> 1 + res[31:24] = val1[31:24] + val2[31:24] >> 1 +
| uint32_t __SHASX | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to exchange the two halfwords of one operand, perform one signed 16-bit integer addition and one signed 16-bit subtraction, and halve the results.
+| val1 | first 16-bit operands. |
| val2 | second 16-bit operands. |
res[15:0] = (val1[15:0] - val2[31:16]) >> 1 + res[31:16] = (val1[31:16] - val2[15:0] ) >> 1 +
| uint32_t __SHSAX | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to exchange the two halfwords of one operand, perform one signed 16-bit integer subtraction and one signed 16-bit addition, and halve the results.
+| val1 | first 16-bit operands. |
| val2 | second 16-bit operands. |
res[15:0] = (val1[15:0] + val2[31:16]) >> 1 + res[31:16] = (val1[31:16] - val2[15:0] ) >> 1 +
| uint32_t __SHSUB16 | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to perform two signed 16-bit integer subtractions, halving the results.
+| val1 | first two 16-bit operands. |
| val2 | second two 16-bit operands. |
res[15:0] = val1[15:0] - val2[15:0] >> 1 + res[31:16] = val1[31:16] - val2[31:16] >> 1 +
| uint32_t __SHSUB8 | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to perform four signed 8-bit integer subtractions, halving the results.
+| val1 | first four 8-bit operands. |
| val2 | second four 8-bit operands. |
res[7:0] = val1[7:0] - val2[7:0] >> 1 + res[15:8] = val1[15:8] - val2[15:8] >> 1 + res[23:16] = val1[23:16] - val2[23:16] >> 1 + res[31:24] = val1[31:24] - val2[31:24] >> 1 +
| uint32_t __SMLAD | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2, | +
| + | + | uint32_t | +val3 | +
| + | ) | ++ |
This function enables you to perform two signed 16-bit multiplications, adding both results to a 32-bit accumulate operand.
+ The Q bit is set if the addition overflows. Overflow cannot occur during the multiplications.
| val1 | first 16-bit operands for each multiplication. |
| val2 | second 16-bit operands for each multiplication. |
| val3 | accumulate value. |
p1 = val1[15:0] * val2[15:0] + p2 = val1[31:16] * val2[31:16] + res[31:0] = p1 + p2 + val3[31:0] +
| uint32_t __SMLADX | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2, | +
| + | + | uint32_t | +val3 | +
| + | ) | ++ |
This function enables you to perform two signed 16-bit multiplications with exchanged halfwords of the second operand, adding both results to a 32-bit accumulate operand.
+ The Q bit is set if the addition overflows. Overflow cannot occur during the multiplications.
| val1 | first 16-bit operands for each multiplication. |
| val2 | second 16-bit operands for each multiplication. |
| val3 | accumulate value. |
p1 = val1[15:0] * val2[31:16] + p2 = val1[31:16] * val2[15:0] + res[31:0] = p1 + p2 + val3[31:0] +
| uint64_t __SMLALD | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2, | +
| + | + | uint64_t | +val3 | +
| + | ) | ++ |
This function enables you to perform two signed 16-bit multiplications, adding both results to a 64-bit accumulate operand. Overflow is only possible as a result of the 64-bit addition. This overflow is not detected if it occurs. Instead, the result wraps around modulo264.
+| val1 | first 16-bit operands for each multiplication. |
| val2 | second 16-bit operands for each multiplication. |
| val3 | accumulate value. |
p1 = val1[15:0] * val2[15:0] + p2 = val1[31:16] * val2[31:16] + sum = p1 + p2 + val3[63:32][31:0] + res[63:32] = sum[63:32] + res[31:0] = sum[31:0] +
| unsigned long long __SMLALDX | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2, | +
| + | + | unsigned long long | +val3 | +
| + | ) | ++ |
This function enables you to exchange the halfwords of the second operand, and perform two signed 16-bit multiplications, adding both results to a 64-bit accumulate operand. Overflow is only possible as a result of the 64-bit addition. This overflow is not detected if it occurs. Instead, the result wraps around modulo264.
+| val1 | first 16-bit operands for each multiplication. |
| val2 | second 16-bit operands for each multiplication. |
| val3 | accumulate value. |
p1 = val1[15:0] * val2[31:16] + p2 = val1[31:16] * val2[15:0] + sum = p1 + p2 + val3[63:32][31:0] + res[63:32] = sum[63:32] + res[31:0] = sum[31:0] +
| uint32_t __SMLSD | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2, | +
| + | + | uint32_t | +val3 | +
| + | ) | ++ |
This function enables you to perform two 16-bit signed multiplications, take the difference of the products, subtracting the high halfword product from the low halfword product, and add the difference to a 32-bit accumulate operand.
+ The Q bit is set if the accumulation overflows. Overflow cannot occur during the multiplications or the subtraction.
| val1 | first 16-bit operands for each multiplication. |
| val2 | second 16-bit operands for each multiplication. |
| val3 | accumulate value. |
p1 = val1[15:0] * val2[15:0] + p2 = val1[31:16] * val2[31:16] + res[31:0] = p1 - p2 + val3[31:0] +
| uint32_t __SMLSDX | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2, | +
| + | + | uint32_t | +val3 | +
| + | ) | ++ |
This function enables you to exchange the halfwords in the second operand, then perform two 16-bit signed multiplications. The difference of the products is added to a 32-bit accumulate operand.
+ The Q bit is set if the addition overflows. Overflow cannot occur during the multiplications or the subtraction.
| val1 | first 16-bit operands for each multiplication. |
| val2 | second 16-bit operands for each multiplication. |
| val3 | accumulate value. |
p1 = val1[15:0] * val2[31:16] + p2 = val1[31:16] * val2[15:0] + res[31:0] = p1 - p2 + val3[31:0] +
| uint64_t __SMLSLD | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2, | +
| + | + | uint64_t | +val3 | +
| + | ) | ++ |
This function It enables you to perform two 16-bit signed multiplications, take the difference of the products, subtracting the high halfword product from the low halfword product, and add the difference to a 64-bit accumulate operand. Overflow cannot occur during the multiplications or the subtraction. Overflow can occur as a result of the 64-bit addition, and this overflow is not detected. Instead, the result wraps round to modulo264.
+| val1 | first 16-bit operands for each multiplication. |
| val2 | second 16-bit operands for each multiplication. |
| val3 | accumulate value. |
p1 = val1[15:0] * val2[15:0] + p2 = val1[31:16] * val2[31:16] + res[63:0] = p1 - p2 + val3[63:0] +
| unsigned long long __SMLSLDX | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2, | +
| + | + | unsigned long long | +val3 | +
| + | ) | ++ |
This function enables you to exchange the halfwords of the second operand, perform two 16-bit multiplications, adding the difference of the products to a 64-bit accumulate operand. Overflow cannot occur during the multiplications or the subtraction. Overflow can occur as a result of the 64-bit addition, and this overflow is not detected. Instead, the result wraps round to modulo264.
+| val1 | first 16-bit operands for each multiplication. |
| val2 | second 16-bit operands for each multiplication. |
| val3 | accumulate value. |
p1 = val1[15:0] * val2[31:16] + p2 = val1[31:16] * val2[15:0] + res[63:0] = p1 - p2 + val3[63:0] +
| uint32_t __SMUAD | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to perform two 16-bit signed multiplications, adding the products together.
+ The Q bit is set if the addition overflows.
| val1 | first 16-bit operands for each multiplication. |
| val2 | second 16-bit operands for each multiplication. |
p1 = val1[15:0] * val2[15:0] + p2 = val1[31:16] * val2[31:16] + res[31:0] = p1 + p2 +
| uint32_t __SMUADX | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to perform two 16-bit signed multiplications with exchanged halfwords of the second operand, adding the products together.
+ The Q bit is set if the addition overflows.
| val1 | first 16-bit operands for each multiplication. |
| val2 | second 16-bit operands for each multiplication. |
p1 = val1[15:0] * val2[31:16] + p2 = val1[31:16] * val2[15:0] + res[31:0] = p1 + p2 +
| uint32_t __SMUSD | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to perform two 16-bit signed multiplications, taking the difference of the products by subtracting the high halfword product from the low halfword product.
+| val1 | first 16-bit operands for each multiplication. |
| val2 | second 16-bit operands for each multiplication. |
p1 = val1[15:0] * val2[15:0] + p2 = val1[31:16] * val2[31:16] + res[31:0] = p1 - p2 +
| uint32_t __SMUSDX | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to perform two 16-bit signed multiplications, subtracting one of the products from the other. The halfwords of the second operand are exchanged before performing the arithmetic. This produces top * bottom and bottom * top multiplication.
+| val1 | first 16-bit operands for each multiplication. |
| val2 | second 16-bit operands for each multiplication. |
p1 = val1[15:0] * val2[31:16] + p2 = val1[31:16] * val2[15:0] + res[31:0] = p1 - p2 +
| uint32_t __SSAT16 | +( | +uint32_t | +val1, | +
| + | + | const uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to saturate two signed 16-bit values to a selected signed range.
+ The Q bit is set if either operation saturates.
| val1 | two signed 16-bit values to be saturated. |
| val2 | bit position for saturation, an integral constant expression in the range 1 to 16. |
Saturate halfwords in val1 to the signed range specified by the bit position in val2
+| uint32_t __SSAX | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to exchange the two halfwords of one operand and perform one 16-bit integer subtraction and one 16-bit addition.
+ The GE bits in the APSR are set according to the results.
| val1 | first operand for the addition in the low halfword, and the first operand for the subtraction in the high halfword. |
| val2 | second operand for the addition in the high halfword, and the second operand for the subtraction in the low halfword. |
res[15:0] = val1[15:0] + val2[31:16] + res[31:16] = val1[31:16] - val2[15:0] +
| uint32_t __SSUB16 | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to perform two 16-bit signed integer subtractions.
+ The GE bits in the APSR are set according to the results.
| val1 | first two 16-bit operands of each subtraction. |
| val2 | second two 16-bit operands of each subtraction. |
res[15:0] = val1[15:0] - val2[15:0] + res[31:16] = val1[31:16] - val2[31:16] +
| uint32_t __SSUB8 | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to perform four 8-bit signed integer subtractions.
+ The GE bits in the APSR are set according to the results.
| val1 | first four 8-bit operands of each subtraction. |
| val2 | second four 8-bit operands of each subtraction. |
res[7:0] = val1[7:0] - val2[7:0] + res[15:8] = val1[15:8] - val2[15:8] + res[23:16] = val1[23:16] - val2[23:16] + res[31:24] = val1[31:24] - val2[31:24] +
| uint32_t __SXTAB16 | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to extract two 8-bit values from the second operand (at bit positions [7:0] and [23:16]), sign-extend them to 16-bits each, and add the results to the first operand.
+| val1 | values added to the zero-extended to 16-bit values. |
| val2 | two 8-bit values to be extracted and zero-extended. |
res[15:0] = val1[15:0] + SignExtended(val2[7:0]) + res[31:16] = val1[31:16] + SignExtended(val2[23:16]) +
| uint32_t __SXTB16 | +( | +uint32_t | +val | ) | ++ |
This function enables you to extract two 8-bit values from an operand and sign-extend them to 16 bits each.
+| val | two 8-bit values in val[7:0] and val[23:16] to be sign-extended. |
res[15:0] = SignExtended(val[7:0] + res[31:16] = SignExtended(val[23:16] +
| uint32_t __UADD16 | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to perform two 16-bit unsigned integer additions.
+ The GE bits in the APSR are set according to the results.
| val1 | first two 16-bit summands for each addition. |
| val2 | second two 16-bit summands for each addition. |
res[15:0] = val1[15:0] + val2[15:0] + res[31:16] = val1[31:16] + val2[31:16] +
| uint32_t __UADD8 | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to perform four unsigned 8-bit integer additions. The GE bits of the APSR are set according to the results.
+| val1 | first four 8-bit summands for each addition. |
| val2 | second four 8-bit summands for each addition. |
res[7:0] = val1[7:0] + val2[7:0] + res[15:8] = val1[15:8] + val2[15:8] + res[23:16] = val1[23:16] + val2[23:16] + res[31:24] = val1[31:24] + val2[31:24] +
| uint32_t __UASX | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to exchange the two halfwords of the second operand, add the high halfwords and subtract the low halfwords.
+ The GE bits in the APSR are set according to the results.
| val1 | first operand for the subtraction in the low halfword, and the first operand for the addition in the high halfword. |
| val2 | second operand for the subtraction in the high halfword and the second operand for the addition in the low halfword. |
res[15:0] = val1[15:0] - val2[31:16] + res[31:16] = val1[31:16] + val2[15:0] +
| uint32_t __UHADD16 | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to perform two unsigned 16-bit integer additions, halving the results.
+| val1 | first two 16-bit summands. |
| val2 | second two 16-bit summands. |
res[15:0] = val1[15:0] + val2[15:0] >> 1 + res[31:16] = val1[31:16] + val2[31:16] >> 1 +
| uint32_t __UHADD8 | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to perform four unsigned 8-bit integer additions, halving the results.
+| val1 | first four 8-bit summands. |
| val2 | second four 8-bit summands. |
res[7:0] = val1[7:0] + val2[7:0] >> 1 + res[15:8] = val1[15:8] + val2[15:8] >> 1 + res[23:16] = val1[23:16] + val2[23:16] >> 1 + res[31:24] = val1[31:24] + val2[31:24] >> 1 +
| uint32_t __UHASX | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to exchange the halfwords of the second operand, add the high halfwords and subtract the low halfwords, halving the results.
+| val1 | first operand for the subtraction in the low halfword, and the first operand for the addition in the high halfword. |
| val2 | second operand for the subtraction in the high halfword, and the second operand for the addition in the low halfword. |
res[15:0] = (val1[15:0] - val2[31:16]) >> 1 + res[31:16] = (val1[31:16] + val2[15:0] ) >> 1 +
| uint32_t __UHSAX | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to exchange the halfwords of the second operand, subtract the high halfwords and add the low halfwords, halving the results.
+| val1 | first operand for the addition in the low halfword, and the first operand for the subtraction in the high halfword. |
| val2 | second operand for the addition in the high halfword, and the second operand for the subtraction in the low halfword. |
res[15:0] = (val1[15:0] + val2[31:16]) >> 1 + res[31:16] = (val1[31:16] - val2[15:0] ) >> 1 +
| uint32_t __UHSUB16 | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to perform two unsigned 16-bit integer subtractions, halving the results.
+| val1 | first two 16-bit operands. |
| val2 | second two 16-bit operands. |
res[15:0] = val1[15:0] - val2[15:0] >> 1 + res[31:16] = val1[31:16] - val2[31:16] >> 1 +
| uint32_t __UHSUB8 | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to perform four unsigned 8-bit integer subtractions, halving the results.
+| val1 | first four 8-bit operands. |
| val2 | second four 8-bit operands. |
res[7:0] = val1[7:0] - val2[7:0] >> 1 + res[15:8] = val1[15:8] - val2[15:8] >> 1 + res[23:16] = val1[23:16] - val2[23:16] >> 1 + res[31:24] = val1[31:24] - val2[31:24] >> 1 +
| uint32_t __UQADD16 | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to perform two unsigned 16-bit integer additions, saturating the results to the 16-bit unsigned integer range 0 < x < 216 - 1.
+| val1 | first two 16-bit summands. |
| val2 | second two 16-bit summands. |
res[15:0] = val1[15:0] + val2[15:0] + res[31:16] = val1[31:16] + val2[31:16] +
| uint32_t __UQADD8 | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to perform four unsigned 8-bit integer additions, saturating the results to the 8-bit unsigned integer range 0 < x < 28 - 1.
+| val1 | first four 8-bit summands. |
| val2 | second four 8-bit summands. |
res[7:0] = val1[7:0] + val2[7:0] + res[15:8] = val1[15:8] + val2[15:8] + res[23:16] = val1[23:16] + val2[23:16] + res[31:24] = val1[31:24] + val2[31:24] +
| uint32_t __UQASX | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to exchange the halfwords of the second operand and perform one unsigned 16-bit integer addition and one unsigned 16-bit subtraction, saturating the results to the 16-bit unsigned integer range 0 <= x <= 216 - 1.
+| val1 | first two 16-bit operands. |
| val2 | second two 16-bit operands. |
res[15:0] = val1[15:0] - val2[31:16] + res[31:16] = val1[31:16] + val2[15:0] +
| uint32_t __UQSAX | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to exchange the halfwords of the second operand and perform one unsigned 16-bit integer subtraction and one unsigned 16-bit addition, saturating the results to the 16-bit unsigned integer range 0 <= x <= 216 - 1.
+| val1 | first 16-bit operand for the addition in the low halfword, and the first 16-bit operand for the subtraction in the high halfword. |
| val2 | second 16-bit halfword for the addition in the high halfword, and the second 16-bit halfword for the subtraction in the low halfword. |
res[15:0] = val1[15:0] + val2[31:16] + res[31:16] = val1[31:16] - val2[15:0] +
| uint32_t __UQSUB16 | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to perform two unsigned 16-bit integer subtractions, saturating the results to the 16-bit unsigned integer range 0 < x < 216 - 1.
+| val1 | first two 16-bit operands for each subtraction. |
| val2 | second two 16-bit operands for each subtraction. |
res[15:0] = val1[15:0] - val2[15:0] + res[31:16] = val1[31:16] - val2[31:16] +
| uint32_t __UQSUB8 | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to perform four unsigned 8-bit integer subtractions, saturating the results to the 8-bit unsigned integer range 0 < x < 28 - 1.
+| val1 | first four 8-bit operands. |
| val2 | second four 8-bit operands. |
res[7:0] = val1[7:0] - val2[7:0] + res[15:8] = val1[15:8] - val2[15:8] + res[23:16] = val1[23:16] - val2[23:16] + res[31:24] = val1[31:24] - val2[31:24] +
| uint32_t __USAD8 | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to perform four unsigned 8-bit subtractions, and add the absolute values of the differences together, returning the result as a single unsigned integer.
+| val1 | first four 8-bit operands for the subtractions. |
| val2 | second four 8-bit operands for the subtractions. |
absdiff1 = val1[7:0] - val2[7:0] + absdiff2 = val1[15:8] - val2[15:8] + absdiff3 = val1[23:16] - val2[23:16] + absdiff4 = val1[31:24] - val2[31:24] + res[31:0] = absdiff1 + absdiff2 + absdiff3 + absdiff4 +
| uint32_t __USADA8 | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2, | +
| + | + | uint32_t | +val3 | +
| + | ) | ++ |
This function enables you to perform four unsigned 8-bit subtractions, and add the absolute values of the differences to a 32-bit accumulate operand.
+| val1 | first four 8-bit operands for the subtractions. |
| val2 | second four 8-bit operands for the subtractions. |
| val3 | accumulation value. |
absdiff1 = val1[7:0] - val2[7:0] + absdiff2 = val1[15:8] - val2[15:8] + absdiff3 = val1[23:16] - val2[23:16] + absdiff4 = val1[31:24] - val2[31:24] + sum = absdiff1 + absdiff2 + absdiff3 + absdiff4 + res[31:0] = sum[31:0] + val3[31:0] +
| uint32_t __USAT16 | +( | +uint32_t | +val1, | +
| + | + | const uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to saturate two signed 16-bit values to a selected unsigned range.
+ The Q bit is set if either operation saturates.
| val1 | two 16-bit values that are to be saturated. |
| val2 | bit position for saturation, and must be an integral constant expression in the range 0 to 15. |
Saturate halfwords in val1 to the unsigned range specified by the bit position in val2
+| uint32_t __USAX | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to exchange the halfwords of the second operand, subtract the high halfwords and add the low halfwords.
+ The GE bits in the APSR are set according to the results.
| val1 | first operand for the addition in the low halfword, and the first operand for the subtraction in the high halfword. |
| val2 | second operand for the addition in the high halfword, and the second operand for the subtraction in the low halfword. |
res[15:0] = val1[15:0] + val2[31:16] + res[31:16] = val1[31:16] - val2[15:0] +
| uint32_t __USUB16 | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to perform two 16-bit unsigned integer subtractions.
+ The GE bits in the APSR are set according to the results.
| val1 | first two 16-bit operands. |
| val2 | second two 16-bit operands. |
res[15:0] = val1[15:0] - val2[15:0] + res[31:16] = val1[31:16] - val2[31:16] +
| uint32_t __USUB8 | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to perform four 8-bit unsigned integer subtractions. The GE bits in the APSR are set according to the results.
+| val1 | first four 8-bit operands. |
| val2 | second four 8-bit operands. |
res[7:0] = val1[7:0] - val2[7:0] + res[15:8] = val1[15:8] - val2[15:8] + res[23:16] = val1[23:16] - val2[23:16] + res[31:24] = val1[31:24] - val2[31:24] +
| uint32_t __UXTAB16 | +( | +uint32_t | +val1, | +
| + | + | uint32_t | +val2 | +
| + | ) | ++ |
This function enables you to extract two 8-bit values from one operand, zero-extend them to 16 bits each, and add the results to two 16-bit values from another operand.
+| val1 | value added to the zero-extended to 16-bit values. |
| val2 | two 8-bit values to be extracted and zero-extended. |
res[15:0] = ZeroExt(val2[7:0] to 16 bits) + val1[15:0] + res[31:16] = ZeroExt(val2[31:16] to 16 bits) + val1[31:16] +
| uint32_t __UXTB16 | +( | +uint32_t | +val | ) | ++ |
This function enables you to extract two 8-bit values from an operand and zero-extend them to 16 bits each.
+| val | two 8-bit values in val[7:0] and val[23:16] to be sign-extended. |
res[15:0] = ZeroExtended(val[7:0] ) + res[31:16] = ZeroExtended(val[23:16]) +
![]() |
+
+
+ CMSIS-CORE
+ Version 3.01
+
+ CMSIS-CORE support for Cortex-M processor-based devices
+ |
+
+
+
+
Describes naming conventions, requirements, and optional features for accessing peripherals. +More...
+Each peripheral provides a data type definition with a name that is composed of a prefix <device abbreviation>_ and the <peripheral name>_, for example LPC_UART for the device LPC and the peripheral UART. The intention is to avoid name collisions caused by short names. If more peripherals exist of the same type, identifiers have a postfix consisting of a digit or letter, for example LPC_UART0, LPC_UART1.
+#define __I volatile const + #define __O volatile + #define __IO volatile +
typedef struct +{ + union { + __I uint8_t RBR; /* Offset: 0x000 (R/ ) Receiver Buffer Register */ + __O uint8_t THR; /* Offset: 0x000 ( /W) Transmit Holding Register */ + __IO uint8_t DLL; /* Offset: 0x000 (R/W) Divisor Latch LSB */ + uint32_t RESERVED0; + }; + union { + __IO uint8_t DLM; /* Offset: 0x004 (R/W) Divisor Latch MSB */ + __IO uint32_t IER; /* Offset: 0x004 (R/W) Interrupt Enable Register */ + }; + union { + __I uint32_t IIR; /* Offset: 0x008 (R/ ) Interrupt ID Register */ + __O uint8_t FCR; /* Offset: 0x008 ( /W) FIFO Control Register */ + }; + __IO uint8_t LCR; /* Offset: 0x00C (R/W) Line Control Register */ + uint8_t RESERVED1[7]; + __I uint8_t LSR; /* Offset: 0x014 (R/ ) Line Status Register */ + uint8_t RESERVED2[7]; + __IO uint8_t SCR; /* Offset: 0x01C (R/W) Scratch Pad Register */ + uint8_t RESERVED3[3]; + __IO uint32_t ACR; /* Offset: 0x020 (R/W) Autobaud Control Register */ + __IO uint8_t ICR; /* Offset: 0x024 (R/W) IrDA Control Register */ + uint8_t RESERVED4[3]; + __IO uint8_t FDR; /* Offset: 0x028 (R/W) Fractional Divider Register */ + uint8_t RESERVED5[7]; + __IO uint8_t TER; /* Offset: 0x030 (R/W) Transmit Enable Register */ + uint8_t RESERVED6[39]; + __I uint8_t FIFOLVL; /* Offset: 0x058 (R/ ) FIFO Level Register */ +} LPC_UART_TypeDef; +
#define LPC_UART2 ((LPC_UART_TypeDef *) LPC_UART2_BASE ) +#define LPC_UART3 ((LPC_UART_TypeDef *) LPC_UART3_BASE ) +
LPC_UART1->DR // is the data register of UART1.
+To access the peripheral registers and related function in a device, the files device.h and core_cm#.h define as a minimum:
+
+
typedef struct +{ + __IO uint32_t CTRL; /* Offset: 0x000 (R/W) SysTick Control and Status Register */ + __IO uint32_t LOAD; /* Offset: 0x004 (R/W) SysTick Reload Value Register */ + __IO uint32_t VAL; /* Offset: 0x008 (R/W) SysTick Current Value Register */ + __I uint32_t CALIB; /* Offset: 0x00C (R/ ) SysTick Calibration Register */ +} SysTick_Type; +
#define SysTick_BASE (SCS_BASE + 0x0010) /* SysTick Base Address */ +
#define SysTick ((SysTick_Type *) Systick_BASE) /* SysTick access definition */ +
These definitions allow accessing peripheral registers with simple assignments.
+Example:
+
SysTick->CTRL = 0; +
Optionally, the file device.h may define:
+![]() |
+
+
+ CMSIS-CORE
+ Version 3.01
+
+ CMSIS-CORE support for Cortex-M processor-based devices
+ |
+
+
+
+
+Variables | |
| uint32_t | SystemCoreClock |
| Variable to hold the system core clock value. | |
+Functions | |
| void | SystemInit (void) |
| Function to Initialize the system. | |
| void | SystemCoreClockUpdate (void) |
| Function to update the variable SystemCoreClock. | |
ARM provides a template file system_device.c that must be adapted by the silicon vendor to match their actual device. As a minimum requirement, this file must provide:
+The file configures the device and, typically, initializes the oscillator (PLL) that is part of the microcontroller device. This file might export other functions or variables that provide a more flexible configuration of the microcontroller system.
+The code below shows the usage of the variable SystemCoreClock and the functions SystemInit() and SystemCoreClockUpdate() with an LPC1700.
+#include "LPC17xx.h" + +uint32_t coreClock_1 = 0; /* Variables to store core clock values */ +uint32_t coreClock_2 = 0; + + +int main (void) { + + coreClock_1 = SystemCoreClock; /* Store value of predefined SystemCoreClock */ + + SystemCoreClockUpdate(); /* Update SystemCoreClock according to register settings */ + + coreClock_2 = SystemCoreClock; /* Store value of calculated SystemCoreClock */ + + if (coreClock_2 != coreClock_1) { /* Without changing the clock setting both core clock values should be the same */ + // Error Handling + } + + while(1); +} +
| uint32_t SystemCoreClock | +
Holds the system core clock, which is the system clock frequency supplied to the SysTick timer and the processor core clock. This variable can be used by debuggers to query the frequency of the debug timer or to configure the trace clock speed.
+| void SystemCoreClockUpdate | +( | +void | +) | ++ |
Updates the variable SystemCoreClock and must be called whenever the core clock is changed during program execution. The function evaluates the clock register settings and calculates the current core clock.
+ +| void SystemInit | +( | +void | +) | ++ |
Initializes the microcontroller system. Typically, this function configures the oscillator (PLL) that is part of the microcontroller device. For systems with a variable clock speed, it updates the variable SystemCoreClock. SystemInit is called from the file startup_device.
+ +![]() |
+
+
+ CMSIS-CORE
+ Version 3.01
+
+ CMSIS-CORE support for Cortex-M processor-based devices
+ |
+
+
+
+
CMSIS-CORE implements the basic run-time system for a Cortex-M device and gives the user access to the processor core and the device peripherals. In detail it defines:
+This chapter provides details about the CMSIS-CORE and contains the following sections:
+The Cortex-M Reference Manuals are generic user guides for devices that implement the various ARM Cortex-M processors. These manuals contain the programmers model and detailed information about the core peripherals.
+The CMSIS-CORE Template Files supplied by ARM have been tested and verified with the following toolchains:
+Revision History of CMSIS-CORE
+| Version | Description |
|---|---|
| V3.01 | Added support for Cortex-M0+ processor. + Integration of CMSIS DSP Library version 1.1.0 + |
| V3.00 | Added support for GNU GCC ARM Embedded Compiler. + Added function __ROR. + Added Register Mapping for TPIU, DWT. + Added support for SC000 and SC300 processors. + Corrected ITM_SendChar function. + Corrected the functions __STREXB, __STREXH, __STREXW for the GNU GCC compiler section. + Documentation restructured. |
| V2.10 | Updated documentation. + Updated CMSIS core include files. + Changed CMSIS/Device folder structure. + Added support for Cortex-M0, Cortex-M4 w/o FPU to CMSIS DSP library. + Reworked CMSIS DSP library examples. |
| V2.00 | Added support for Cortex-M4 processor. |
| V1.30 | Reworked Startup Concept. + Added additional Debug Functionality. + Changed folder structure. + Added doxygen comments. + Added definitions for bit. |
| V1.01 | Added support for Cortex-M0 processor. |
| V1.01 | Added intrinsic functions for __LDREXB, __LDREXH, __LDREXW, __STREXB, __STREXH, __STREXW, and __CLREX |
| V1.00 | Initial Release for Cortex-M3 processor. |
![]() |
+
+
+ CMSIS-CORE
+ Version 3.01
+
+ CMSIS-CORE support for Cortex-M processor-based devices
+ |
+
+
+
+