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 ...
随机推荐
- ActiveMQ-Prefetch机制和constantPendingMessageLimitStrategy
首先简要介绍一下prefetch机制.ActiveMQ通过prefetch机制来提高性能,这意味这 客户端的内存里可能会缓存一定数量的消息.缓存消息的数量由prefetch limit来控 制.当某个 ...
- MINI_httpd移植,构建小型WEB服务器
一.简介 目的:构建小型WEB站,具备SSL. mini_httpd is a small HTTP server. Its performance is not great, but for low ...
- Oracle数据库(64位) 及 PLSQL(64位)的组合安装【第一篇】
目前PC端普遍使用64位操作系统,64位操作系统在性能上比32位更佳,但是兼容性上则不如32的操作系统,Oracle提供了64和32两种版本,而PLsql工具则只有32位,在这篇文章详细的讲述了如何在 ...
- Percona XtraDB Cluster(PXC) -集群环境安装
Percona XtraDB Cluster(PXC) ---服务安装篇 1.测试环境搭建: Ip 角色 OS PXC-version 172.16.40.201 Node1 Redhat/C ...
- 最直白、最易懂的话带你认识和学会---数据分析基础包之numpy的使用
前言 numpy是一个很基础很底层的模块,其重要性不言而喻,可以说对于新手来说是最基础的入门必须要学习的其中之一.在很多数据分析,深度学习,机器学习亦或是人工智能领域的模块中,很多的底层都会用到这个模 ...
- OPENSSL问题,使用fsockopen()函数提示错误
环境配置 系统环境 CentOS7.2WDCP v3.2.2 lanmp PHP 多版本 指定使用5.6 OpenSSL 1.0.2h 3 May 2016 php.ini相关设置allow_url ...
- Netty性能调优
1. 减少内存allocation和deallocation.通过静态实例和内存缓存,减少IO的次数. 2. 使用gather write和scatter read 3. 使用jDK7,因为他的byt ...
- java EE : http 协议之请求报文、响应报文
1 HTTP协议特点 1)客户端->服务端(请求request)有三部份 a)请求行 b)请求头 c)请求的内容,如果没有,就是空白字符 2)服务端->客户端(响应response)有三部 ...
- 【WPF】RenderTransform和LayoutTransform
布局系统 在WPF中,许多绘图任务通过使用变换(transform)可以变得更加简单——变换是通过不加通告地切换形状或元素使用的坐标系统来改变形状或元素绘制方式的对象.在WPF中,变换的一些类大多继承 ...
- 《java虚拟机》----java内存区域与内存溢出异常
No1: java虚拟机所管理的内存将会包括以下几个运行时数据区域 1.方法区 2.虚拟机栈 3.本地方法栈 4.堆 5.程序计数器 No2: 程序计数器: 程序计数器(Program Counter ...