| 1 |
/* |
| 2 |
Custom linker script for STM32F769DISC board with external memory-mapped QSPI flash |
| 3 |
|
| 4 |
Memory layout: |
| 5 |
|
| 6 |
FLASH_QSPI .text_qspi |
| 7 |
|
| 8 |
FLASH_APP .isr_vector |
| 9 |
FLASH_APP .text |
| 10 |
FLASH_APP .data |
| 11 |
|
| 12 |
RAM .data |
| 13 |
RAM .bss |
| 14 |
RAM .heap |
| 15 |
RAM .stack |
| 16 |
*/ |
| 17 |
|
| 18 |
MEMORY |
| 19 |
{ |
| 20 |
FLASH_FS (r) : ORIGIN = 0x08008000, LENGTH = 96K /* sectors 1, 2, 3 (32K each) */ |
| 21 |
FLASH_APP (rx) : ORIGIN = 0x08020000, LENGTH = 1920K /* sectors 4-11 1*128K 7*256K */ |
| 22 |
FLASH_QSPI (rx) : ORIGIN = 0x90000000, LENGTH = 64M /* external QSPI flash in XIP mode */ |
| 23 |
DTCM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K /* Used for storage cache */ |
| 24 |
RAM (xrw) : ORIGIN = 0x20020000, LENGTH = 384K /* SRAM1 = 368K, SRAM2 = 16K */ |
| 25 |
} |
| 26 |
|
| 27 |
/* Produce a link error if there is not this amount of RAM for these sections */ |
| 28 |
_minimum_stack_size = 2K; |
| 29 |
_minimum_heap_size = 16K; |
| 30 |
|
| 31 |
/* Define the stack. The stack is full descending so begins just above last byte |
| 32 |
of RAM. Note that EABI requires the stack to be 8-byte aligned for a call. */ |
| 33 |
_estack = ORIGIN(RAM) + LENGTH(RAM) - _estack_reserve; |
| 34 |
_sstack = _estack - 32K; /* tunable */ |
| 35 |
|
| 36 |
/* RAM extents for the garbage collector */ |
| 37 |
_ram_start = ORIGIN(RAM); |
| 38 |
_ram_end = ORIGIN(RAM) + LENGTH(RAM); |
| 39 |
_heap_start = _ebss; /* heap starts just after statically allocated memory */ |
| 40 |
_heap_end = _sstack; |
| 41 |
|
| 42 |
/* Filesystem cache in RAM, and storage in flash */ |
| 43 |
_micropy_hw_internal_flash_storage_ram_cache_start = ORIGIN(DTCM); |
| 44 |
_micropy_hw_internal_flash_storage_ram_cache_end = ORIGIN(DTCM) + LENGTH(DTCM); |
| 45 |
_micropy_hw_internal_flash_storage_start = ORIGIN(FLASH_FS); |
| 46 |
_micropy_hw_internal_flash_storage_end = ORIGIN(FLASH_FS) + LENGTH(FLASH_FS); |
| 47 |
|
| 48 |
ENTRY(Reset_Handler) |
| 49 |
|
| 50 |
REGION_ALIAS("FLASH_ISR", FLASH_APP); |
| 51 |
REGION_ALIAS("FLASH_COMMON", FLASH_APP); |
| 52 |
|
| 53 |
SECTIONS |
| 54 |
{ |
| 55 |
/* Define the code that goes in QSPI flash */ |
| 56 |
.text_qspi : |
| 57 |
{ |
| 58 |
. = ALIGN(4); |
| 59 |
*extmod/*(.text* .rodata*) |
| 60 |
. = ALIGN(4); |
| 61 |
} >FLASH_QSPI |
| 62 |
|
| 63 |
INCLUDE common_isr.ld |
| 64 |
INCLUDE common_text.ld |
| 65 |
INCLUDE common_extratext_data_in_flash.ld |
| 66 |
INCLUDE common_bss_heap_stack.ld |
| 67 |
} |