27
27
#define MBED_CONF_TARGET_BOOT_STACK_SIZE 0x400
28
28
#endif
29
29
30
+ #if !defined(PICO_FLASH_SIZE_BYTES)
31
+ /* This value is normally defined by the tools
32
+ to 0x1000 for bare metal and 0x400 for RTOS */
33
+ #define PICO_FLASH_SIZE_BYTES 2048k
34
+ #endif
35
+
30
36
MEMORY
31
37
{
32
- FLASH (rx) : ORIGIN = 0x10000000, LENGTH = 2048k
38
+ FLASH (rx) : ORIGIN = 0x10000000, LENGTH = PICO_FLASH_SIZE_BYTES
33
39
RAM (rwx) : ORIGIN = 0x20000000, LENGTH = 256k
34
40
SCRATCH_X (rwx) : ORIGIN = 0x20040000, LENGTH = 4k
35
41
SCRATCH_Y (rwx) : ORIGIN = 0x20041000, LENGTH = 4k
@@ -70,11 +76,7 @@ SECTIONS
70
76
KEEP (*(.binary_info_header))
71
77
__binary_info_header_end = .;
72
78
KEEP (*(.reset))
73
- /* TODO revisit this now memset/memcpy/float in ROM */
74
- /* bit of a hack right now to exclude all floating point and time critical (e.g. memset, memcpy) code from
75
- * FLASH ... we will include any thing excluded here in .data below by default */
76
79
KEEP (*(.init))
77
- *(EXCLUDE_FILE (*libgcc.a : *libc.a :*lib_a-mem*.o *libm.a :) .text*)
78
80
*(.fini)
79
81
/* Pull all c'tors into .text */
80
82
*crtbegin.o (.ctors)
@@ -94,7 +96,6 @@ SECTIONS
94
96
} > FLASH
95
97
96
98
.rodata : {
97
- *(EXCLUDE_FILE (*libgcc.a : *libc.a :*lib_a-mem*.o *libm.a :) .rodata*)
98
99
. = ALIGN (4);
99
100
*(SORT_BY_ALIGNMENT(SORT_BY_NAME(.flashdata*)))
100
101
. = ALIGN (4);
@@ -136,10 +137,6 @@ SECTIONS
136
137
137
138
*(.time_critical*)
138
139
139
- /* remaining .text and .rodata; i.e. stuff we exclude above because we want it in RAM */
140
- *(.text*)
141
- . = ALIGN (4);
142
- *(.rodata*)
143
140
. = ALIGN (4);
144
141
145
142
*(.data*)
0 commit comments