1
1
/*
2
- GNU linker script for STM32F401 with bootloader (from Meowbit Micropython)
3
- Doesn't work :
4
-
5
- Traceback (most recent call last) :
6
- File "../../tools/build_memory_info.py", line 64, in <module>
7
- regions[region] = int(eval(space))
8
- File "<string>", line 1, in <module>
9
- NameError : name 'FLASH_ISR' is not defined
2
+ GNU linker script for STM32F405 with bootloader
3
+ Based on Micropython
10
4
*/
11
5
12
6
/* Specify the memory areas */
13
- /* FLASH_FS (rx) : ORIGIN = 0x08020000, LENGTH = 128K */
14
- /* sectors 5 128K */
15
7
MEMORY
16
8
{
17
- FLASH (rx) : ORIGIN = 0x08010000, LENGTH = 512K - 64K /* entire flash */
18
- FLASH_ISR (rx) : ORIGIN = 0x08010000, LENGTH = 64K /* sector 4, sec 0~3 reserved for booloader */
19
- FLASH_TEXT (rx) : ORIGIN = 0x08020000, LENGTH = 384K /* sectors 5, 6,7 are 128K */
20
- RAM (xrw) : ORIGIN = 0x20000194, LENGTH = 96K - 0x194
9
+ FLASH (rx) : ORIGIN = 0x08010000, LENGTH = 1024K - 64K /* entire flash, sans bootloader region */
10
+ FLASH_ISR (rx) : ORIGIN = 0x08010000, LENGTH = 64K /* sector 0 */
11
+ FLASH_TEXT (rx) : ORIGIN = 0x08020000, LENGTH = 1024K - 64K - 64K /* sectors 5+ */
12
+ CCMRAM (xrw) : ORIGIN = 0x10000000, LENGTH = 64K
13
+ RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
21
14
}
22
15
23
16
/* produce a link error if there is not this amount of RAM for these sections */
24
17
_minimum_stack_size = 2K;
25
18
_minimum_heap_size = 16K;
26
19
27
- /* Define the stack. The stack is full descending so begins just above last byte
28
- of RAM. Note that EABI requires the stack to be 8-byte aligned for a call. */
29
- _estack = ORIGIN (RAM) + LENGTH (RAM) - _estack_reserve;
30
- _sstack = _estack - 16K; /* tunable */
20
+ /* Define tho top end of the stack. The stack is full descending so begins just
21
+ above last byte of RAM. Note that EABI requires the stack to be 8-byte
22
+ aligned for a call. */
23
+ _estack = ORIGIN (RAM) + LENGTH (RAM);
31
24
32
25
/* RAM extents for the garbage collector */
33
26
_ram_start = ORIGIN (RAM);
34
27
_ram_end = ORIGIN (RAM) + LENGTH (RAM);
35
- _heap_start = _ebss; /* heap starts just after statically allocated memory */
36
- _heap_end = _sstack;
37
28
38
29
ENTRY (Reset_Handler )
39
30
@@ -47,25 +38,8 @@ SECTIONS
47
38
KEEP(*(.isr_vector)) /* Startup code */
48
39
49
40
/* This first flash block is 16K annd the isr vectors only take up
50
- about 400 bytes. So we pull in a couple of object files to pad it
51
- out. */
52
-
53
- . = ALIGN (4);
54
-
55
- /* NOTE : If you update the list of files contained in .isr_vector,
56
- then be sure to also update smhal/Makefile where it forcibly
57
- builds each of these files with -Os */
58
-
59
- */ff.o (.text*)
60
- */vfs_fat_*.o (.text*)
61
- */py/formatfloat.o (.text*)
62
- */py/parsenum.o (.text*)
63
- */py/mpprint.o (.text*)
64
-
65
- */py/compile.o (.text*)
66
- */py/objset.o (.text*)
67
- */py/mpz.o (.text*)
68
- */py/vm.o (.text*)
41
+ about 400 bytes. Micropython pads this with files, but this didn't
42
+ work with the size of Circuitpython's ff object. */
69
43
70
44
. = ALIGN (4);
71
45
} >FLASH_ISR
@@ -130,3 +104,5 @@ SECTIONS
130
104
131
105
.ARM.attributes 0 : { *(.ARM.attributes) }
132
106
}
107
+
108
+
0 commit comments