Cortex-M3 and Cortex-M4 Memory Organization
The Cortex-M3 and Cortex-M4 have a predefined memory map. This allows the built-in peripherals, such as the interrupt controller and the debug components, to be accessed by simple memory access instructions.
Thus, most system features are accessible in program code. The predefined memory map also allows the Cortex-M3 processor to be highly optimized for speed and ease of integration in system-on-a-chip (SoC) designs.
Overall, the 4 GB memory space can be divided into ranges as shown in picture below. The Cortex-M3 design has an internal bus infrastructure optimized for this memory usage.
A graphical representation of the ARM memory is shown in picture below :
The ARM Cortex-M3 memory is divided into following regions :
- System - .
- Private Peripheral Bus - External - Provides access to :
- the Trace Port Interface Unit (TPIU),
- the Embedded Trace Macrocell (ETM),
- the ROM table,
- implementation-specific areas of the PPB memory map.
- Private Peripheral Bus - External - Provides access to :
- the Instrumentation Trace Macrocell (ITM),
- the Data Watchpoint and Trace (DWT),
- the Flashpatch and Breakpoint (FPB),
- the System Control Space (SCS), including the MPU and the Nested Vectored Interrupt Controller (NVIC).
- External Device - This region is used for external device memory.
- External RAM - This region is used for data.
- Peripheral - This region includes bit band and bit band alias areas.
- Peripheral Bit-band alias - Direct accesses to this memory range behave as peripheral memory accesses, but this region is also bit addressable through bit-band alias.
- Peripheral bit-band region - Data accesses to this region are remapped to bit band region. A write operation is performed as read-modify-write.
- SRAM - This executable region is for data storage. Code can also be stored here. This region includes bit band and bit band alias areas.
- SRAM Bit-band alias - Direct accesses to this memory range behave as SRAM memory accesses, but this region is also bit addressable through bit-band alias.
- SRAM bit-band region - Data accesses to this region are remapped to bit band region. A write operation is performed as read-modify-write.
- Code - This executable region is for program code. Data can also be stored here.
Memory Maps
The Cortex-M3 processor has a fixed memory map.
Some of the memory locations are allocated for private peripherals such as debugging components.
1. Fetch Patch and BreakPoint Unit (FPB)
2. Data WatchPoint and Trace Unit (DWT)
3. Instrumentation Trace Macrocell (ITM)
4. Embedded Trace Macrocell (ETM)
5. Trace Port Interface Unit (TPIU)
6. ROM Table
The Cortex-M3 processor has a total of 4 GB of address space.
SRAM: 0.5 GB.
The SRAM memory range is for connecting internal SRAM.
On-chip peripherals: 0.5 GB
supports bit-band alias and is accessed via the system bus interface.
External RAM: 1 GB.
Program execution is allowed.
External devices: 1 GB.
Program execution is not allowed.
System-level components + internal private peripheral buses + external private peripheral bus + vendor-specific system peripherals: 0.5 GB.
Private peripheral bus:
1. AHB private peripheral bus, for Cortex-M3 internal AHB peripherals only.
2. APB private peripheral bus, for Cortex-M3 internal APB devices as well as external peripherals.
Bit-Band Operations
Bit-band operation support allows a single load/store (read/write) operation to access a single data bit.
Bit-band regions:
1. The first 1 MB of the SRAM region
2. The first 1 MB of the peripheral region
They can be accessed via a separate memory region called the bit-band alias.
To set bit 2 in word data in address 0x20000000
Write:
1. Without Bit-Band:
LDR R0, =0x20000000 ; Setup address LDR R1, [R0] ;
Read ORR.W R1, #0x4 ; Modify bit
STR R1, [R0] ; Write back result
2. With Bit-Band:
LDR R0, =0x22000008 ; Setup address
MOV R1, #1 ; Setup data
STR R1, [R0] ; Write
Read:
1. Without Bit-Band:
LDR R0, =0x20000000 ; Setup address
LDR R1, [R0] ; Read
UBFX.W R1, R1, #2, #1 ; Extract bit[2]
2. With Bit-Band:
LDR R0, =0x22000008 ; Setup address
LDR R1, [R0] ; Read
For read operations, the word is read and the chosen bit location is shifted to the LSB of the read return data.
For write operations, the written bit data is shifted to the required bit position, and a READ-MODIFY-WRITE is performed.
Cortex-M3 and Cortex-M4 Memory Organization的更多相关文章
- ARM 架构、ARM7、ARM9、STM32、Cortex M3 M4 、51、AVR 之间有什么区别和联系?(转载自知乎)
ARM架构: 由英国ARM公司设计的一系列32位的RISC微处理器架构总称,现有ARMv1~ARMv8种类. ARM7: 一类采用ARMv3或ARMv4架构的,使用冯诺依曼结构的内核. ...
- 【ARM-Linux开发】ARM7 ARM9 ARM Cortex M3 M4 有什么区别
ARM7 ARM9 ARM Cortex M3 M4 区别 arm7 arm9 可以类比386和奔腾, 不同代,arm9相比arm7指令集和性能都有所增强,arm7和arm9都有带mmu和无mmu的版 ...
- Implementation of Serial Wire JTAG flash programming in ARM Cortex M3 Processors
Implementation of Serial Wire JTAG flash programming in ARM Cortex M3 Processors The goal of the pro ...
- 【freertos】002-posix模拟器设计与cortex m3异常处理
目录 前言 posix 标准接口层设计 模拟器的系统心跳 模拟器的task底层实质 模拟器的任务切换原理 cortex M3/M4异常处理 双堆栈指针 双操作模式 栈帧 EXC_RETURN 前言 如 ...
- ARM Cortex M3系列GPIO口介绍(工作方式探讨)
一.Cortex M3的GPIO口特性 在介绍GPIO口功能前,有必要先说明一下M3的结构框图,这样能够更好理解总线结构和GPIO所处的位置. Cortex M3结构框图 从图中可以看出 ...
- ARM Cortex M3(V7-M架构)硬件启动程序 一
Cortex-m3启动代码分析笔记 启动代码文件名是STM32F10X.S,它的作用先总结下,然后再分析. 启动代码作用一般是: 1)堆和栈的初始化: 2)中断向量表定义: 3)地址重映射及中断向量表 ...
- STM32学习之路入门篇之指令集及cortex——m3的存储系统
STM32学习之路入门篇之指令集及cortex——m3的存储系统 一.汇编语言基础 一).汇编语言:基本语法 1.汇编指令最典型的书写模式: 标号 操作码 操作数1, 操作数2,... ...
- ARM Cortex M3(V7-M架构)硬件启动程序 二
解析 STM32 的启动过程 解析STM32的启动过程 当前的嵌入式应用程序开发过程里,并且C语言成为了绝大部分场合的最佳选择.如此一来main函数似乎成为了理所当然的起点——因为C程序往往从main ...
- stm32和cortex M3学习内核简单总结
1.stm32综述 2.寄存器组 3.操作模式和特权级别 4.存储器映射 5.中断和异常 6.其他 Stm32综述 这可以说是我第一款认真学习的单片机了,学完这个就要开启我通往arm9的大门了,接下来 ...
- CORTEX -M3 : Registers in depth
http://www.zembedded.com/cortex-m3-registers-in-depth/ Thanks for the overwhelm response you show in ...
随机推荐
- centos7-sar工具的安装过程及其简单应用
一.sar工具安装 1.进入yum配置文件目录: cd /etc/yum.repos.d/ 2.vi CentOS-Base.repo命令创建文件CentOS-Base.repo 文件内容见网页:ht ...
- python tornado 中使用 flash消息闪现
1.html 中引入文件 {% block head %} <link href="/static/common/sweetalert/sweetalert.css" rel ...
- redis aof文件过大问题
http://www.itnose.net/detail/6682725.html 最近新安装了一台redis,版本为redis-3.2.5 数据盘用的是固态硬盘. 之前用的是普通硬盘,redis日志 ...
- vue数据传递--我有特殊的实现技巧
最近碰到了比较多的关于vue的eventBus的问题,之前定技术选型的时候也被问到了,vuex和eventBus的使用范围.所以简单的写一下.同时有一种特殊的实现方案. 有这么几种数据传递方式,vue ...
- 【转+整理+答案】python315+道面试题
提示 自己整理的答案,很局限,如有需要改进的地方,或者有更好的答案,欢迎提出! [合理利用 Ctrl+F 提高查找效率] 第一部分 Python基础篇(80题) 1.为什么学习Python? # 因为 ...
- hdu 5692(dfs序+线段树,好题)
Snacks Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Sub ...
- Android项目包命名规则是怎样的?
com.example.app.activity | Activity 类com.example.app.widget | 自定义的小UIcom.example.app.db | 数据库相关操作com ...
- day2、购物商城
作业:购物商城 商品展示,价格 买,加入购物车 付款,钱不够 代码如下: import codecs #登录接口,用户名密码都正确登录成功,否则失败 def login(your_name,your_ ...
- [实战]MVC5+EF6+MySql企业网盘实战(14)——思考
写在前面 从上面更新编辑文件夹,就一直在思考一个问题,之前编辑文件夹名称,只是逻辑上的修改,但是保存的物理文件或者文件夹名称并没有进行修改,这样就导致一个问题,就是在文件或者文件夹修改名称后就会找不到 ...
- SPOJ GSS3-Can you answer these queries III-分治+线段树区间合并
Can you answer these queries III SPOJ - GSS3 这道题和洛谷的小白逛公园一样的题目. 传送门: 洛谷 P4513 小白逛公园-区间最大子段和-分治+线段树区间 ...