RM0440-STM32G4
This document is addressed to application developers. It provides complete information on how to use the memory and peripherals of STM32G4 series microcontrollers. These devices come with different memory sizes, packages and peripherals, and include ST state-of-the-art patented technology.
For ordering information, mechanical and electrical device characteristics, refer to the corresponding datasheets.
For information on the Arm ® Cortex ® -M4 core, refer to the Cortex ® -M4 Technical Reference Manual .
STM32G4 series microcontrollers include ST state-of-the-art patented technology.
Related documents
- • Cortex ® -M4 Technical Reference Manual, available from: http://infocenter.arm.com
- • STM32G4xx datasheets
- • STM32G4xx erratasheets
- • PM0214: STM32 Cortex ® -M4 MCUs and MPUs programming manual
Contents
- 1 Documentation conventions . . . . . 74
- 1.1 General information . . . . . 74
- 1.2 List of abbreviations for registers . . . . . 74
- 1.3 Register reset value . . . . . 75
- 1.4 Glossary . . . . . 75
- 1.5 Product category definition . . . . . 75
- 1.6 Availability of peripherals . . . . . 76
- 2 System and memory overview . . . . . 79
- 2.1 System architecture . . . . . 79
- 2.1.1 I-bus . . . . . 80
- 2.1.2 D-bus . . . . . 80
- 2.1.3 S-bus . . . . . 81
- 2.1.4 DMA-bus . . . . . 81
- 2.1.5 BusMatrix . . . . . 81
- 2.2 Memory organization . . . . . 82
- 2.2.1 Introduction . . . . . 82
- 2.2.2 Memory map and register boundary addresses . . . . . 83
- 2.3 Bit banding . . . . . 87
- 2.4 Embedded SRAM . . . . . 88
- 2.4.1 Parity check . . . . . 89
- 2.4.2 CCM SRAM write protection . . . . . 89
- 2.4.3 CCM SRAM read protection . . . . . 90
- 2.4.4 CCM SRAM erase . . . . . 90
- 2.5 Flash memory overview . . . . . 91
- 2.6 Boot configuration . . . . . 91
- 2.6.1 Boot configuration . . . . . 91
- 2.1 System architecture . . . . . 79
- 3 Embedded flash memory (FLASH) for category 3 devices . . . . . 94
- 3.1 Introduction . . . . . 94
- 3.2 FLASH main features . . . . . 94
- 3.3 FLASH functional description . . . . . 95
| 3.3.1 | Flash memory organization . . . . . | 95 |
| 3.3.2 | Error code correction (ECC) . . . . . | 97 |
| 3.3.3 | Read access latency . . . . . | 98 |
| 3.3.4 | Adaptive real-time memory accelerator (ART Accelerator) . . . . . | 99 |
| 3.3.5 | Flash program and erase operations . . . . . | 102 |
| 3.3.6 | Flash main memory erase sequences . . . . . | 103 |
| 3.3.7 | Flash main memory programming sequences . . . . . | 104 |
| 3.3.8 | Read-while-write (RWW) available only in dual bank mode (DBANK = 1) . . . . . | 108 |
| 3.4 | FLASH option bytes . . . . . | 110 |
| 3.4.1 | Option bytes description . . . . . | 110 |
| 3.4.2 | Option bytes programming . . . . . | 118 |
| 3.5 | FLASH memory protection . . . . . | 121 |
| 3.5.1 | Read protection (RDP) . . . . . | 121 |
| 3.5.2 | Proprietary code readout protection (PCROP) . . . . . | 124 |
| 3.5.3 | Write protection (WRP) . . . . . | 126 |
| 3.5.4 | Securable memory area . . . . . | 127 |
| 3.5.5 | Disabling core debug access . . . . . | 128 |
| 3.5.6 | Forcing boot from flash memory . . . . . | 128 |
| 3.6 | FLASH interrupts . . . . . | 129 |
| 3.7 | FLASH registers . . . . . | 130 |
| 3.7.1 | Flash access control register (FLASH_ACR) . . . . . | 130 |
| 3.7.2 | Flash power-down key register (FLASH_PDKEYR) . . . . . | 131 |
| 3.7.3 | Flash key register (FLASH_KEYR) . . . . . | 132 |
| 3.7.4 | Flash option key register (FLASH_OPTKEYR) . . . . . | 132 |
| 3.7.5 | Flash status register (FLASH_SR) . . . . . | 132 |
| 3.7.6 | Flash control register (FLASH_CR) . . . . . | 134 |
| 3.7.7 | Flash ECC register (FLASH_ECCR) . . . . . | 136 |
| 3.7.8 | Flash option register (FLASH_OPTR) . . . . . | 138 |
| 3.7.9 | Flash PCROP1 Start address register (FLASH_PCROP1SR) . . . . . | 140 |
| 3.7.10 | Flash PCROP1 End address register (FLASH_PCROP1ER) . . . . . | 141 |
| 3.7.11 | Flash Bank 1 WRP area A address register (FLASH_WRP1AR) . . . . . | 141 |
| 3.7.12 | Flash Bank 1 WRP area B address register (FLASH_WRP1BR) . . . . . | 142 |
| 3.7.13 | Flash PCROP2 Start address register (FLASH_PCROP2SR) . . . . . | 142 |
| 3.7.14 | Flash PCROP2 End address register (FLASH_PCROP2ER) . . . . . | 143 |
| 3.7.15 | Flash Bank 2 WRP area A address register (FLASH_WRP2AR) . . . . . | 143 |
| 3.7.16 | Flash Bank 2 WRP area B address register (FLASH_WRP2BR) . . . . . | 144 |
3.7.17 Flash securable area bank1 register (FLASH_SEC1R) . . . . . 145
3.7.18 Flash securable area bank2 register (FLASH_SEC2R) . . . . . 145
3.7.19 FLASH register map . . . . . 147
Chapters
- 4. Embedded flash memory (FLASH) for category 4 devices . . . . . 149
- 1. Documentation conventions
- 2. System and memory overview
- 3. Embedded flash memory (FLASH) for category 3 devices
- 4. Embedded flash memory (FLASH) for category 4 devices
- 5. Embedded flash memory (FLASH) for category 2 devices
- 6. Power control (PWR)
- 7. Reset and clock control (RCC)
- 8. Clock recovery system (CRS)
- 9. General-purpose I/Os (GPIO)
- 10. System configuration controller (SYSCFG)
- 11. Peripherals interconnect matrix
- 12. Direct memory access controller (DMA)
- 13. DMA request multiplexer (DMAMUX)
- 14. Nested vectored interrupt controller (NVIC)
- 15. Extended interrupts and events controller (EXTI)
- 16. Cyclic redundancy check calculation unit (CRC)
- 17. CORDIC coprocessor (CORDIC)
- 18. Filter math accelerator (FMAC)
- 19. Flexible static memory controller (FSMC)
- 20. Quad-SPI interface (QUADSPI)
- 21. Analog-to-digital converters (ADC)
- 22. Digital-to-analog converter (DAC)
- 23. Voltage reference buffer (VREFBUF)
- 24. Comparator (COMP)
- 25. Operational amplifiers (OPAMP)
- 26. True random number generator (RNG)
- 27. AES hardware accelerator (AES)
- 28. High-resolution timer (HRTIM)
- 29. Advanced-control timers (TIM1/TIM8/TIM20)
- 30. General-purpose timers (TIM2/TIM3/TIM4/TIM5)
- 31. General purpose timers (TIM15/TIM16/TIM17)
- 32. Basic timers (TIM6/TIM7)
- 33. Low-power timer (LPTIM)
- 34. Infrared interface (IRTIM)
- 35. Independent watchdog (IWDG)
- 36. System window watchdog (WWDG)
- 37. Real-time clock (RTC)
- 38. Tamper and backup registers (TAMP)
- 39. Inter-integrated circuit interface (I2C)
- 40. Universal synchronous/asynchronous receiver transmitter (USART/UART)
- 41. Low-power universal asynchronous receiver transmitter (LPUART)
- 42. Serial peripheral interface / integrated interchip sound (SPI/I2S)
- 43. Serial audio interface (SAI)
- 44. FD controller area network (FDCAN)
- 45. Universal serial bus full-speed device interface (USB)
- 46. USB Type-C ® /USB Power Delivery interface (UCPD)
- 47. Debug support (DBG)
- 48. Device electronic signature
- 49. Important security notice
- 50. Revision history
- Index