2 *****************************************************************************
4 ** File : stm32_flash.ld
6 ** Abstract : Linker script for STM32G474 (Category 3) device with
7 ** 512KByte FLASH and 96KByte SRAM and 32KByte CCM SRAM
9 *****************************************************************************
12 /* Specify the memory areas. */
15 FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 10K
16 FLASH_CUSTOM_DEFAULTS (r) : ORIGIN = 0x08002800, LENGTH = 6K
17 FLASH_CONFIG (r) : ORIGIN = 0x08004000, LENGTH = 8K
18 FLASH1 (rx) : ORIGIN = 0x08006000, LENGTH = DEFINED(USE_CUSTOM_DEFAULTS_EXTENDED) ? 480K : 488K
19 FLASH_CUSTOM_DEFAULTS_EXTENDED (r): ORIGIN = DEFINED(USE_CUSTOM_DEFAULTS_EXTENDED) ? 0x0807E000 : 0x08080000, LENGTH = DEFINED(USE_CUSTOM_DEFAULTS_EXTENDED) ? 8K : 0K
22 SYSTEM_MEMORY (r) : ORIGIN = 0x1FFF0000, LENGTH = 64K
23 /* Below are the true lengths for normal and close coupled RAM
24 * RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 96K
25 * CCM (xrw) : ORIGIN = 0x20018000, LENGTH = 32K
26 * Allow normal RAM overflow to occupy start of CCM, and only reserve 2560 bytes for vector table and stack in CCM
27 * CCM is aligned to a 512 byte boundary
29 RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128512
30 CCM (xrw) : ORIGIN = 0x2001F600, LENGTH = 2560
31 MEMORY_B1 (rx) : ORIGIN = 0x60000000, LENGTH = 0K
34 REGION_ALIAS("STACKRAM", CCM)
35 REGION_ALIAS("FASTRAM", CCM)
36 REGION_ALIAS("VECTAB", CCM)
38 /* Put various bits and bobs of data into the free space after the vector table in sector 0 to save flash space. */
40 REGION_ALIAS("MOVABLE_FLASH", FLASH)
42 INCLUDE "stm32_flash_g4_split.ld"