Skip to content

Commit 89f15b3

Browse files
committed
STM32H7 : update linker script files to use right location for lwip_ram_heap
Signed-off-by: Vincent Veron <[email protected]>
1 parent 4fb8891 commit 89f15b3

File tree

3 files changed

+50
-16
lines changed

3 files changed

+50
-16
lines changed

targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H743xI/device/TOOLCHAIN_ARM_STD/stm32h743xI.sct

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@
2828
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2929
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
3030

31-
; STM32F767ZI: 2048KB FLASH (0x200000) + 128KB DTCM RAM (0x20000)
32-
; 166 vectors = 664 bytes (0x298) to be reserved in RAM
33-
3431
#if !defined(MBED_APP_START)
3532
#define MBED_APP_START 0x08000000
3633
#endif
@@ -45,8 +42,8 @@
4542

4643
#define Stack_Size MBED_BOOT_STACK_SIZE
4744

48-
#define MBED_RAM_START 0x20000000
49-
#define MBED_RAM_SIZE 0x20000
45+
#define MBED_RAM_START 0x24000000
46+
#define MBED_RAM_SIZE 0x80000
5047
#define MBED_VECTTABLE_RAM_START (MBED_RAM_START)
5148
#define MBED_VECTTABLE_RAM_SIZE 0x298
5249
#define MBED_CRASH_REPORT_RAM_START (MBED_VECTTABLE_RAM_START + MBED_VECTTABLE_RAM_SIZE)
@@ -61,7 +58,7 @@ LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
6158
*(InRoot$$Sections)
6259
.ANY (+RO)
6360
}
64-
61+
6562
RW_m_crash_data MBED_CRASH_REPORT_RAM_START EMPTY MBED_CRASH_REPORT_RAM_SIZE { ; RW data
6663
}
6764

@@ -71,4 +68,18 @@ LR_IROM1 MBED_APP_START MBED_APP_SIZE { ; load region size_region
7168

7269
ARM_LIB_STACK (MBED_RAM0_START+MBED_RAM0_SIZE) EMPTY -Stack_Size { ; stack
7370
}
71+
72+
RW_DMARxDscrTab 0x30040000 0x60 {
73+
*(.RxDecripSection)
74+
}
75+
RW_DMATxDscrTab 0x30040100 0x140 {
76+
*(.TxDecripSection)
77+
}
78+
RW_Rx_Buffb 0x30040400 0x1800 {
79+
*(.RxArraySection)
80+
}
81+
RW_Eth_Ram 0x30044000 0x4000 {
82+
*(.ethusbram)
83+
}
84+
7485
}

targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H743xI/device/TOOLCHAIN_GCC_ARM/STM32H743xI.ld

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,12 @@ M_CRASH_DATA_RAM_SIZE = 0x100;
1818

1919
MEMORY
2020
{
21-
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
22-
RAM (rwx) : ORIGIN = 0x20000298, LENGTH = 128K - 0x298
21+
FLASH (rx) : ORIGIN = MBED_APP_START, LENGTH = MBED_APP_SIZE
22+
DTCMRAM (rwx) : ORIGIN = 0x20000000, LENGTH = 128K
23+
RAM (xrw) : ORIGIN = 0x24000298, LENGTH = 512K - 0x298 /* end = 0x24080000 */
24+
RAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 288K
25+
RAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 64K
26+
ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K
2327
}
2428

2529
/* Linker script to place sections and symbol values. Should be used together
@@ -180,4 +184,19 @@ SECTIONS
180184

181185
/* Check if data + heap + stack exceeds RAM limit */
182186
ASSERT(__StackLimit >= __HeapLimit, "region RAM overflowed with stack")
183-
}
187+
188+
.lwip_sec (NOLOAD) : {
189+
. = ABSOLUTE(0x30040000);
190+
*(.RxDecripSection)
191+
192+
. = ABSOLUTE(0x30040100);
193+
*(.TxDecripSection)
194+
195+
. = ABSOLUTE(0x30040400);
196+
*(.RxArraySection)
197+
198+
. = ABSOLUTE(0x30044000);
199+
*(.ethusbram)
200+
201+
} >RAM_D2 AT> FLASH
202+
}

targets/TARGET_STM/TARGET_STM32H7/TARGET_STM32H743xI/device/TOOLCHAIN_IAR/stm32h743xI.icf

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,26 @@ define symbol __intvec_start__ = MBED_APP_START;
77
define symbol __region_ROM_start__ = MBED_APP_START;
88
define symbol __region_ROM_end__ = MBED_APP_START + MBED_APP_SIZE - 1;
99

10-
// 128KB DTCM RAM (0x20000)
10+
// 512KB RAM (0x80000)
1111
// Vector table dynamic copy: 166 vectors = 664 bytes (0x298) reserved
1212
// Crash data area: 256 bytes (0x100) reserved
13-
define symbol __NVIC_start__ = 0x20000000;
14-
define symbol __NVIC_end__ = 0x20000297;
15-
define symbol __region_CRASH_DATA_RAM_start__ = 0x20000298; // Aligned on 8 bytes
16-
define symbol __region_CRASH_DATA_RAM_end__ = 0x20000397;
17-
define symbol __region_RAM_start__ = 0x20000398; // Aligned on 8 bytes
18-
define symbol __region_RAM_end__ = 0x20000000 + 0x20000 - 1;
13+
define symbol __NVIC_start__ = 0x24000000;
14+
define symbol __NVIC_end__ = 0x24000297;
15+
define symbol __region_CRASH_DATA_RAM_start__ = 0x24000298; // Aligned on 8 bytes
16+
define symbol __region_CRASH_DATA_RAM_end__ = 0x24000397;
17+
define symbol __region_RAM_start__ = 0x24000398; // Aligned on 8 bytes
18+
define symbol __region_RAM_end__ = 0x24000000 + 0x80000 - 1;
1919

2020
// Memory regions
2121
define memory mem with size = 4G;
2222
define region ROM_region = mem:[from __region_ROM_start__ to __region_ROM_end__];
2323
define region RAM_region = mem:[from __region_RAM_start__ to __region_RAM_end__];
2424
define region CRASH_DATA_RAM_region = mem:[from __region_CRASH_DATA_RAM_start__ to __region_CRASH_DATA_RAM_end__];
2525

26+
// Memory region used for ethernet
27+
define region eth_mem_region = mem:[from 0x30044000 to 0x30048000 ];
28+
place in eth_mem_region { section .ethusbram };
29+
2630
// Crash data symbols
2731
define exported symbol __CRASH_DATA_RAM_START__ = __region_CRASH_DATA_RAM_start__;
2832
define exported symbol __CRASH_DATA_RAM_END__ = __region_CRASH_DATA_RAM_end__;

0 commit comments

Comments
 (0)