没有合适的资源?快使用搜索试试~ 我知道了~
资源详情
资源评论
资源推荐
May 2019 RM0440 Rev 1 1/2083
1
RM0440
Reference manual
STM32G4 Series
advanced Arm
®
-based 32-bit MCUs
Introduction
This reference manual targets application developers. It provides complete information on
how to use the STM32G4 Series microcontroller memory and peripherals.
The STM32G4 Series is a family of microcontrollers with different memory sizes, packages
and peripherals.
For ordering information, mechanical and electrical device characteristics please refer to the
corresponding datasheets.
For information on the Arm
®
Cortex
®
-M4 core, refer to the Cortex
®
-M4 Technical Reference
Manual.
Related documents
• Cortex
®
-M4 Technical Reference Manual, available from: http://infocenter.arm.com
• STM32G4xx datasheets
• STM32F3, STM32F4, STM32G4 and STM32L4 Series Cortex
®
-M4 programming manual
(PM0214)
www.st.com
Contents RM0440
2/2083 RM0440 Rev 1
Contents
1 Documentation conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
1.1 General information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
1.2 List of abbreviations for registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
1.3 Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
1.4 Product category definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
1.5 Availability of peripherals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
2 System and memory overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
2.1 System architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
2.1.1 I-bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
2.1.2 D-bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
2.1.3 S-bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
2.1.4 DMA-bus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
2.1.5 BusMatrix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77
2.2 Memory organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
2.2.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
2.2.2 Memory map and register boundary addresses . . . . . . . . . . . . . . . . . . 79
2.3 Bit banding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
2.4 Embedded SRAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
2.4.1 Parity check . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
2.4.2 CCM SRAM Write protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
2.4.3 CCM SRAM read protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
2.4.4 CCM SRAM erase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
2.5 Flash memory overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
2.6 Boot configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
2.6.1 Boot configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
3 Embedded Flash memory (FLASH)
for category 3 devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
3.2 FLASH main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
3.3 FLASH functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
3.3.1 Flash memory organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
RM0440 Rev 1 3/2083
RM0440 Contents
47
3.3.2 Error code correction (ECC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
3.3.3 Read access latency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
3.3.4 Adaptive real-time memory accelerator (ART Accelerator™) . . . . . . . . 96
3.3.5 Flash program and erase operations . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
3.3.6 Flash main memory erase sequences . . . . . . . . . . . . . . . . . . . . . . . . . . 99
3.3.7 Flash main memory programming sequences . . . . . . . . . . . . . . . . . . . 100
3.3.8 Read-while-write (RWW) available only in dual bank mode
(DBANK=1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
3.4 FLASH option bytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
3.4.1 Option bytes description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
3.4.2 Option bytes programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
3.5 FLASH memory protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .117
3.5.1 Read protection (RDP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
3.5.2 Proprietary code readout protection (PCROP) . . . . . . . . . . . . . . . . . . 120
3.5.3 Write protection (WRP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
3.5.4 Securable memory area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
3.5.5 Disabling core debug access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
3.5.6 Forcing boot from Flash memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
3.6 FLASH interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 124
3.7 FLASH registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
3.7.1 Flash access control register (FLASH_ACR) . . . . . . . . . . . . . . . . . . . 125
3.7.2 Flash Power-down key register (FLASH_PDKEYR) . . . . . . . . . . . . . . 126
3.7.3 Flash key register (FLASH_KEYR) . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
3.7.4 Flash option key register (FLASH_OPTKEYR) . . . . . . . . . . . . . . . . . . 127
3.7.5 Flash status register (FLASH_SR) . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
3.7.6 Flash control register (FLASH_CR) . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
3.7.7 Flash ECC register (FLASH_ECCR) . . . . . . . . . . . . . . . . . . . . . . . . . . 132
3.7.8 Flash option register (FLASH_OPTR) . . . . . . . . . . . . . . . . . . . . . . . . . 134
3.7.9 Flash PCROP1 Start address register (FLASH_PCROP1SR) . . . . . . 136
3.7.10 Flash PCROP1 End address register (FLASH_PCROP1ER) . . . . . . . 137
3.7.11 Flash Bank 1 WRP area A address register (FLASH_WRP1AR) . . . . 138
3.7.12 Flash Bank 1 WRP area B address register (FLASH_WRP1BR) . . . . 138
3.7.13 Flash PCROP2 Start address register (FLASH_PCROP2SR) . . . . . . 139
3.7.14 Flash PCROP2 End address register (FLASH_PCROP2ER) . . . . . . . 139
3.7.15 Flash Bank 2 WRP area A address register (FLASH_WRP2AR) . . . . 140
3.7.16 Flash Bank 2 WRP area B address register (FLASH_WRP2BR) . . . . 141
3.7.17 Flash Securable area bank1 register (FLASH_SEC1R) . . . . . . . . . . . 141
Contents RM0440
4/2083 RM0440 Rev 1
3.7.18 Flash Securable area bank2 register (FLASH_SEC2R) . . . . . . . . . . . 142
3.7.19 FLASH register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143
4 Embedded Flash memory (FLASH)
for category 2 devices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
4.2 FLASH main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
4.3 FLASH functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
4.3.1 Flash memory organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
4.3.2 Error code correction (ECC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
4.3.3 Read access latency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
4.3.4 Adaptive real-time memory accelerator (ART Accelerator™) . . . . . . . 148
4.3.5 Flash program and erase operations . . . . . . . . . . . . . . . . . . . . . . . . . . 151
4.3.6 Flash main memory erase sequences . . . . . . . . . . . . . . . . . . . . . . . . . 152
4.3.7 Flash main memory programming sequences . . . . . . . . . . . . . . . . . . . 153
4.4 FLASH option bytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
4.4.1 Option bytes description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
4.4.2 Option bytes programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
4.5 FLASH memory protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
4.5.1 Read protection (RDP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
4.5.2 Proprietary code readout protection (PCROP) . . . . . . . . . . . . . . . . . . 166
4.5.3 Write protection (WRP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
4.5.4 Securable memory area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
4.5.5 Disabling core debug access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
4.5.6 Forcing boot from Flash memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
4.6 FLASH interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
4.7 FLASH registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
4.7.1 Flash access control register (FLASH_ACR) . . . . . . . . . . . . . . . . . . . 171
4.7.2 Flash Power-down key register (FLASH_PDKEYR) . . . . . . . . . . . . . . 172
4.7.3 Flash key register (FLASH_KEYR) . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
4.7.4 Flash option key register (FLASH_OPTKEYR) . . . . . . . . . . . . . . . . . . 173
4.7.5 Flash status register (FLASH_SR) . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
4.7.6 Flash control register (FLASH_CR) . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
4.7.7 Flash ECC register (FLASH_ECCR) . . . . . . . . . . . . . . . . . . . . . . . . . . 177
4.7.8 Flash option register (FLASH_OPTR) . . . . . . . . . . . . . . . . . . . . . . . . . 178
4.7.9 Flash PCROP1 Start address register (FLASH_PCROP1SR) . . . . . . 180
RM0440 Rev 1 5/2083
RM0440 Contents
47
4.7.10 Flash PCROP1 End address register (FLASH_PCROP1ER) . . . . . . . 181
4.7.11 Flash WRP area A address register (FLASH_WRP1AR) . . . . . . . . . . 181
4.7.12 Flash WRP area B address register (FLASH_WRP1BR) . . . . . . . . . . 182
4.7.13 Flash Securable area register (FLASH_SEC1R) . . . . . . . . . . . . . . . . . 182
4.7.14 FLASH register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
5 Power control (PWR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
5.1 Power supplies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
5.1.1 Independent analog peripherals supply . . . . . . . . . . . . . . . . . . . . . . . . 187
5.1.2 USB transceivers supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
5.1.3 Battery backup domain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
5.1.4 Voltage regulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
5.1.5 Dynamic voltage scaling management . . . . . . . . . . . . . . . . . . . . . . . . 190
5.2 Power supply supervisor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
5.2.1 Power-on reset (POR) / power-down reset (PDR) / brown-out reset
(BOR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
5.2.2 Programmable voltage detector (PVD) . . . . . . . . . . . . . . . . . . . . . . . . 193
5.2.3 Peripheral Voltage Monitoring (PVM) . . . . . . . . . . . . . . . . . . . . . . . . . 194
5.3 Low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
5.3.1 Run mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
5.3.2 Low-power run mode (LP run) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
5.3.3 Low power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
5.3.4 Sleep mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
5.3.5 Low-power sleep mode (LP sleep) . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
5.3.6 Stop 0 mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
5.3.7 Stop 1 mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
5.3.8 Standby mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
5.3.9 Shutdown mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
5.3.10 Auto-wakeup from low-power mode . . . . . . . . . . . . . . . . . . . . . . . . . . 211
5.4 PWR registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
5.4.1 Power control register 1 (PWR_CR1) . . . . . . . . . . . . . . . . . . . . . . . . . 212
5.4.2 Power control register 2 (PWR_CR2) . . . . . . . . . . . . . . . . . . . . . . . . . 213
5.4.3 Power control register 3 (PWR_CR3) . . . . . . . . . . . . . . . . . . . . . . . . . 213
5.4.4 Power control register 4 (PWR_CR4) . . . . . . . . . . . . . . . . . . . . . . . . . 215
5.4.5 Power status register 1 (PWR_SR1) . . . . . . . . . . . . . . . . . . . . . . . . . . 216
5.4.6 Power status register 2 (PWR_SR2) . . . . . . . . . . . . . . . . . . . . . . . . . . 217
5.4.7 Power status clear register (PWR_SCR) . . . . . . . . . . . . . . . . . . . . . . . 218
剩余2082页未读,继续阅读
狮驼岭的小钻风
- 粉丝: 55
- 资源: 23
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0