3.1 介绍
此芯片包含各种存储器和内存映射外围设备,它们位于一个32位的连续内存空间中。本章描述了该内存空间内的内存和外围位置。
有关内存映射的详细信息显示在附加到本文档的电子表格中:s32k1xx_Memory_map.xlsx。若要访问此电子表格,请查看文档的附件列表。
Systems request |
||||||
Start address hex) |
End address hex) |
Approx Size B) |
Comments |
LMEM Region number |
Available cache modes |
S32K144 |
Flash |
|
|||||
0000_0000 |
03FF_FFFF |
64M |
Program / code flash |
R0 |
CacheableWT) |
0007_FFFF |
0400_0000 |
07FF_FFFF |
64M |
Reserved |
None |
Reserved |
x |
0800_0000 |
0FFF_FFFF |
128M |
Reserved |
None |
Reserved |
x |
1000_0000 |
13FF_FFFF |
64M |
FlexNVM / code flash |
R2 |
CacheableWT) |
1000_FFFF |
1400_0000 |
1400_0FFF |
4K |
FlexRAM |
None |
None |
1400_0FFF |
1400_0800 |
1400_087F |
128bytes |
CSE_PRAM |
None |
None |
– |
1400_1000 |
1400_107F |
128bytes |
CSE_PRAM |
None |
None |
x |
1400_1080 |
17FF_FFFF |
Reserved |
None |
Reserved |
x |
|
1800_0000 |
1BFF_FFFF |
Reserved |
None |
Reserved |
x |
|
System RAM |
|
|||||
1C00_0000 |
1FFF_FFFF |
64M |
SRAM_L extends downwards) |
None |
None |
1FFF_8000 |
2000_0000 |
200F_FFFF |
1M |
SRAM_U extends upwards) |
None |
None |
2000_6FFF |
Peripheral |
||||||
4000_0000 |
4007_FFFF |
512K |
AIPS0 |
None |
None |
x |
4008_0000 |
400F_EFFF |
508K |
Reserved |
None |
None |
x |
400F_F000 |
400F_FFFF |
4K |
GPIO |
None |
None |
x |
4010_0000 |
5FFF_FFFF |
511M |
Reserved |
None |
None |
x |
6000_0000 |
63FF_FFFF |
64M |
Reserved |
None |
None |
x |
6400_0000 |
66FF_FFFF |
48M |
Reserved |
None |
None |
x |
6700_0000 |
67FF_FFFF |
16M |
QuadSPI Rx buffer |
None |
None |
– |
6800_0000 |
6FFF_FFFF |
128M |
QuadSPI |
None |
None |
– |
7000_0000 |
DCFF_FFFF |
5.5G |
Reserved |
None |
None |
x |
E000_0000 |
E00F_FFFF |
1M |
Private Peripheral Bus |
None |
None |
x |
E010_0000 |
EFFF_FFFF |
255M |
Reserved |
None |
None |
x |
F000_0000 |
F000_0FFF |
4K |
Micro Trace Buffer MTB) registers |
None |
None |
– |
F000_1000 |
F000_1FFF |
4K |
MTB Data Watchpoint and Trace MTBDWT) registers |
None |
None |
– |
F000_2000 |
F000_2FFF |
4K |
Reserved |
None |
None |
x |
F000_3000 |
F000_3FFF |
4K |
Miscellaneous Control Module MCM) |
None |
None |
– |
F000_4000 |
F7FF_FFFF |
127M |
Reserved |
None |
None |
x |
F800_0000 |
FFFF_FFFF |
128M |
IOPORT:GPIO single cycle) |
None |
None |
– |
3.2 SRAM内存映射
3.2.1 S32K14x:SRAM存储器映射片上RAM分为两个区域:SRAM_L和SRAM_U。 RAM是SRAM_L和SRAM_U范围形成连续的块记忆图。 有关详细信息,请参阅本文档附带的S32K1xx_memory_map.xlsx。访问超出SRAM_L和SRAM_U内存范围的RAM将导致总线周期终止,然后相应的错误并请求总线主机的响应。
3.2.2 s32k11x:s32k11x片上RAM内存映射可用于以下应用:·安全关键应用:SRAM_u可以使用,从2000_0000·非安全关键应用程序开始:SRAM_u与1kb MTB一起使用。
3.2.2 S32K11x:SRAM存储器映射
在S32K11x片内RAM可用于以下应用:
•安全关键应用:可以使用SRAM_U,从2000_0000开始
•非安全关键应用:可以使用SRAM_U和1 KB MTBCM0+架构实现单个RAM控制器,因此SRAM_U和MTB称为单个连续存储区域。 S32K11x中的MTB与S32K14x中的SRAM_L位于同一位置。
有关详细信息,请参阅附于本文档的s32k1xx_Memory_map.xlsx。对芯片上RAM数量以外的内存范围的访问将导致总线周期终止,出现一个错误,随后在请求总线主服务器中出现适当的响应。
Peripheral description |
Peripheral instance |
PBRIDGE on-platform slot PACR) |
PBRIDGE off-platform slot OPACR) |
Size KB) |
Start address hex) |
End address hex) |
S32K142 |
S32K144 |
Peripheral bridge AIPS-Lite) |
AIPS Lite |
0 |
4 |
40000000 |
40000FFF |
x |
x |
|
MSCM |
MSCM |
1 |
4 |
40001000 |
40001FFF |
x |
x |
|
Reserved |
2 |
4 |
40002000 |
40002FFF |
||||
Reserved |
3 |
4 |
40003000 |
40003FFF |
||||
Reserved |
4 |
4 |
40004000 |
40004FFF |
||||
Reserved |
5 |
4 |
40005000 |
40005FFF |
||||
Reserved |
6 |
4 |
40006000 |
40006FFF |
||||
Reserved |
7 |
4 |
40007000 |
40007FFF |
||||
DMA controller |
8 |
4 |
40008000 |
40008FFF |
x |
x |
||
DMA controller transfer control descriptors |
9 |
4 |
40009000 |
40009FFF |
x |
x |
||
Reserved |
10 |
4 |
4000A000 |
4000AFFF |
||||
Reserved |
11 |
4 |
4000B000 |
4000BFFF |
||||
Reserved |
12 |
4 |
4000C000 |
4000CFFF |
||||
MPU |
13 |
4 |
4000D000 |
4000DFFF |
x |
x |
||
Reserved |
14 |
4 |
4000E000 |
4000EFFF |
||||
GPIO controller aliased to 0x400F_F000) |
GPIO |
15 |
4 |
4000F000 |
4000FFFF |
– |
– |
|
Reserved |
16 |
4 |
40010000 |
40010FFF |
||||
Reserved |
17 |
4 |
40011000 |
40011FFF |
||||
Reserved |
18 |
4 |
40012000 |
40012FFF |
||||
Reserved |
19 |
4 |
40013000 |
40013FFF |
||||
Reserved |
20 |
4 |
40014000 |
40014FFF |
||||
Reserved |
21 |
4 |
40015000 |
40015FFF |
||||
Reserved |
22 |
4 |
40016000 |
40016FFF |
||||
Reserved |
23 |
4 |
40017000 |
40017FFF |
||||
ERM |
24 |
4 |
40018000 |
40018FFF |
x |
x |
||
EIM |
25 |
4 |
40019000 |
40019FFF |
x |
x |
||
Reserved |
26 |
4 |
4001A000 |
4001AFFF |
||||
Reserved |
27 |
4 |
4001B000 |
4001BFFF |
||||
Reserved |
28 |
4 |
4001C000 |
4001CFFF |
||||
Reserved |
29 |
4 |
4001D000 |
4001DFFF |
||||
Reserved |
30 |
4 |
4001E000 |
4001EFFF |
||||
Reserved |
31 |
4 |
4001F000 |
4001FFFF |
||||
Flash memory |
FTFC Flash memory) |
0 |
4 |
40020000 |
40020FFF |
x |
x |
|
DMA Channel Multiplexer |
DMAMUX |
1 |
4 |
40021000 |
40021FFF |
x |
x |
|
Reserved |
2 |
4 |
40022000 |
40022FFF |
||||
Reserved |
3 |
4 |
40023000 |
40023FFF |
||||
FlexCAN |
FlexCAN 0 |
4 |
4 |
40024000 |
40024FFF |
x |
x |
|
FlexCAN |
FlexCAN 1 |
5 |
4 |
40025000 |
40025FFF |
x |
x |
|
FlexTimer |
FTM 3 |
6 |
4 |
40026000 |
40026FFF |
x |
x |
|
Analog-to-digital converter |
ADC 1 |
7 |
4 |
40027000 |
40027FFF |
x |
x |
|
Reserved |
8 |
4 |
40028000 |
40028FFF |
||||
Reserved |
9 |
4 |
40029000 |
40029FFF |
||||
Reserved |
10 |
4 |
4002A000 |
4002AFFF |
||||
FlexCAN |
FlexCAN 2 |
11 |
4 |
4002B000 |
4002BFFF |
– |
x |
|
Low Power SPI |
LPSPI 0 |
12 |
4 |
4002C000 |
4002CFFF |
x |
x |
|
Low Power SPI |
LPSPI 1 |
13 |
4 |
4002D000 |
4002DFFF |
x |
x |
|
Low Power SPI |
LPSPI 2 |
14 |
4 |
4002E000 |
4002EFFF |
– |
x |
|
Reserved |
15 |
4 |
4002F000 |
4002FFFF |
||||
Reserved |
16 |
4 |
40030000 |
40030FFF |
||||
Programmable delay block |
PDB 1 |
17 |
4 |
40031000 |
40031FFF |
x |
x |
|
CRC |
CRC |
18 |
4 |
40032000 |
40032FFF |
x |
x |
|
Reserved |
19 |
4 |
40033000 |
40033FFF |
||||
Reserved |
20 |
4 |
40034000 |
40034FFF |
||||
Reserved |
21 |
4 |
40035000 |
40035FFF |
||||
Programmable delay block |
PDB 0 |
22 |
4 |
40036000 |
40036FFF |
x |
x |
|
Low power periodic interrupt timer |
LPIT 0 |
23 |
4 |
40037000 |
40037FFF |
x |
x |
|
FlexTimer |
FTM 0 |
24 |
4 |
40038000 |
40038FFF |
x |
x |
|
FlexTimer |
FTM 1 |
25 |
4 |
40039000 |
40039FFF |
x |
x |
|
FlexTimer |
FTM 2 |
26 |
4 |
4003A000 |
4003AFFF |
x |
x |
|
Analog-to-digital converter |
ADC 0 |
27 |
4 |
4003B000 |
4003BFFF |
x |
x |
|
Reserved |
28 |
4 |
4003C000 |
4003CFFF |
||||
Real-time counter |
RTC |
29 |
4 |
4003D000 |
4003DFFF |
x |
x |
|
Clock Monitor Unit 0 |
CMU 0 |
30 |
4 |
4003E000 |
4003EFFF |
– |
– |
|
Clock Monitor Unit 1 |
CMU 1 |
31 |
4 |
4003F000 |
4003FFFF |
– |
– |
|
Low-power timer |
LPTMR 0 |
32 |
4 |
40040000 |
40040FFF |
x |
x |
|
Reserved |
33 |
4 |
40041000 |
40041FFF |
||||
Reserved |
34 |
4 |
40042000 |
40042FFF |
||||
Reserved |
35 |
4 |
40043000 |
40043FFF |
||||
Reserved |
36 |
4 |
40044000 |
40044FFF |
||||
Reserved |
37 |
4 |
40045000 |
40045FFF |
||||
Reserved |
38 |
4 |
40046000 |
40046FFF |
||||
Reserved |
39 |
4 |
40047000 |
40047FFF |
||||
System integration module |
SIM |
40 |
4 |
40048000 |
40048FFF |
x |
x |
|
Port A multiplexing control |
Port A |
41 |
4 |
40049000 |
40049FFF |
x |
x |
|
Port B multiplexing control |
Port B |
42 |
4 |
4004A000 |
4004AFFF |
x |
x |
|
Port C multiplexing control |
Port C |
43 |
4 |
4004B000 |
4004BFFF |
x |
x |
|
Port D multiplexing control |
Port D |
44 |
4 |
4004C000 |
4004CFFF |
x |
x |
|
Port E multiplexing control |
Port E |
45 |
4 |
4004D000 |
4004DFFF |
x |
x |
|
Reserved |
46 |
4 |
4004E000 |
4004EFFF |
||||
Reserved |
47 |
4 |
4004F000 |
4004FFFF |
||||
Reserved |
48 |
4 |
40050000 |
40050FFF |
||||
Reserved |
49 |
4 |
40051000 |
40051FFF |
||||
Software watchdog |
WDOG |
50 |
4 |
40052000 |
40052FFF |
x |
x |
|
Reserved |
51 |
4 |
40053000 |
40053FFF |
||||
Synchronous Audio Interface |
SAI0 |
52 |
4 |
40054000 |
40054FFF |
– |
– |
|
Synchronous Audio Interface |
SAI1 |
53 |
4 |
40055000 |
40055FFF |
– |
– |
|
Reserved |
54 |
4 |
40056000 |
40056FFF |
||||
Reserved |
55 |
4 |
40057000 |
40057FFF |
||||
Reserved |
56 |
4 |
40058000 |
40058FFF |
||||
Reserved |
57 |
4 |
40059000 |
40059FFF |
||||
Flexible IO |
FlexIO |
58 |
4 |
4005A000 |
4005AFFF |
x |
x |
|
Reserved |
59 |
4 |
4005B000 |
4005BFFF |
||||
Reserved |
60 |
4 |
4005C000 |
4005CFFF |
||||
Reserved |
61 |
4 |
4005D000 |
4005DFFF |
||||
Reserved |
62 |
4 |
4005E000 |
4005EFFF |
||||
Reserved |
63 |
4 |
4005F000 |
4005FFFF |
||||
Reserved |
64 |
4 |
40060000 |
40060FFF |
||||
External watchdog |
EWM |
65 |
4 |
40061000 |
40061FFF |
x |
x |
|
Reserved |
66 |
4 |
40062000 |
40062FFF |
||||
Trigger Multiplexing Control |
TRGMUX |
67 |
4 |
40063000 |
40063FFF |
x |
x |
|
System Clock Generator |
SCG |
68 |
4 |
40064000 |
40064FFF |
x |
x |
|
Peripheral Clock Control |
PCC |
69 |
4 |
40065000 |
40065FFF |
x |
x |
|
Low Power I2C |
LPI2C 0 |
70 |
4 |
40066000 |
40066FFF |
x |
x |
|
Low Power I2C |
LPI2C 1 |
71 |
4 |
40067000 |
40067FFF |
– |
– |
|
Reserved |
72 |
4 |
40068000 |
40068FFF |
||||
Reserved |
73 |
4 |
40069000 |
40069FFF |
||||
Low Power UART |
LPUART 0 |
74 |
4 |
4006A000 |
4006AFFF |
x |
x |
|
Low Power UART |
LPUART 1 |
75 |
4 |
4006B000 |
4006BFFF |
x |
x |
|
Low Power UART |
LPUART 2 |
76 |
4 |
4006C000 |
4006CFFF |
– |
x |
|
Reserved |
77 |
4 |
4006D000 |
4006DFFF |
||||
FlexTimer |
FTM 4 |
78 |
4 |
4006E000 |
4006EFFF |
– |
– |
|
FlexTimer |
FTM 5 |
79 |
4 |
4006F000 |
4006FFFF |
– |
– |
|
FlexTimer |
FTM 6 |
80 |
4 |
40070000 |
40070FFF |
– |
– |
|
FlexTimer |
FTM 7 |
81 |
4 |
40071000 |
40071FFF |
– |
– |
|
Reserved |
82 |
4 |
40072000 |
40072FFF |
||||
Analog comparator |
CMP 0 |
83 |
4 |
40073000 |
40073FFF |
x |
x |
|
Reserved |
84 |
4 |
40074000 |
40074FFF |
||||
Reserved |
85 |
4 |
40075000 |
40075FFF |
||||
QuadSPI |
QuadSPI |
86 |
4 |
40076000 |
40076FFF |
– |
– |
|
Reserved |
87 |
4 |
40077000 |
40077FFF |
||||
Reserved |
88 |
4 |
40078000 |
40078FFF |
||||
Ethernet |
ENET |
89 |
4 |
40079000 |
40079FFF |
– |
– |
|
Reserved |
90 |
4 |
4007A000 |
4007AFFF |
||||
Reserved |
91 |
4 |
4007B000 |
4007BFFF |
||||
Reserved |
92 |
4 |
4007C000 |
4007CFFF |
||||
Power management controller |
PMC |
93 |
4 |
4007D000 |
4007DFFF |
x |
x |
|
System Mode controller |
SMC |
94 |
4 |
4007E000 |
4007EFFF |
x |
x |
|
Reset Control Module |
RCM |
95 |
4 |
4007F000 |
4007FFFF |
x |
x |
|
GPIO controller |
GPIO |
4 |
400FF000 |
400FFFFF |
x |
x |
3.3闪存映射
各种闪存和闪存寄存器位于不同的基址,如下图所示。 在此文档附加的S32K1xx_Memory_map.xlsx文件中指定了每个的基本地址。
3.4外设桥AIPS-Lite)内存映射
外设内存映射可以通过交叉端口访问。有三个与外围空间相关的区域,如下表所示。
地址范围 |
区域描述 |
0x4000_0000–0x4001_FFFF |
一个128 kb的区域,划分为32个空间,每个空间大小为4kb,为平台上的外设保留。AIPS-Lite为所有32个空间生成唯一的模块。 |
0x4002_0000–0x4007_FFFF |
一个384 kb的区域,划分为96个空间,每个空间的大小为4kb,为非平台模块保留。AIPS-Lite为所有96个空间生成唯一的模块。 |
0x400F_F000 |
一个4KB区域,用于访问GPIO模块。 该块经由端口分离器连接到AMBA总线,并且提供直接的主接入而不会导致与经由AISPS-Lite模块的接入相关联的等待状态。 GPIO仅在该区域的上部空间中实现(从0x400F_F000开始的4KB)。 |
通过PCC / SIM寄存器中的时钟门控制禁用位的模块禁用相关的AIPS-Lite插槽。访问未实现或禁用的外围桥接器插槽中的任何地址都会导致传输错误终止。
(译者:当访问为是能时钟的外设时,或产生一个错误。在使用一个外设时,必须保证时钟位是开启的)
注意:当试图通过PCC CGC位访问具有相应模块时钟的不可用功能的内存映射区域请参阅sim_sdid[功能])时,将不会出现任何传输错误终止。
3.4.1写后读序列和所需的内存操作序列化
在某些情况下,必须在后续操作发生之前完全写入外设。 这种情况的例子包括:
•退出中断服务程序(ISR)
•更改模式
•配置功能
在这些情况下,应用程序软件必须执行写后读序列以保证所需的内存操作序列化,如下表所示。
表3-2.确保所需的内存操作序列化的读写顺序
步骤 |
动作 |
1 |
写外设寄存器 |
2 |
读取写好的外围寄存器以验证写入。 |
3 |
继续后续操作。 |
注意
在S32K14x系列器件中,导致这些情况的一个因素是处理器写缓冲。 处理器架构具有可编程配置字段以禁用写缓冲:ACTLR [DISDEFWBUF]。(有关详细信息,请参阅Arm®Cortex®M4处理器技术参考手册,修订版r0p1,网址为http://arm.com)。但是,禁用缓冲写入可能会降低系统性能,而不仅仅是为真正需要它的情况执行所需的内存序列化。
3.5私有外围总线Ppb)内存映射
PPB是定义的ARM总线体系结构的一部分,并提供对选定处理器-本地模块的访问。这些资源只能从核心访问;其他系统主程序不能访问它们。
Table 3-3.PPB memory map for CM4
System 32-bit address range Resource 0xE000_0000–0xE000_0FFF
|
Instrumentation Trace Macrocell ITM) |
0xE000_1000–0xE000_1FFF |
Data Watchpoint and Trace DWT) |
0xE000_2000–0xE000_2FFF |
Flash Patch and Breakpoint FPB) |
0xE000_3000–0xE000_DFFF |
Reserved |
0xE000_E000–0xE000_EFFF |
System Control Space SCS) for NVIC and FPU |
0xE000_F000–0xE003_FFFF |
Reserved |
0xE004_0000–0xE004_0FFF |
Trace Port Interface Unit TPIU) |
0xE004_1000–0xE004_1FFF |
Reserved |
0xE004_2000–0xE004_2FFF |
Reserved |
0xE004_3000–0xE004_3FFF |
Reserved |
0xE004_4000–0xE007_FFFF |
Reserved |
0xE008_0000–0xE008_0FFF |
Miscellaneous Control Module MCM) |
0xE008_1000–0xE008_1FFF |
Reserved |
0xE008_2000–0xE008_2FFF |
Cache Controller LMEM) |
0xE008_3000–0xE00F_EFFF |
Reserved |
0xE00F_F000–0xE00F_FFFF |
Arm Core ROM Table1 – allows auto-detection of debug components |
0xE000_0000–0xE000_0FFF |
Reserved 1 |
0xE000_1000–0xE000_1FFF |
Data Watchpoint and Trace DWT) |
0xE000_2000–0xE000_2FFF |
Arm Core ROM Table |
0xE000_3000–0xE000_DFFF |
Reserved1 |
0xE000_E000–0xE000_EFFF |
System Control Space SCS) for NVIC) |
0xE000_F000–0xE003_FFFF Reserved1 0xE004_0000–0xE004_0FFF Reserved1 0xE004_1000–0xE004_1FFF Reserved1 0xE004_2000–0xE004_2FFF Reserved1 0xE004_3000–0xE004_3FFF Reserved1 0xE004_4000–0xE007_FFFF Reserved1 0xE008_0000–0xE008_0FFF Reserved1 0xE008_1000–0xE008_1FFF Reserved1 0xE008_2000–0xE008_2FFF Reserved1 0xE008_3000–0xE00F_EFFF Reserved1 0xE00F_F000–0xE00F_FFFF Reserved1 0xE010_0000-0xEFFF_FFFFReserved1 |
|
3.6 CM4核心的别名比特带区域
SRAM_U,AIPS-Lite和通用输入/输出(GPIO)模块资源位于Cortex-M4F处理器位带区域。
处理器还包括与两个1 MB位带空间相关联的两个32MB别名位带区域。 32 MB空间中的每个32位位置映射到位带区域中的单个位。别名区域中的32位写入与位带区域中的目标位的读取修改 – 写入操作具有相同的效果。
写入别名区域的值的位0确定写入目标位的值:
•置位写入会将1写入目标位。
•清零写入值会将0写入目标位。
别名区域中的32位读取返回:
•值0x0000_0000表示目标位清零
•值0x0000_0001表示目标位置位
请注意,位带区域中的每一位都有一个等价的位,可以在别名位带区域的对应长字中通过位0操作。
注意,不要对w1c状态位使用位带。
请注意s32k产品系列和软件驱动程序支持位带化,但是ARM不再推荐它的使用。因我们建议不应该使用位带。