Загрузка данных
--- a/include/zephyr/arch/arm/cortex_m/scripts/linker.ld
+++ b/include/zephyr/arch/arm/cortex_m/scripts/linker.ld
@@ -87,6 +87,9 @@ MEMORY
#endif
FLASH (rx) : ORIGIN = ROM_ADDR, LENGTH = ROM_SIZE
RAM (wx) : ORIGIN = RAM_ADDR, LENGTH = RAM_SIZE
+#if defined(CONFIG_SDRAM_LMA_ADJUST)
+ NXP_FLASH_LMA (rx) : ORIGIN = 0x60000000, LENGTH = 4M
+#endif
#if defined(CONFIG_LINKER_DEVNULL_MEMORY)
DEVNULL_ROM (rx) : ORIGIN = DEVNULL_ADDR, LENGTH = DEVNULL_SIZE
#endif
@@ -95,6 +98,17 @@ MEMORY
IDT_LIST (wx) : ORIGIN = 0xFFFF7FFF, LENGTH = 32K
}
+#define GROUP_LINK_IN_AT(where) > where
+#if defined(CONFIG_SDRAM_LMA_ADJUST)
+#undef GROUP_ROM_LINK_IN
+#undef GROUP_DATA_LINK_IN
+#undef GROUP_LINK_IN
+
+#define GROUP_ROM_LINK_IN(vregion, lregion) > vregion AT> NXP_FLASH_LMA
+#define GROUP_DATA_LINK_IN(vregion, lregion) > vregion AT> NXP_FLASH_LMA
+#define GROUP_LINK_IN(where) > where AT> NXP_FLASH_LMA
+#endif
+
ENTRY(CONFIG_KERNEL_ENTRY)
SECTIONS
@@ -225,7 +239,7 @@ SECTIONS
#include <zephyr/linker/cplusplus-rom.ld>
-#if defined(CONFIG_BUILD_ALIGN_LMA) || !defined(CONFIG_XIP)
+#if 1//defined(CONFIG_BUILD_ALIGN_LMA) || !defined(CONFIG_XIP)
/*
* Include a padding section here to make sure that the LMA address
* of the sections in the RAMABLE_REGION are aligned with those
@@ -334,7 +348,7 @@ GROUP_START(ITCM)
#include <snippets-itcm-section.ld>
__itcm_end = .;
- } GROUP_LINK_IN(ITCM AT> ROMABLE_REGION)
+ } GROUP_LINK_IN_AT(ITCM AT> ROMABLE_REGION)
__itcm_size = __itcm_end - __itcm_start;
__itcm_load_start = LOADADDR(_ITCM_SECTION_NAME);
@@ -373,7 +387,7 @@ GROUP_START(DTCM)
#include <snippets-dtcm-section.ld>
__dtcm_data_end = .;
- } GROUP_LINK_IN(DTCM AT> ROMABLE_REGION)
+ } GROUP_LINK_IN_AT(DTCM AT> ROMABLE_REGION)
Idx Name Разм VMA LMA Фа смещ. Выр.
0 rom_start 00002278 80000000 60000000 000001b4 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
1 text 000048f0 80002278 60002278 0000242c 2**2
CONTENTS, ALLOC, LOAD, READONLY, CODE
2 .ARM.exidx 00000008 80006b68 60006b68 00006d1c 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
3 initlevel 00000058 81000000 60006b70 00006d24 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
4 device_area 000000c0 81000058 60006bc8 00006d7c 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
5 sw_isr_table 00000470 81000118 60006c88 00006e3c 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
6 gpio_driver_api_area 00000024 81000588 600070f8 000072ac 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
7 clock_control_driver_api_area 0000001c 810005ac 6000711c 000072d0 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
8 uart_driver_api_area 00000014 810005c8 60007138 000072ec 2**2
CONTENTS, ALLOC, LOAD, READONLY, DATA
9 tbss 00000004 810005dc 6000714c 0000841c 2**2
ALLOC, THREAD_LOCAL
10 rodata 0000111c 80006b70 6000714c 00007300 2**3
CONTENTS, ALLOC, LOAD, READONLY, DATA
11 padding_section 00000374 80007c8c 60008268 0000841c 2**0
ALLOC
12 .ramfunc 00000004 810005dc 60008268 0000841c 2**0
ALLOC
13 datas 00000020 810005e0 6000826c 0000841c 2**2
CONTENTS, ALLOC, LOAD, DATA
14 device_states 0000000c 81000600 6000828c 0000843c 2**0
CONTENTS, ALLOC, LOAD, DATA
15 .comment 00000020 00000000 00000000 0000844c 2**0
CONTENTS, READONLY
16 .debug_aranges 00001028 00000000 00000000 00008470 2**3
CONTENTS, READONLY, DEBUGGING, OCTETS
17 .debug_info 00030c3d 00000000 00000000 00009498 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
18 .debug_abbrev 00008bea 00000000 00000000 0003a0d5 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
19 .debug_line 00019c66 00000000 00000000 00042cbf 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
20 .debug_frame 00002638 00000000 00000000 0005c928 2**2
CONTENTS, READONLY, DEBUGGING, OCTETS
21 .debug_str 0000b0e1 00000000 00000000 0005ef60 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
22 .debug_loc 00012158 00000000 00000000 0006a041 2**0
CONTENTS, READONLY, DEBUGGING, OCTETS
23 .debug_ranges 00002fb8 00000000 00000000 0007c1a0 2**3
CONTENTS, READONLY, DEBUGGING, OCTETS
24 .ARM.attributes 00000032 00000000 00000000 0007f158 2**0
CONTENTS, READONLY
25 .last_section 00000004 80008000 60008298 00008448 2**2
CONTENTS, ALLOC, LOAD, DATA
26 bss 00000247 81000610 600082a0 00008450 2**3
ALLOC
27 noinit 00000e00 81000880 81000880 00008480 2**6
ALLOC
Стало хуже