硬汉嵌入式论坛

 找回密码
 立即注册
查看: 2074|回复: 3
收起左侧

[技术讨论] 识别Cortex-M 内核的方法(M0 - M7)

[复制链接]

747

主题

1049

回帖

3295

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
3295
发表于 2020-6-29 02:20:01 | 显示全部楼层 |阅读模式
查阅本资料的目的仅仅用于实现脱机烧录功能时,打印内核信息
原文地址 https://developer.arm.com/ip-products/processors/cortex-m

Cortex-M comparison table
Feature Cortex-M0Cortex-M0+Cortex-M1Cortex-M23Cortex-M3Cortex-M4 Cortex-M33Cortex-M35PCortex-M55
Cortex-M7
Instruction Set Architecture Armv6-MArmv6-M
Armv6-M
Armv8-M Baseline
Armv7-MArmv7-M
Armv8-M Mainline
Armv8-M Mainline
Armv8.1-M Mainline
Helium
Armv7-M
Thumb, Thumb-2 Thumb, Thumb-2
Thumb, Thumb-2
Thumb, Thumb-2
Thumb, Thumb-2
Thumb, Thumb-2
Thumb,
Thumb-2
Thumb,
Thumb-2
Thumb,
Thumb-2
Thumb,
Thumb-2
DMIPS/MHz range*
0.87-1.27
0.95-1.36
0.8
0.98
1.25-1.89
1.25-1.95
1.5
1.5
1.6
2.14-3.23
CoreMark®/MHz*
2.33
2.46
1.85
2.64
3.34
3.42
4.02
4.02
4.2
5.01
Pipeline Stages
3
2
3
2
3
3
3
3
4
6
Memory Protection Unit (MPU) No Yes (option)No Yes (option)
(2 x)
Yes (option) Yes (option) Yes (option)
(2 x)
Yes (option)
(2 x)
Yes (option) (2 x)
Yes (option)
Maximum MPU Regions 0 8 0 16 8 8 16 16 16
16
Trace (ETM or MTB) No MTB (option) No MTB (option) or
ETMv3 (option)
ETMv3 (option) ETMv3 (option) MTB (option) and/or
ETMv4 (option)
MTB (option) and/or
ETMv4 (option)
ETMv4 (option)
ETMv4 (option)
Digital Signal Processing (DSP) extension
No No No No NoYes Yes (option)Yes (option) Yes (option)
Yes
Floating Point Hardware NoNo No No NoYes (scalar SP)Yes (scalar SP)Yes (scalar SP)Yes (scalar HP +
SP + DP) (vector
HP + SP)
Yes (scalar SP + DP)
Systick Timer
Yes (option) Yes (option) Yes (option) Yes (2 x) YesYesYes (2 x)Yes (2 x)Yes (2 x)
Yes
Built-in Caches NoNoNo NoNoNoNo Yes (option 2- 16kBYes (option)
Yes (option 4-64kB
I-cacheI-cache and D-cache
I-cache, D-cache)
Tightly Coupled Memory No No Yes No No No No No Yes
(option 0-16MB
I-TCM/D-TCM)
Yes
(option 0-16MB
I-TCM/D-TCM)
TrustZone for Armv8-M
NoNoNoYes (option) No No Yes (option)Yes (option) Yes (option)
No
Coprocessor Interface No No No No No No Yes (option) Yes (option) Yes (option)
No
Bus Protocol
AHB Lite AHB Lite, Fast I/O AHB Lite AHB5, Fast I/O AHB Lite, APB  AHB Lite, APB AHB5, APBAHB5, APBAXI5 (main bus), AHB
(peripheral bus,
TCM slave port and debug)
AXI4, AHB Lite, APB, TCM
Wake-up Interrupt Controller Support
YesYes No Yes Yes Yes Yes Yes Yes
Yes
Integrated Interrupt Controller (NVIC)
Yes Yes Yes Yes Yes Yes YesYes Yes Yes
Maximum # External Interrupts
32 32 32 240 240 240 480480480
240  
Hardware Divide NoNo No Yes Yes Yes Yes YesYes
Yes
Single Cycle Multiply
Yes (option)Yes (option) No Yes Yes Yes Yes Yes Yes
Yes
CMSIS Support
Yes Yes Yes Yes Yes Yes Yes Yes Yes
Yes
Dual Core Lock-Step Support
NoNoNoYes NoNoYesYes No
Yes
Arm Custom Instructions
No
No
No
No
No
No
Yes
No
Yes (available in 2021)
No
Common Criteria certificationNoNo No No No No Yes Yes NoNo

*See individual Cortex-M product pages for further information.

SP = Single Precision

DP = Double Precision

HP = Half Precision






回复

使用道具 举报

747

主题

1049

回帖

3295

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
3295
 楼主| 发表于 2020-6-29 02:33:34 | 显示全部楼层
读CPUID (0xE000ED00),根据其中的字段Partno识别。
以下数据根据每个系列的手册汇总。
缺M35P
【M0】
[31:24] Implementer  Implementer code: 0x41 = ARM.
[23:20] Variant  Implementation defined. In ARM implementations this is the major revision number n in the rn part of the rnpn revision status,
    Product revision status: 0x0.
[19:16] Constant    Indicates the architecture, ARMv6-M: 0xC.
[15:4]  Partno  Indicates part number, Cortex-M0: 0xC20.
[3:0]   Revision    Indicates revision. In ARM implementations this is the minor revision number n in the pn part of the rnpn revision status,
    see Product revision status. For example, for release r0p0: 0x0.

【M0+】
[31:24] IMPLEMENTER Implementer code: 0x41 ARM.
[23:20] VARIANT Major revision number n in the rnpm revision status. See Product revision status:0x0.
[19:16] ARCHITECTURE    Indicates the architecture, ARMv6-M: 0xC.
[15:4]  PARTNO  Indicates part number, Cortex-M0+: 0xC60.
[3:0]   REVISION    Minor revision number m in the rnpm revision status. See Product revision status. 0x1.

【M1】
[31:24] IMPLEMENTER  Implementer code:0x41 = ARM
[23:20] VARIANT  Implementation defined variant number: 0x0 for r0p1
[19:16] Constant    Reads as 0xC
[15:4]  PARTNO  Number of processor within family: 0xC21
[3:0]   REVISION    Implementation defined revision number: 0x1 = r0p1   

【M23】
[31:24] IMPLEMENTER Implementer code:0x41 = Arm.
[23:20] VARIANT Major revision number n in the rnpm revision status: 0x1 = Revision 1.
[19:16] ARCHITECTURE  Constant that defines the architecture of the processor: 0xC = Armv8-M architecture.
[15:4]  PARTNO  Part number of the processor: 0xD20 = Cortex-M23.
[3:0]   REVISION   Minor revision number m in the rnpm revision status: 0x0 = Patch 0.

【M3】
[31:24] IMPLEMENTER Indicates implementer: 0x41 = ARM?
[23:20] VARIANT Indicates processor revision: 0x0 = Revision 0
[19:16] (Constant)  Reads as 0xF
[15:4]  PARTNO  Indicates part number: 0xC23 = Cortex??M3
[3:0]   REVISION    Indicates patch release: 0x1= Patch 1.

【M33】
[31:24] Implementer Implementer code: 0x41  Arm?
[23:20] Variant Variant number, the n value in the rnpm product revision identifier: 0x0    Revision 0
[19:16] Constant    Reads as 0xF
[15:4]  PartNo  Part number of the processor: 0xD21 Cortex??M33
[3:0]   Revision    Revision number, the m value in the rnpm product revision identifier: 0x3   Patch 3.

【M4】
[31:24] IMPLEMENTER Indicates implementer: 0x41 = Arm?
[23:20] VARIANT Indicates processor revision: 0x0 = Revision 0
[19:16] (Constant)  Reads as 0xF
[15:4]  PARTNO  Indicates part number: 0xC24 = Cortex?-M4
[3:0]   REVISION    Indicates patch release: 0x1= Patch 1.

【M55】
[31:24] Implementer Implementer code: 0x41  Arm?Limited
[23:20] Variant Variant number, the n value in the rnpm product revision identifier: 0x0    Revision 0
[19:16] Architecture    Reads as 0b1111, Armv8.1?M with Main Extension
[15:4]  PartNo  Part number of the processor: 0xD22 Cortex?-M55
[3:0]   Revision    Revision number, the m value in the rnpm product revision identifier: 0x1   Patch 1.

【M7】
[31:24] IMPLEMENTER  Indicates implementer: 0x41  Arm.
[23:20] VARIANT  Indicates processor revision: 0x0 Revision 0. 0x1 Revision 1.
[19:16] ARCHITECTURE Reads as 0xF.
[15:4]  PARTNO  Indicates part number: 0xC27  Cortex-M7.
[3:0]   REVISION  Indicates patch release: 0x0  Patch 0.



回复

使用道具 举报

747

主题

1049

回帖

3295

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
3295
 楼主| 发表于 2020-6-29 03:03:38 | 显示全部楼层


开始以为是M3和M4的Partno是相同的,找了半天资料如何判断M3和M4内核。原来是ARM的有个文档笔误。
ARM M3partno.png

正确的是C23.  错误文档写的是C24
https://developer.arm.com/docs/100165/0201/system-control/cpuid-base-register-cpuid


回复

使用道具 举报

1万

主题

6万

回帖

10万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
106726
QQ
发表于 2020-6-29 10:09:37 | 显示全部楼层
armfly 发表于 2020-6-29 02:33
读CPUID (0xE000ED00),根据其中的字段Partno识别。
以下数据根据每个系列的手册汇总。
缺M35P

M35P是ARM出的防物理破解内核,莫非他们限制了。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|Archiver|手机版|硬汉嵌入式论坛

GMT+8, 2024-5-2 09:32 , Processed in 0.442056 second(s), 28 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表