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 ...
随机推荐
- 增加Android模拟器空间(Internal Storage)
转载 http://vase.iteye.com/blog/2114664 初学Android,发现模拟器上有不少限制,譬如标题中的存储限制,无论用ADT Manager如何设置,内部存储空间不会 ...
- Windows下Oracle数据库自动备份批处理脚本
expdb命令版本 @echo off REM ########################################################### REM # Windows Se ...
- webstrom 使用git
1.首先进入码云创建项目 2.创建成功,复制https地址,打开webstrom,选择git,填入https的地址 3.下载完成,打开项目,新建一个测试测HTML文件,点击右键,选择git,再选择ad ...
- 使用angluar-cli的ng g component home指令出现的错误
Error: ELOOP: too many symbolic links encountered, stat '/Users/zzy/angular/taskmgr/node_modules/@an ...
- 11.python3标准库--使用进程、线程和协程提供并发性
''' python提供了一些复杂的工具用于管理使用进程和线程的并发操作. 通过应用这些计数,使用这些模块并发地运行作业的各个部分,即便是一些相当简单的程序也可以更快的运行 subprocess提供了 ...
- ASP.NET Core 上传大文件无法接收的问题
解决办法:在API项目中配置 1. 在 web.config 文件中 <system.webServer>里加入 <security> <requestFiltering ...
- 发布PHP项目(nginx+PHP7+mysql 5.6)
一.环境检查 1.检查nginx ps -ef | grep "nginx" 显示如下内容则代表nginx启动正常 root 3285 1 0 12:57 ? 00:00:00 n ...
- csu 1552(米勒拉宾素数测试+二分图匹配)
1552: Friends Time Limit: 3 Sec Memory Limit: 256 MBSubmit: 723 Solved: 198[Submit][Status][Web Bo ...
- **CodeIgniter通过hook的方式实现简单的权限控制
根据自己的实际情况,需要两个文件,一个是权限控制类,Acl,另外一个是权限配置的文件acl.php放在了config这个目录下. Acl这个类放在了application/hook/acl.php.通 ...
- Java学习(匿名对象、内部类、包、import、代码块)
一.匿名对象 概念:匿名对象是指在创建对象时,只有创建的语句,却没有把对象地址值赋给某个变量. 特点: (1)匿名对象直接使用,没有变量名.当做形参使用. new Person().name=&quo ...