2023-05-09 11:10:05 +02:00
/*
2023-12-14 00:09:17 +01:00
* Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
2023-05-09 11:10:05 +02:00
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr/devicetree.h>
#include <zephyr/linker/sections.h>
#include <zephyr/linker/linker-defs.h>
#include <zephyr/linker/linker-tool.h>
2023-12-14 00:09:17 +01:00
#include "memory.h"
2023-05-09 11:10:05 +02:00
2023-12-14 00:09:17 +01:00
/* User available SRAM memory segments */
2024-11-19 15:36:10 +00:00
procpu_iram_end = USER_IRAM_END - APPCPU_SRAM_SIZE;
procpu_dram_end = USER_DRAM_END - APPCPU_SRAM_SIZE;
2024-09-04 14:28:07 +02:00
procpu_iram_org = SRAM_USER_IRAM_START;
procpu_iram_len = procpu_iram_end - procpu_iram_org;
procpu_dram_org = SRAM1_DRAM_START;
procpu_dram_len = procpu_dram_end - procpu_dram_org;
2023-12-14 00:09:17 +01:00
2025-02-10 14:54:18 +01:00
/* User available ROM memory segments */
procpu_irom_end = ICACHE0_START + ICACHE0_SIZE - APPCPU_ROM_SIZE;
procpu_drom_end = DCACHE0_START + DCACHE0_SIZE - APPCPU_ROM_SIZE;
procpu_irom_org = ICACHE0_START;
procpu_irom_len = ICACHE0_SIZE - APPCPU_ROM_SIZE;
procpu_drom_org = DCACHE0_START;
procpu_drom_len = DCACHE0_SIZE - APPCPU_ROM_SIZE;
#if defined(CONFIG_ESP_SPIRAM)
2025-02-17 13:21:52 +01:00
procpu_ext_dram_org = procpu_drom_org;
procpu_ext_dram_len = CONFIG_ESP_SPIRAM_SIZE;
procpu_ext_iram_org = procpu_irom_org;
procpu_ext_iram_len = CONFIG_ESP_SPIRAM_SIZE;
2025-02-10 14:54:18 +01:00
#endif
2023-12-14 00:09:17 +01:00
/* Aliases */
2025-02-17 13:21:52 +01:00
#define FLASH_CODE_REGION irom0_0_seg
#define RODATA_REGION drom0_0_seg
#define IRAM_REGION iram0_0_seg
#define RAMABLE_REGION dram0_0_seg
#define EXT_DRAM_REGION ext_dram_seg
#define EXT_IRAM_REGION ext_iram_seg
#define ROMABLE_REGION FLASH
2023-12-14 00:09:17 +01:00
2024-09-04 14:28:07 +02:00
/* Zephyr macro re-definitions */
2024-08-23 15:20:36 -03:00
#undef GROUP_DATA_LINK_IN
#define GROUP_DATA_LINK_IN(vregion, lregion) > vregion AT > lregion
#undef GROUP_NOLOAD_LINK_IN
#define GROUP_NOLOAD_LINK_IN(vregion, lregion) > vregion
2023-12-14 00:09:17 +01:00
/* Flash segments (rodata and text) should be mapped in the virtual address spaces.
2023-09-13 07:24:52 -03:00
* Executing directly from LMA is not possible. */
#undef GROUP_ROM_LINK_IN
#define GROUP_ROM_LINK_IN(vregion, lregion) > RODATA_REGION AT > lregion
2024-06-27 09:44:22 -03:00
/* Make sure new sections have consistent alignment between input and output sections */
2024-08-23 15:20:36 -03:00
#undef SECTION_DATA_PROLOGUE
#define SECTION_DATA_PROLOGUE(name, options, align) name options : ALIGN_WITH_INPUT
2024-06-27 09:44:22 -03:00
#undef SECTION_PROLOGUE
#define SECTION_PROLOGUE SECTION_DATA_PROLOGUE
2023-05-09 11:10:05 +02:00
MEMORY
{
2023-12-14 00:09:17 +01:00
#ifdef CONFIG_BOOTLOADER_MCUBOOT
2025-01-06 20:35:59 +01:00
mcuboot_hdr (R): org = 0x0, len = 0x20
metadata (R): org = 0x20, len = 0x60
FLASH (R): org = 0x80, len = FLASH_SIZE - 0x80
2023-12-14 00:09:17 +01:00
#else
/* Make safety margin in the FLASH memory size so the
2025-02-17 13:21:52 +01:00
* (esp_img_header + (n*esp_seg_headers)) would fit
*/
2025-01-06 20:35:59 +01:00
FLASH (R): org = 0x0, len = FLASH_SIZE - 0x100
2023-12-14 00:09:17 +01:00
#endif /* CONFIG_BOOTLOADER_MCUBOOT */
2023-08-30 17:10:01 -03:00
2024-09-04 14:28:07 +02:00
iram0_0_seg(RX): org = procpu_iram_org, len = procpu_iram_len
dram0_0_seg(RW): org = procpu_dram_org, len = procpu_dram_len
2023-05-09 11:10:05 +02:00
2025-02-10 14:54:18 +01:00
irom0_0_seg(RX): org = procpu_irom_org, len = procpu_irom_len
drom0_0_seg(R): org = procpu_drom_org, len = procpu_drom_len
2024-03-06 23:50:55 -03:00
2024-09-04 14:28:07 +02:00
/* The `ext_ram_seg` and `drom0_0_seg` share the same bus and the address region.
2024-03-06 23:50:55 -03:00
* A dummy section is used to avoid overlap. See `.ext_ram.dummy` in `sections.ld.in`
2023-05-29 09:20:49 -03:00
*/
#if defined(CONFIG_ESP_SPIRAM)
2025-02-17 13:21:52 +01:00
/* `ext_dram_seg` and `drom0_0_seg` share the same bus and the address region.
2024-06-21 14:12:28 +02:00
* A dummy section is used to avoid overlap. See `.ext_ram.dummy` */
2025-02-17 13:21:52 +01:00
ext_dram_seg(RW): org = procpu_ext_dram_org, len = procpu_ext_dram_len
ext_iram_seg(RX): org = procpu_ext_iram_org, len = procpu_ext_iram_len
2023-05-29 09:20:49 -03:00
#endif
2023-08-30 17:10:01 -03:00
2025-02-17 13:21:52 +01:00
/* RTC fast memory (executable). Persists over deep sleep. */
2025-01-07 11:49:09 -03:00
rtc_iram_seg(RWX): org = 0x600fe000, len = 0x2000 - CONFIG_RESERVE_RTC_MEM
/* We reduced the size of rtc_iram_seg by CONFIG_RESERVE_RTC_MEM value.
2025-02-17 13:21:52 +01:00
* It reserves the amount of RTC fast memory that we use for this memory segment.
* This segment is intended for keeping:
* - (lower addr) rtc timer data (s_rtc_timer_retain_mem, see esp_clk.c files).
* - (higher addr) bootloader rtc data (s_bootloader_retain_mem, when a Kconfig option is on).
* The aim of this is to keep data that will not be moved around and have a fixed address.
*/
2025-01-07 11:49:09 -03:00
#if (CONFIG_RESERVE_RTC_MEM > 0)
rtc_reserved_seg(RW): org = 0x600fe000 + 0x2000 - CONFIG_RESERVE_RTC_MEM,
len = CONFIG_RESERVE_RTC_MEM
#endif
2023-05-09 11:10:05 +02:00
2025-02-17 13:21:52 +01:00
/* RTC slow memory (data accessible). Persists over deep sleep. */
2023-05-09 11:10:05 +02:00
rtc_slow_seg(RW): org = 0x50000000, len = 0x2000
#ifdef CONFIG_GEN_ISR_TABLES
IDT_LIST(RW): org = 0x3ebfe010, len = 0x2000
#endif
}
/* Default entry point: */
ENTRY(CONFIG_KERNEL_ENTRY)
2025-01-29 14:25:09 +01:00
/* Heap size calculations differs between the APPCPU and PROCPU */
2024-09-04 14:28:07 +02:00
#ifdef CONFIG_SOC_ENABLE_APPCPU
_heap_sentry = procpu_dram_end;
#else
2024-09-02 14:45:05 +02:00
_heap_sentry = DRAM_RESERVED_START;
2024-09-04 14:28:07 +02:00
#endif
2023-12-14 00:09:17 +01:00
2025-01-29 14:25:09 +01:00
_libc_heap_size = _heap_sentry - _end;
2023-05-09 11:10:05 +02:00
SECTIONS
{
2024-09-04 14:28:07 +02:00
_iram_dram_offset = IRAM_DRAM_OFFSET;
2023-12-14 00:09:17 +01:00
#ifdef CONFIG_BOOTLOADER_MCUBOOT
2023-05-09 11:10:05 +02:00
/* Reserve space for MCUboot header in the binary */
.mcuboot_header :
{
QUAD(0x0)
QUAD(0x0)
QUAD(0x0)
QUAD(0x0)
} > mcuboot_hdr
2024-09-04 14:28:07 +02:00
/* Image load table */
2023-05-09 11:10:05 +02:00
.metadata :
{
2023-12-14 00:09:17 +01:00
/* 0. Magic byte for load header */
2023-05-09 11:10:05 +02:00
LONG(0xace637d3)
2023-12-14 00:09:17 +01:00
/* 1. Application entry point address */
2023-05-09 11:10:05 +02:00
KEEP(*(.entry_addr))
/* IRAM metadata:
2023-12-14 00:09:17 +01:00
* 2. Destination address (VMA) for IRAM region
* 3. Flash offset (LMA) for start of IRAM region
* 4. Size of IRAM region
2023-05-09 11:10:05 +02:00
*/
LONG(ADDR(.iram0.vectors))
LONG(LOADADDR(.iram0.vectors))
LONG(LOADADDR(.iram0.text) + SIZEOF(.iram0.text) - LOADADDR(.iram0.vectors))
/* DRAM metadata:
2023-12-14 00:09:17 +01:00
* 5. Destination address (VMA) for DRAM region
* 6. Flash offset (LMA) for start of DRAM region
* 7. Size of DRAM region
2023-05-09 11:10:05 +02:00
*/
LONG(ADDR(.dram0.data))
LONG(LOADADDR(.dram0.data))
2025-02-10 14:54:18 +01:00
LONG(LOADADDR(.dram0.data_end) + SIZEOF(.dram0.data_end) - LOADADDR(.dram0.data))
2025-01-07 11:49:09 -03:00
2025-01-06 20:35:59 +01:00
/* RTC_IRAM metadata:
* 8. Destination address (VMA) for RTC_IRAM region
* 9. Flash offset (LMA) for start of RTC_IRAM region
* 10. Size of RTC_IRAM region
2025-01-07 11:49:09 -03:00
*/
LONG(ADDR(.rtc.text))
LONG(LOADADDR(.rtc.text))
LONG(SIZEOF(.rtc.text))
2025-01-06 20:35:59 +01:00
/* RTC_DRAM metadata:
* 11. Destination address (VMA) for RTC_DRAM region
* 12. Flash offset (LMA) for start of RTC_DRAM region
* 13. Size of RTC_DRAM region
2025-01-07 11:49:09 -03:00
*/
LONG(ADDR(.rtc.data))
LONG(LOADADDR(.rtc.data))
LONG(SIZEOF(.rtc.data))
2025-01-06 20:35:59 +01:00
/* IROM metadata:
* 14. Destination address (VMA) for IROM region
* 15. Flash offset (LMA) for start of IROM region
* 16. Size of IROM region
*/
LONG(ADDR(.flash.text))
LONG(LOADADDR(.flash.text))
LONG(SIZEOF(.flash.text))
/* DROM metadata:
* 17. Destination address (VMA) for DROM region
* 18. Flash offset (LMA) for start of DROM region
* 19. Size of DROM region
*/
LONG(ADDR(.flash.rodata))
LONG(LOADADDR(.flash.rodata))
LONG(LOADADDR(.flash.rodata_end) - LOADADDR(.flash.rodata))
2023-05-09 11:10:05 +02:00
} > metadata
2023-12-14 00:09:17 +01:00
#endif /* CONFIG_BOOTLOADER_MCUBOOT */
2023-05-09 11:10:05 +02:00
2023-12-14 00:09:17 +01:00
/* Virtual non-loadable sections */
#include <zephyr/linker/rel-sections.ld>
2024-05-06 13:03:26 +02:00
#ifdef CONFIG_LLEXT
#include <zephyr/linker/llext-sections.ld>
#endif
2023-12-14 00:09:17 +01:00
/* --- START OF RTC --- */
2023-05-09 11:10:05 +02:00
2024-03-06 23:50:55 -03:00
/* RTC fast memory holds RTC wake stub code */
.rtc.text :
{
. = ALIGN(4);
_rtc_text_start = ABSOLUTE(.);
2025-01-07 11:49:09 -03:00
_rtc_fast_start = ABSOLUTE(.);
*(.rtc.literal .rtc.literal.*)
*(.rtc.text .rtc.text.*)
*(.rtc.entry.literal)
2024-03-06 23:50:55 -03:00
*(.rtc.entry.text)
2025-01-07 11:49:09 -03:00
. = ALIGN(4);
2024-03-06 23:50:55 -03:00
} GROUP_DATA_LINK_IN(rtc_iram_seg, ROMABLE_REGION)
2023-05-09 11:10:05 +02:00
2024-03-06 23:50:55 -03:00
/* This section located in RTC FAST Memory area.
* It holds data marked with RTC_FAST_ATTR attribute.
* See the file "esp_attr.h" for more information.
2023-05-09 11:10:05 +02:00
*/
2024-03-06 23:50:55 -03:00
.rtc.force_fast :
2023-05-09 11:10:05 +02:00
{
. = ALIGN(4);
2024-03-06 23:50:55 -03:00
_rtc_force_fast_start = ABSOLUTE(.);
*(.rtc.force_fast .rtc.force_fast.*)
2025-01-07 11:49:09 -03:00
. = ALIGN(4);
2024-03-06 23:50:55 -03:00
_rtc_force_fast_end = ABSOLUTE(.);
2025-01-07 11:49:09 -03:00
} GROUP_DATA_LINK_IN(rtc_slow_seg, ROMABLE_REGION)
2023-05-09 11:10:05 +02:00
2024-03-06 23:50:55 -03:00
/* RTC data section holds data marked with
* RTC_DATA_ATTR, RTC_RODATA_ATTR attributes.
*/
.rtc.data :
{
2025-01-07 11:49:09 -03:00
. = ALIGN(4);
2024-03-06 23:50:55 -03:00
_rtc_data_start = ABSOLUTE(.);
2025-01-07 11:49:09 -03:00
*(.rtc.data .rtc.data.*)
*(.rtc.rodata .rtc.rodata.*)
2024-03-06 23:50:55 -03:00
_rtc_data_end = ABSOLUTE(.);
} GROUP_DATA_LINK_IN(rtc_slow_seg, ROMABLE_REGION)
2023-05-09 11:10:05 +02:00
2024-03-06 23:50:55 -03:00
.rtc.bss (NOLOAD) :
{
_rtc_bss_start = ABSOLUTE(.);
2025-01-07 11:49:09 -03:00
*(.rtc.bss .rtc.bss.*)
2024-03-06 23:50:55 -03:00
_rtc_bss_end = ABSOLUTE(.);
} GROUP_LINK_IN(rtc_slow_seg)
2023-05-09 11:10:05 +02:00
2024-03-06 23:50:55 -03:00
/* This section holds data that should not be initialized at power up
* and will be retained during deep sleep.
* User data marked with RTC_NOINIT_ATTR will be placed
* into this section. See the file "esp_attr.h" for more information.
*/
2025-01-07 11:49:09 -03:00
.rtc_noinit (NOLOAD) :
2023-05-29 09:20:49 -03:00
{
. = ALIGN(4);
2024-03-06 23:50:55 -03:00
*(.rtc_noinit .rtc_noinit.*)
. = ALIGN(4) ;
} GROUP_LINK_IN(rtc_slow_seg)
2023-06-01 16:44:12 -03:00
2024-03-06 23:50:55 -03:00
/* This section located in RTC SLOW Memory area.
* It holds data marked with RTC_SLOW_ATTR attribute.
* See the file "esp_attr.h" for more information.
*/
.rtc.force_slow :
2023-06-01 16:44:12 -03:00
{
2024-03-06 23:50:55 -03:00
. = ALIGN(4);
_rtc_force_slow_start = ABSOLUTE(.);
*(.rtc.force_slow .rtc.force_slow.*)
2023-12-14 00:09:17 +01:00
. = ALIGN(4);
2024-03-06 23:50:55 -03:00
_rtc_force_slow_end = ABSOLUTE(.);
} GROUP_DATA_LINK_IN(rtc_slow_seg, ROMABLE_REGION)
2023-08-10 18:28:40 +12:00
2025-01-07 11:49:09 -03:00
/**
* This section holds RTC data that should have fixed addresses.
* The data are not initialized at power-up and are retained during deep sleep.
*/
#if (CONFIG_RESERVE_RTC_MEM > 0)
.rtc_reserved (NOLOAD) :
{
. = ALIGN(4);
_rtc_reserved_start = ABSOLUTE(.);
*(.rtc_timer_data_in_rtc_mem .rtc_timer_data_in_rtc_mem.*)
_rtc_reserved_end = ABSOLUTE(.);
} GROUP_LINK_IN(rtc_reserved_seg)
#endif
2024-03-06 23:50:55 -03:00
/* Get size of rtc slow data based on rtc_data_location alias */
_rtc_slow_length = (_rtc_force_slow_end - _rtc_data_start);
_rtc_fast_length = (_rtc_force_fast_end - _rtc_fast_start);
2023-12-14 00:09:17 +01:00
/* --- END OF RTC --- */
/* --- START OF IRAM --- */
2023-05-09 11:10:05 +02:00
/* Send .iram0 code to iram */
.iram0.vectors : ALIGN(4)
{
/* Vectors go to IRAM */
_init_start = ABSOLUTE(.);
/* Vectors according to builds/RF-2015.2-win32/esp108_v1_2_s5_512int_2/config.html */
. = 0x0;
KEEP(*(.WindowVectors.text));
. = 0x180;
KEEP(*(.Level2InterruptVector.text));
. = 0x1c0;
KEEP(*(.Level3InterruptVector.text));
. = 0x200;
KEEP(*(.Level4InterruptVector.text));
. = 0x240;
KEEP(*(.Level5InterruptVector.text));
. = 0x280;
KEEP(*(.DebugExceptionVector.text));
. = 0x2c0;
KEEP(*(.NMIExceptionVector.text));
. = 0x300;
KEEP(*(.KernelExceptionVector.text));
. = 0x340;
KEEP(*(.UserExceptionVector.text));
. = 0x3C0;
KEEP(*(.DoubleExceptionVector.text));
. = 0x400;
_invalid_pc_placeholder = ABSOLUTE(.);
*(.*Vector.literal)
*(.UserEnter.literal);
*(.UserEnter.text);
. = ALIGN (16);
*(.entry.text)
*(.init.literal)
*(.init)
_init_end = ABSOLUTE(.);
2024-09-04 14:28:07 +02:00
2024-11-19 15:36:10 +00:00
_iram_start = ABSOLUTE(.);
2023-05-09 11:10:05 +02:00
} GROUP_DATA_LINK_IN(IRAM_REGION, ROMABLE_REGION)
.iram0.text : ALIGN(4)
{
/* Code marked as running out of IRAM */
_iram_text_start = ABSOLUTE(.);
*(.iram1 .iram1.*)
*(.iram0.literal .iram.literal .iram.text.literal .iram0.text .iram.text)
*libarch__xtensa__core.a:(.literal .text .literal.* .text.*)
*libkernel.a:(.literal .text .literal.* .text.*)
*libgcc.a:lib2funcs.*(.literal .text .literal.* .text.*)
2024-03-06 23:50:55 -03:00
*libzephyr.a:cbprintf_packaged.*(.literal .text .literal.* .text.*)
2023-05-09 11:10:05 +02:00
*libdrivers__flash.a:flash_esp32.*(.literal .text .literal.* .text.*)
*libzephyr.a:windowspill_asm.*(.literal .text .literal.* .text.*)
*libzephyr.a:log_noos.*(.literal .text .literal.* .text.*)
*libdrivers__timer.a:xtensa_sys_timer.*(.literal .text .literal.* .text.*)
*libzephyr.a:log_core.*(.literal .text .literal.* .text.*)
*libzephyr.a:cbprintf_complete.*(.literal .text .literal.* .text.*)
*libzephyr.a:printk.*(.literal.printk .literal.vprintk .literal.char_out .text.printk .text.vprintk .text.char_out)
*libzephyr.a:log_msg.*(.literal .text .literal.* .text.*)
*libzephyr.a:log_list.*(.literal .text .literal.* .text.*)
*libdrivers__console.a:uart_console.*(.literal.console_out .text.console_out)
*libzephyr.a:log_output.*(.literal .text .literal.* .text.*)
*libzephyr.a:log_backend_uart.*(.literal .text .literal.* .text.*)
2024-03-06 23:50:55 -03:00
*libzephyr.a:log_minimal.*(.literal .literal.* .text .text.*)
2023-05-09 11:10:05 +02:00
*libzephyr.a:loader.*(.literal .text .literal.* .text.*)
2024-09-26 15:04:17 -03:00
*libzephyr.a:flash_init.*(.literal .text .literal.* .text.*)
*libzephyr.a:soc_flash_init.*(.literal .text .literal.* .text.*)
*libzephyr.a:console_init.*(.literal .text .literal.* .text.*)
*libzephyr.a:soc_init.*(.literal .text .literal.* .text.*)
*libzephyr.a:hw_init.*(.literal .text .literal.* .text.*)
*libzephyr.a:soc_random.*(.literal .text .literal.* .text.*)
2024-03-06 23:50:55 -03:00
*libzephyr.a:esp_mmu_map.*(.literal .literal.* .text .text.*)
*libdrivers__interrupt_controller.a:(.literal .literal.* .text .text.*)
2023-05-09 11:10:05 +02:00
*liblib__libc__minimal.a:string.*(.literal .text .literal.* .text.*)
*liblib__libc__newlib.a:string.*(.literal .text .literal.* .text.*)
2024-03-06 23:50:55 -03:00
*liblib__libc__picolibc.a:string.*(.literal .text .literal.* .text.*)
2023-05-09 11:10:05 +02:00
*libphy.a:(.phyiram .phyiram.*)
*libgcov.a:(.literal .text .literal.* .text.*)
2024-09-04 14:28:07 +02:00
/* APPCPU_ENABLED */
*libzephyr.a:esp32s3-mp.*(.literal .text .literal.* .text.*)
*libzephyr.a:bootloader_flash.*(.literal .text .literal.* .text.*)
*libzephyr.a:flash_mmap.*(.literal .text .literal.* .text.*)
2024-03-06 23:50:55 -03:00
/* [mapping:esp_psram] */
*libzephyr.a:mmu_psram_flash.*(.literal .literal.* .text .text.*)
*libzephyr.a:esp_psram_impl_quad.*(.literal .literal.* .text .text.*)
*libzephyr.a:esp_psram_impl_octal.*(.literal .literal.* .text .text.*)
/* [mapping:hal] */
2025-02-23 23:27:51 -03:00
*libzephyr.a:efuse_hal.*(.literal .text .literal.* .text.*)
2024-03-06 23:50:55 -03:00
*libzephyr.a:mmu_hal.*(.literal .text .literal.* .text.*)
*libzephyr.a:spi_flash_hal_iram.*(.literal .text .literal.* .text.*)
*libzephyr.a:spi_flash_encrypt_hal_iram.*(.literal .text .literal.* .text.*)
*libzephyr.a:cache_hal.*(.literal .text .literal.* .text.*)
*libzephyr.a:ledc_hal_iram.*(.literal .text .literal.* .text.*)
*libzephyr.a:i2c_hal_iram.*(.literal .text .literal.* .text.*)
*libzephyr.a:wdt_hal_iram.*(.literal .text .literal.* .text.*)
*libzephyr.a:systimer_hal.*(.literal .text .literal.* .text.*)
*libzephyr.a:spi_flash_hal_gpspi.*(.literal .text .literal.* .text.*)
/* [mapping:soc] */
*libzephyr.a:lldesc.*(.literal .literal.* .text .text.*)
/* [mapping:log] */
*(.literal.esp_log_write .text.esp_log_write)
*(.literal.esp_log_timestamp .text.esp_log_timestamp)
*(.literal.esp_log_early_timestamp .text.esp_log_early_timestamp)
*(.literal.esp_log_impl_lock .text.esp_log_impl_lock)
*(.literal.esp_log_impl_lock_timeout .text.esp_log_impl_lock_timeout)
*(.literal.esp_log_impl_unlock .text.esp_log_impl_unlock)
/* [mapping:spi_flash] */
*libzephyr.a:spi_flash_chip_boya.*(.literal .literal.* .text .text.*)
*libzephyr.a:spi_flash_chip_gd.*(.literal .literal.* .text .text.*)
*libzephyr.a:spi_flash_chip_generic.*(.literal .literal.* .text .text.*)
*libzephyr.a:spi_flash_chip_issi.*(.literal .literal.* .text .text.*)
*libzephyr.a:spi_flash_chip_mxic.*(.literal .literal.* .text .text.*)
*libzephyr.a:spi_flash_chip_mxic_opi.*(.literal .literal.* .text .text.*)
*libzephyr.a:spi_flash_chip_th.*(.literal .literal.* .text .text.*)
*libzephyr.a:spi_flash_chip_winbond.*(.literal .literal.* .text .text.*)
*libzephyr.a:memspi_host_driver.*(.literal .literal.* .text .text.*)
*libzephyr.a:flash_brownout_hook.*(.literal .literal.* .text .text.*)
*libzephyr.a:spi_flash_wrap.*(.literal .literal.* .text .text.*)
*libzephyr.a:spi_flash_hpm_enable.*(.literal .literal.* .text .text.*)
2024-10-24 19:40:07 -03:00
*libzephyr.a:spi_flash_oct_flash_init.*(.literal .literal.* .text .text.*)
*libzephyr.a:flash_ops.*(.literal .literal.* .text .text.*)
2024-03-06 23:50:55 -03:00
/* [mapping:esp_system] */
*libzephyr.a:esp_err.*(.literal .literal.* .text .text.*)
*(.literal.esp_system_abort .text.esp_system_abort)
/* [mapping:esp_hw_support] */
*(.literal.esp_cpu_stall .text.esp_cpu_stall)
*(.literal.esp_cpu_unstall .text.esp_cpu_unstall)
*(.literal.esp_cpu_reset .text.esp_cpu_reset)
*(.literal.esp_cpu_wait_for_intr .text.esp_cpu_wait_for_intr)
*(.literal.esp_cpu_compare_and_set .text.esp_cpu_compare_and_set)
*(.literal.esp_gpio_reserve_pins .text.esp_gpio_reserve_pins)
*(.literal.esp_gpio_is_pin_reserved .text.esp_gpio_is_pin_reserved)
*(.literal.rtc_vddsdio_get_config .text.rtc_vddsdio_get_config)
*(.literal.rtc_vddsdio_set_config .text.rtc_vddsdio_set_config)
*libzephyr.a:esp_memory_utils.*(.literal .literal.* .text .text.*)
*libzephyr.a:rtc_clk.*(.literal .literal.* .text .text.*)
2023-12-14 00:09:17 +01:00
*libzephyr.a:rtc_clk_init.*(.literal .text .literal.* .text.*)
2024-03-06 23:50:55 -03:00
*libzephyr.a:rtc_sleep.*(.literal .literal.* .text .text.*)
*libzephyr.a:rtc_time.*(.literal .literal.* .text .text.*)
*libzephyr.a:systimer.*(.literal .literal.* .text .text.*)
*libzephyr.a:mspi_timing_config.*(.literal .literal.* .text .text.*)
*libzephyr.a:mspi_timing_tuning.*(.literal .literal.* .text .text.*)
2025-03-13 00:00:44 -03:00
*libzephyr.a:regi2c_ctrl.*(.literal .text .literal.* .text.*)
2024-03-06 23:50:55 -03:00
*(.literal.sar_periph_ctrl_power_enable .text.sar_periph_ctrl_power_enable)
/* [mapping:soc_pm] */
*(.literal.GPIO_HOLD_MASK .text.GPIO_HOLD_MASK)
/* [mapping:esp_rom] */
*libzephyr.a:esp_rom_cache_esp32s2_esp32s3.*(.literal .literal.* .text .text.*)
2024-10-24 19:40:07 -03:00
*libzephyr.a:cache_utils.*(.literal .text .literal.* .text.*)
2024-03-06 23:50:55 -03:00
*libzephyr.a:esp_rom_spiflash.*(.literal .literal.* .text .text.*)
*libzephyr.a:esp_rom_systimer.*(.literal .literal.* .text .text.*)
*libzephyr.a:esp_rom_wdt.*(.literal .literal.* .text .text.*)
2024-10-24 19:40:07 -03:00
*libzephyr.a:esp_rom_efuse.*(.literal .literal.* .text .text.*)
2024-03-06 23:50:55 -03:00
/* [mapping:esp_mm] */
*libzephyr.a:esp_cache.*(.literal .literal.* .text .text.*)
2023-05-09 11:10:05 +02:00
#if defined(CONFIG_ESP32_WIFI_IRAM_OPT)
2024-10-24 19:40:07 -03:00
*libnet80211.a:(.wifi0iram .wifi0iram.* .wifislpiram .wifislpiram.* .wifiextrairam .wifiextrairam.*)
*libpp.a:(.wifi0iram .wifi0iram.* .wifislpiram .wifislpiram.* .wifiorslpiram .wifiorslpiram.* .wifiextrairam .wifiextrairam.*)
2025-02-10 14:06:23 -03:00
*libcoexist.a:(.wifi_slp_iram .wifi_slp_iram.* .coexiram .coexiram.* .coexsleepiram .coexsleepiram.*)
2024-03-06 23:50:55 -03:00
/* [mapping:esp_wifi] */
*(.literal.wifi_clock_enable_wrapper .text.wifi_clock_enable_wrapper)
*(.literal.wifi_clock_disable_wrapper .text.wifi_clock_disable_wrapper)
/* [mapping:esp_phy] */
*(.literal.esp_phy_enable .text.esp_phy_enable)
*(.literal.esp_phy_disable .text.esp_phy_disable)
*(.literal.esp_wifi_bt_power_domain_off .text.esp_wifi_bt_power_domain_off)
2023-05-09 11:10:05 +02:00
#endif
#if defined(CONFIG_ESP32_WIFI_RX_IRAM_OPT)
*libnet80211.a:( .wifirxiram .wifirxiram.* .wifislprxiram .wifislprxiram.*)
*libpp.a:( .wifirxiram .wifirxiram.* .wifislprxiram .wifislprxiram.*)
#endif
2023-12-14 00:09:17 +01:00
. = ALIGN(4);
} GROUP_DATA_LINK_IN(IRAM_REGION, ROMABLE_REGION)
#ifdef CONFIG_ESP_SIMPLE_BOOT
.loader.text :
{
. = ALIGN(4);
_loader_text_start = ABSOLUTE(.);
*libzephyr.a:bootloader_clock_init.*(.literal .text .literal.* .text.*)
*libzephyr.a:bootloader_wdt.*(.literal .text .literal.* .text.*)
*libzephyr.a:bootloader_flash.*(.literal .text .literal.* .text.*)
*libzephyr.a:bootloader_flash_config_esp32s3.*(.literal .text .literal.* .text.*)
*libzephyr.a:bootloader_clock_loader.*(.literal .text .literal.* .text.*)
*libzephyr.a:bootloader_efuse.*(.literal .text .literal.* .text.*)
*libzephyr.a:bootloader_utility.*(.literal .text .literal.* .text.*)
*libzephyr.a:bootloader_sha.*(.literal .text .literal.* .text.*)
*libzephyr.a:bootloader_panic.*(.literal .text .literal.* .text.*)
*libzephyr.a:esp_image_format.*(.literal .text .literal.* .text.*)
*libzephyr.a:flash_encrypt.*(.literal .text .literal.* .text.*)
*libzephyr.a:flash_encryption_secure_features.*(.literal .text .literal.* .text.*)
*libzephyr.a:flash_partitions.*(.literal .text .literal.* .text.*)
2024-10-01 15:46:31 -03:00
*libzephyr.a:flash_qio_mode.*(.literal .text .literal.* .text.*)
2023-12-14 00:09:17 +01:00
*libzephyr.a:spi_flash_hal.*(.literal .literal.* .text .text.*)
*libzephyr.a:spi_flash_hal_common.*(.literal .literal.* .text .text.*)
*libzephyr.a:esp_flash_api.*(.literal .text .literal.* .text.*)
*libzephyr.a:esp_flash_spi_init.*(.literal .text .literal.* .text.*)
*libzephyr.a:secure_boot.*(.literal .text .literal.* .text.*)
*libzephyr.a:secure_boot_secure_features.*(.literal .text .literal.* .text.*)
*libzephyr.a:secure_boot_signatures_bootloader.*(.literal .text .literal.* .text.*)
*libzephyr.a:esp_efuse_table.*(.literal .text .literal.* .text.*)
*libzephyr.a:esp_efuse_fields.*(.literal .text .literal.* .text.*)
*libzephyr.a:esp_efuse_api.*(.literal .text .literal.* .text.*)
*libzephyr.a:esp_efuse_utility.*(.literal .text .literal.* .text.*)
*libzephyr.a:esp_efuse_api_key_esp32xx.*(.literal .text .literal.* .text.*)
*libzephyr.a:mpu_hal.*(.literal .text .literal.* .text.*)
*libzephyr.a:cpu_region_protect.*(.literal .text .literal.* .text.*)
*(.fini.literal)
*(.fini)
. = ALIGN(4);
_loader_text_end = ABSOLUTE(.);
} GROUP_DATA_LINK_IN(IRAM_REGION, ROMABLE_REGION)
#endif /* CONFIG_ESP_SIMPLE_BOOT */
2023-05-09 11:10:05 +02:00
2023-12-14 00:09:17 +01:00
/* Marks the end of IRAM code segment */
.iram0.text_end (NOLOAD) :
{
/* ESP32-S3 memprot requires 16B padding for possible CPU prefetch and 256B alignment for PMS split lines */
2023-05-09 11:10:05 +02:00
. = ALIGN(4) + 16;
2023-12-14 00:09:17 +01:00
_iram_text_end = ABSOLUTE(.);
} GROUP_LINK_IN(IRAM_REGION)
2023-05-09 11:10:05 +02:00
2023-12-14 00:09:17 +01:00
.iram0.data :
{
. = ALIGN(4);
_iram_data_start = ABSOLUTE(.);
*(.iram.data)
*(.iram.data*)
_iram_data_end = ABSOLUTE(.);
2023-05-09 11:10:05 +02:00
} GROUP_DATA_LINK_IN(IRAM_REGION, ROMABLE_REGION)
2023-12-14 00:09:17 +01:00
.iram0.bss (NOLOAD) :
{
. = ALIGN(4);
_iram_bss_start = ABSOLUTE(.);
*(.iram.bss)
*(.iram.bss*)
_iram_bss_end = ABSOLUTE(.);
. = ALIGN(4);
_iram_end = ABSOLUTE(.);
} GROUP_LINK_IN(IRAM_REGION)
/* --- END OF IRAM --- */
/* --- START OF DRAM --- */
2023-05-09 11:10:05 +02:00
.dram0.dummy (NOLOAD):
{
2023-12-14 00:09:17 +01:00
/* Spacer section is required to skip .iram0.text area because
* iram0_0_seg and dram0_0_seg reflect the same address space on different buses.
*/
2025-02-10 14:54:18 +01:00
. = ORIGIN(dram0_0_seg) + (MAX(_iram_end, SRAM1_IRAM_START) - SRAM1_IRAM_START);
. = ALIGN(16);
2023-05-09 11:10:05 +02:00
} GROUP_LINK_IN(RAMABLE_REGION)
.dram0.data :
{
. = ALIGN (8);
2023-12-14 00:09:17 +01:00
_data_start = ABSOLUTE(.);
2023-05-09 11:10:05 +02:00
__data_start = ABSOLUTE(.);
2023-12-14 00:09:17 +01:00
2024-03-06 23:50:55 -03:00
/* bluetooth library requires this symbol to be defined */
_btdm_data_start = ABSOLUTE(.);
*libbtdm_app.a:(.data .data.*)
. = ALIGN (4);
_btdm_data_end = ABSOLUTE(.);
2023-05-09 11:10:05 +02:00
*(.data)
*(.data.*)
*(.gnu.linkonce.d.*)
*(.data1)
*(.sdata)
*(.sdata.*)
*(.gnu.linkonce.s.*)
*(.sdata2)
*(.sdata2.*)
*(.gnu.linkonce.s2.*)
2024-03-06 23:50:55 -03:00
*(.srodata)
*(.srodata.*)
2023-05-09 11:10:05 +02:00
/* rodata for panic handler(libarch__xtensa__core.a) and all
* dependent functions should be placed in DRAM to avoid issue
* when flash cache is disabled */
*libarch__xtensa__core.a:(.rodata .rodata.*)
*libkernel.a:fatal.*(.rodata .rodata.*)
*libkernel.a:init.*(.rodata .rodata.*)
2024-03-06 23:50:55 -03:00
*libzephyr.a:cbprintf_complete.*(.rodata .rodata.*)
2023-05-09 11:10:05 +02:00
*libzephyr.a:log_core.*(.rodata .rodata.*)
*libzephyr.a:log_backend_uart.*(.rodata .rodata.*)
*libzephyr.a:log_output.*(.rodata .rodata.*)
2024-03-06 23:50:55 -03:00
*libzephyr.a:log_minimal.*(.rodata .rodata.*)
2023-05-09 11:10:05 +02:00
*libzephyr.a:loader.*(.rodata .rodata.*)
2024-09-26 15:04:17 -03:00
*libzephyr.a:flash_init.*(.rodata .rodata.*)
*libzephyr.a:soc_flash_init.*(.rodata .rodata.*)
*libzephyr.a:console_init.*(.rodata .rodata.*)
*libzephyr.a:soc_init.*(.rodata .rodata.*)
*libzephyr.a:hw_init.*(.rodata .rodata.*)
*libzephyr.a:soc_random.*(.rodata .rodata.*)
2023-05-09 11:10:05 +02:00
*libdrivers__serial.a:uart_esp32.*(.rodata .rodata.*)
2024-03-06 23:50:55 -03:00
*libdrivers__flash.a:flash_esp32.*(.rodata .rodata.*)
*libzephyr.a:esp_mmu_map.*(.rodata .rodata.*)
*libdrivers__interrupt_controller.a:(.rodata .rodata.*)
2024-09-04 14:28:07 +02:00
/* APPCPU_ENABLE */
*libzephyr.a:esp32s3-mp.*(.rodata .rodata.*)
*libzephyr.a:bootloader_flash.*(.rodata .rodata.* .sdata2 .sdata2.* .srodata .srodata.*)
*libzephyr.a:flash_mmap.*(.rodata .rodata.* .sdata2 .sdata2.* .srodata .srodata.*)
2024-03-06 23:50:55 -03:00
/* [mapping:esp_psram] */
*libzephyr.a:mmu_psram_flash.*(.rodata .rodata.*)
*libzephyr.a:esp_psram_impl_octal.*(.rodata .rodata.*)
*libzephyr.a:esp_psram_impl_quad.*(.rodata .rodata.*)
/* [mapping:hal] */
2025-03-03 17:57:48 -03:00
*libzephyr.a:efuse_hal.*(.rodata .rodata.*)
2024-03-06 23:50:55 -03:00
*libzephyr.a:mmu_hal.*(.rodata .rodata.*)
*libzephyr.a:spi_flash_hal_iram.*(.rodata .rodata.*)
*libzephyr.a:spi_flash_encrypt_hal_iram.*(.rodata .rodata.*)
*libzephyr.a:cache_hal.*(.rodata .rodata.*)
*libzephyr.a:ledc_hal_iram.*(.rodata .rodata.*)
*libzephyr.a:i2c_hal_iram.*(.rodata .rodata.*)
*libzephyr.a:wdt_hal_iram.*(.rodata .rodata.*)
*libzephyr.a:systimer_hal.*(.rodata .rodata.*)
*libzephyr.a:spi_flash_hal_gpspi.*(.rodata .rodata.*)
/* [mapping:soc] */
*libzephyr.a:lldesc.*(.rodata .rodata.*)
/* [mapping:log] */
*(.rodata.esp_log_write)
*(.rodata.esp_log_timestamp)
*(.rodata.esp_log_early_timestamp)
*(.rodata.esp_log_impl_lock)
*(.rodata.esp_log_impl_lock_timeout)
*(.rodata.esp_log_impl_unlock)
/* [mapping:spi_flash] */
*libzephyr.a:spi_flash_chip_boya.*(.rodata .rodata.*)
*libzephyr.a:spi_flash_chip_gd.*(.rodata .rodata.*)
*libzephyr.a:spi_flash_chip_generic.*(.rodata .rodata.*)
*libzephyr.a:spi_flash_chip_issi.*(.rodata .rodata.*)
*libzephyr.a:spi_flash_chip_mxic.*(.rodata .rodata.*)
*libzephyr.a:spi_flash_chip_mxic_opi.*(.rodata .rodata.*)
*libzephyr.a:spi_flash_chip_th.*(.rodata .rodata.*)
*libzephyr.a:spi_flash_chip_winbond.*(.rodata .rodata.*)
*libzephyr.a:memspi_host_driver.*(.rodata .rodata.*)
*libzephyr.a:flash_brownout_hook.*(.rodata .rodata.*)
*libzephyr.a:spi_flash_wrap.*(.rodata .rodata.*)
*libzephyr.a:spi_flash_hpm_enable.*(.rodata .rodata.*)
*libzephyr.a:spi_flash_oct_flash_init.*(.rodata .rodata.*)
2024-10-01 15:46:31 -03:00
*libzephyr.a:flash_qio_mode.*(.rodata .rodata.*)
2024-10-24 19:40:07 -03:00
*libzephyr.a:flash_ops.*(.rodata .rodata.*)
2024-03-06 23:50:55 -03:00
/* [mapping:esp_mm] */
*libzephyr.a:esp_cache.*(.rodata .rodata.*)
/* [mapping:esp_hw_support] */
*(.rodata.esp_cpu_stall)
*(.rodata.esp_cpu_unstall)
*(.rodata.esp_cpu_reset)
*(.rodata.esp_cpu_wait_for_intr)
*(.rodata.esp_cpu_compare_and_set)
*(.rodata.esp_gpio_reserve_pins)
*(.rodata.esp_gpio_is_pin_reserved)
*(.rodata.rtc_vddsdio_get_config)
*(.rodata.rtc_vddsdio_set_config)
*libzephyr.a:esp_memory_utils.*(.rodata .rodata.*)
*libzephyr.a:rtc_clk.*(.rodata .rodata.*)
2023-12-14 00:09:17 +01:00
*libzephyr.a:rtc_clk_init.*(.rodata .rodata.*)
2024-03-06 23:50:55 -03:00
*libzephyr.a:systimer.*(.rodata .rodata.*)
*libzephyr.a:mspi_timing_config.*(.rodata .rodata.*)
*libzephyr.a:mspi_timing_tuning.*(.rodata .rodata.*)
*(.rodata.sar_periph_ctrl_power_enable)
/* [mapping:soc_pm] */
*(.rodata.GPIO_HOLD_MASK)
/* [mapping:esp_rom] */
*libzephyr.a:esp_rom_cache_esp32s2_esp32s3.*(.rodata .rodata.*)
2024-10-24 19:40:07 -03:00
*libzephyr.a:cache_utils.*(.rodata .rodata.*)
2024-03-06 23:50:55 -03:00
*libzephyr.a:esp_rom_spiflash.*(.rodata .rodata.*)
*libzephyr.a:esp_rom_systimer.*(.rodata .rodata.*)
*libzephyr.a:esp_rom_wdt.*(.rodata .rodata.*)
2024-10-24 19:40:07 -03:00
*libzephyr.a:esp_rom_efuse.*(.rodata .rodata.*)
2024-03-06 23:50:55 -03:00
/* [mapping:esp_system] */
*libzephyr.a:esp_err.*(.rodata .rodata.*)
*(.rodata.esp_system_abort)
#if defined(CONFIG_ESP32_WIFI_IRAM_OPT)
/* [mapping:esp_wifi] */
*(.rodata.wifi_clock_enable_wrapper)
*(.rodata.wifi_clock_disable_wrapper)
/* [mapping:esp_phy] */
*(.rodata.esp_phy_enable)
*(.rodata.esp_phy_disable)
*(.rodata.esp_wifi_bt_power_domain_off)
#endif
2023-05-09 11:10:05 +02:00
2023-12-14 00:09:17 +01:00
. = ALIGN(4);
#include <snippets-rwdata.ld>
. = ALIGN(4);
2023-05-09 11:10:05 +02:00
KEEP(*(.jcr))
*(.dram1 .dram1.*)
. = ALIGN(4);
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
2023-12-14 00:09:17 +01:00
#ifdef CONFIG_ESP_SIMPLE_BOOT
.loader.data :
{
. = ALIGN(4);
_loader_data_start = ABSOLUTE(.);
*libzephyr.a:bootloader_clock_init.*(.rodata .rodata.* .sdata2 .sdata2.* .srodata .srodata.*)
*libzephyr.a:bootloader_wdt.*(.rodata .rodata.* .sdata2 .sdata2.* .srodata .srodata.*)
*libzephyr.a:bootloader_flash.*(.rodata .rodata.* .sdata2 .sdata2.* .srodata .srodata.*)
*libzephyr.a:bootloader_efuse.*(.rodata .rodata.* .sdata2 .sdata2.* .srodata .srodata.*)
*libzephyr.a:cpu_util.*(.rodata .rodata.* .sdata2 .sdata2.* .srodata .srodata.*)
*libzephyr.a:clk.*(.rodata .rodata.* .sdata2 .sdata2.* .srodata .srodata.*)
*libzephyr.a:esp_clk.*(.rodata .rodata.* .sdata2 .sdata2.* .srodata .srodata.*)
*libzephyr.a:cpu_region_protect.*(.rodata .rodata.* .sdata2 .sdata2.* .srodata .srodata.*)
*libzephyr.a:spi_flash_hal.*(.rodata .rodata.* .sdata2 .sdata2.* .srodata .srodata.*)
*libzephyr.a:spi_flash_hal_common.*(.rodata .rodata.* .sdata2 .sdata2.* .srodata .srodata.*)
*libzephyr.a:esp_flash_api.*(.rodata .rodata.* .sdata2 .sdata2.* .srodata .srodata.*)
*libzephyr.a:esp_flash_spi_init.*(.rodata .rodata.* .sdata2 .sdata2.* .srodata .srodata.*)
. = ALIGN(4);
_loader_data_end = ABSOLUTE(.);
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
#endif /* CONFIG_ESP_SIMPLE_BOOT */
2023-05-09 11:10:05 +02:00
#include <snippets-data-sections.ld>
#include <zephyr/linker/common-ram.ld>
#include <snippets-ram-sections.ld>
#include <zephyr/linker/cplusplus-ram.ld>
2024-03-06 23:50:55 -03:00
#include <zephyr/linker/kobject-data.ld>
2023-05-09 11:10:05 +02:00
/* logging sections should be placed in RAM area to avoid flash cache disabled issues */
#pragma push_macro("GROUP_ROM_LINK_IN")
#undef GROUP_ROM_LINK_IN
#define GROUP_ROM_LINK_IN GROUP_DATA_LINK_IN
#include <zephyr/linker/common-rom/common-rom-logging.ld>
#pragma pop_macro("GROUP_ROM_LINK_IN")
2025-02-10 14:54:18 +01:00
.dram0.data_end :
2023-05-09 11:10:05 +02:00
{
__data_end = ABSOLUTE(.);
2023-12-14 00:09:17 +01:00
_data_end = ABSOLUTE(.);
2023-05-09 11:10:05 +02:00
} GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
2024-06-21 14:12:28 +02:00
.dram0.noinit (NOLOAD):
{
. = ALIGN(4);
__dram_noinit_start = ABSOLUTE(.);
#ifdef CONFIG_ESP32_WIFI_NET_ALLOC_SPIRAM
*(EXCLUDE_FILE(
*libdrivers__wifi.a:*
*libsubsys__net__l2__ethernet.a:*
*libsubsys__net__lib__config.a:*
*libsubsys__net__ip.a:*
*libsubsys__net.a:* ) .noinit)
*(EXCLUDE_FILE(
*libdrivers__wifi.a:*
*libsubsys__net__l2__ethernet.a:*
*libsubsys__net__lib__config.a:*
*libsubsys__net__ip.a:*
*libsubsys__net.a:* ) .noinit.*)
#else
*(.noinit)
*(.noinit.*)
#endif /* CONFIG_ESP32_WIFI_NET_ALLOC_SPIRAM */
__dram_noinit_end = ABSOLUTE(.);
. = ALIGN(4) ;
} GROUP_LINK_IN(RAMABLE_REGION)
2023-12-14 00:09:17 +01:00
/* Shared RAM */
2024-03-06 23:50:55 -03:00
.dram0.bss (NOLOAD) :
{
. = ALIGN (8);
_bss_start = ABSOLUTE(.); /* required by bluetooth library */
__bss_start = ABSOLUTE(.);
/* bluetooth library requires this symbol to be defined */
_btdm_bss_start = ABSOLUTE(.);
*libbtdm_app.a:(.bss .bss.* COMMON)
. = ALIGN (4);
_btdm_bss_end = ABSOLUTE(.);
*(.dynsbss)
*(.sbss)
*(.sbss.*)
*(.gnu.linkonce.sb.*)
*(.scommon)
*(.sbss2)
*(.sbss2.*)
*(.gnu.linkonce.sb2.*)
*(.dynbss)
*(.bss)
*(.bss.*)
*(.share.mem)
*(.gnu.linkonce.b.*)
*(COMMON)
. = ALIGN (8);
2023-12-14 00:09:17 +01:00
_bss_end = ABSOLUTE(.);
2024-03-06 23:50:55 -03:00
__bss_end = ABSOLUTE(.);
} GROUP_LINK_IN(RAMABLE_REGION)
2023-12-14 00:09:17 +01:00
/* Provide total SRAM usage, including IRAM and DRAM */
2024-11-19 15:36:10 +00:00
_image_ram_start = _init_start - IRAM_DRAM_OFFSET;
2023-12-14 00:09:17 +01:00
#include <zephyr/linker/ram-end.ld>
2024-03-06 23:50:55 -03:00
2024-09-02 14:45:05 +02:00
ASSERT(((_end - ORIGIN(dram0_0_seg)) <= LENGTH(dram0_0_seg)), "DRAM segment data does not fit.")
2024-03-06 23:50:55 -03:00
2023-12-14 00:09:17 +01:00
/* --- END OF DRAM --- */
/* --- START OF IROM --- */
/* Symbols used during the application memory mapping */
2023-05-09 11:10:05 +02:00
_image_irom_start = LOADADDR(.flash.text);
_image_irom_size = LOADADDR(.flash.text) + SIZEOF(.flash.text) - _image_irom_start;
_image_irom_vaddr = ADDR(.flash.text);
2023-12-14 00:09:17 +01:00
/* Align next section to 64k to allow mapping */
.flash.text_dummy (NOLOAD) :
{
. = ALIGN(CACHE_ALIGN);
} GROUP_LINK_IN(ROMABLE_REGION)
.flash.text : ALIGN(0x10)
2023-05-09 11:10:05 +02:00
{
_stext = .;
2024-03-06 23:50:55 -03:00
_instruction_reserved_start = ABSOLUTE(.);
2023-05-09 11:10:05 +02:00
_text_start = ABSOLUTE(.);
2024-04-11 14:18:50 +02:00
__text_region_start = ABSOLUTE(.);
2024-06-21 17:49:54 +02:00
__rom_region_start = ABSOLUTE(.);
2023-05-09 11:10:05 +02:00
#if !defined(CONFIG_ESP32_WIFI_IRAM_OPT)
2024-10-24 19:40:07 -03:00
*libnet80211.a:( .wifi0iram .wifi0iram.* .wifislpiram .wifislpiram.* .wifiextrairam .wifiextrairam.*)
*libpp.a:( .wifi0iram .wifi0iram.* .wifislpiram .wifislpiram.* .wifiorslpiram .wifiorslpiram.* .wifiextrairam .wifiextrairam.*)
2025-02-10 14:06:23 -03:00
*libcoexist.a:(.wifi_slp_iram .wifi_slp_iram.* .coexiram .coexiram.* .coexsleepiram .coexsleepiram.*)
2023-05-09 11:10:05 +02:00
#endif
#if !defined(CONFIG_ESP32_WIFI_RX_IRAM_OPT)
*libnet80211.a:( .wifirxiram .wifirxiram.* .wifislprxiram .wifislprxiram.*)
*libpp.a:( .wifirxiram .wifirxiram.* .wifislprxiram .wifislprxiram.*)
#endif
*(.stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
*(.irom0.text) /* catch stray ICACHE_RODATA_ATTR */
*(.fini.literal)
*(.fini)
*(.gnu.version)
*(.literal .text .literal.* .text.*)
/* CPU will try to prefetch up to 16 bytes of
* of instructions. This means that any configuration (e.g. MMU, PMS) must allow
* safe access to up to 16 bytes after the last real instruction, add
* dummy bytes to ensure this
*/
. += 16;
_text_end = ABSOLUTE(.);
2024-03-06 23:50:55 -03:00
_instruction_reserved_end = ABSOLUTE(.); /* This is a symbol marking the flash.text end, this can be used for mmu driver to maintain virtual address */
2024-04-11 14:18:50 +02:00
__text_region_end = ABSOLUTE(.);
2024-06-21 17:49:54 +02:00
__rom_region_end = ABSOLUTE(.);
2023-05-09 11:10:05 +02:00
_etext = .;
} GROUP_DATA_LINK_IN(FLASH_CODE_REGION, ROMABLE_REGION)
2024-09-04 14:28:07 +02:00
/* --- END OF IROM --- */
/* --- START OF DROM --- */
2023-12-14 00:09:17 +01:00
/* This dummy section represents the .flash.text section but in default_rodata_seg.
2024-03-06 23:50:55 -03:00
* Thus, it must have its alignment and (at least) its size.
2023-05-09 11:10:05 +02:00
*/
2023-12-14 00:09:17 +01:00
.flash.rodata_dummy (NOLOAD):
2024-03-06 23:50:55 -03:00
{
_flash_rodata_dummy_start = ABSOLUTE(.);
2023-12-14 00:09:17 +01:00
. += SIZEOF(.flash.text);
. = ALIGN(CACHE_ALIGN);
2024-03-06 23:50:55 -03:00
} GROUP_LINK_IN(RODATA_REGION)
_image_drom_start = LOADADDR(.flash.rodata);
_image_drom_size = LOADADDR(.flash.rodata_end) + SIZEOF(.flash.rodata_end) - _image_drom_start;
_image_drom_vaddr = ADDR(.flash.rodata);
2023-12-14 00:09:17 +01:00
.flash.rodata : ALIGN(CACHE_ALIGN)
2024-03-06 23:50:55 -03:00
{
2024-06-21 14:12:28 +02:00
_image_rodata_start = ABSOLUTE(.);
2024-03-06 23:50:55 -03:00
_rodata_reserved_start = ABSOLUTE(.); /* This is a symbol marking the flash.rodata start, this can be used for mmu driver to maintain virtual address */
_rodata_start = ABSOLUTE(.);
__rodata_region_start = ABSOLUTE(.);
2023-12-14 00:09:17 +01:00
2023-05-09 11:10:05 +02:00
. = ALIGN(4);
2024-03-06 23:50:55 -03:00
#include <snippets-rodata.ld>
2023-05-09 11:10:05 +02:00
2024-03-06 23:50:55 -03:00
*(.irom1.text) /* catch stray ICACHE_RODATA_ATTR */
*(.gnu.linkonce.r.*)
*(.rodata)
*(.rodata.*)
*(.rodata1)
__XT_EXCEPTION_TABLE_ = ABSOLUTE(.);
*(.xt_except_table)
*(.gcc_except_table .gcc_except_table.*)
*(.gnu.linkonce.e.*)
*(.gnu.version_r)
. = (. + 3) & ~ 3;
__eh_frame = ABSOLUTE(.);
KEEP(*(.eh_frame))
. = (. + 7) & ~ 3;
2023-05-09 11:10:05 +02:00
2024-03-06 23:50:55 -03:00
/* C++ exception handlers table: */
__XT_EXCEPTION_DESCS_ = ABSOLUTE(.);
*(.xt_except_desc)
*(.gnu.linkonce.h.*)
__XT_EXCEPTION_DESCS_END__ = ABSOLUTE(.);
*(.xt_except_desc_end)
*(.dynamic)
*(.gnu.version_d)
2023-05-09 11:10:05 +02:00
. = ALIGN(4);
2024-03-06 23:50:55 -03:00
__rodata_region_end = ABSOLUTE(.);
/* Literals are also RO data. */
_lit4_start = ABSOLUTE(.);
*(*.lit4)
*(.lit4.*)
*(.gnu.linkonce.lit4.*)
_lit4_end = ABSOLUTE(.);
. = ALIGN(4);
*(.rodata_wlog)
*(.rodata_wlog*)
. = ALIGN(4);
} GROUP_DATA_LINK_IN(RODATA_REGION, ROMABLE_REGION)
2023-05-09 11:10:05 +02:00
2023-12-14 00:09:17 +01:00
#include <zephyr/linker/cplusplus-rom.ld>
2024-06-21 13:18:55 +02:00
#include <zephyr/linker/common-rom/common-rom-init.ld>
2024-03-06 23:50:55 -03:00
#include <zephyr/linker/common-rom/common-rom-kernel-devices.ld>
#include <zephyr/linker/common-rom/common-rom-ztest.ld>
#include <zephyr/linker/common-rom/common-rom-net.ld>
#include <zephyr/linker/common-rom/common-rom-bt.ld>
#include <zephyr/linker/common-rom/common-rom-debug.ld>
#include <zephyr/linker/common-rom/common-rom-misc.ld>
#include <zephyr/linker/thread-local-storage.ld>
#include <snippets-sections.ld>
2023-05-09 11:10:05 +02:00
2024-03-06 23:50:55 -03:00
/* Create an explicit section at the end of all the data that shall be mapped into drom.
* This is used to calculate the size of the _image_drom_size variable */
.flash.rodata_end : ALIGN(0x10)
{
. = ALIGN(4);
_rodata_reserved_end = ABSOLUTE(.);
_image_rodata_end = ABSOLUTE(.);
} GROUP_DATA_LINK_IN(RODATA_REGION, ROMABLE_REGION)
2024-09-04 14:28:07 +02:00
/* --- END OF DROM --- */
/* --- START OF SPIRAM --- */
2024-03-06 23:50:55 -03:00
#if defined(CONFIG_ESP_SPIRAM)
2025-02-17 13:21:52 +01:00
/* This section is required to skip flash rodata sections, because SPIRAM
2024-06-21 14:12:28 +02:00
* and `drom0_0_seg` are on the same bus */
2024-03-06 23:50:55 -03:00
.ext_ram.dummy (NOLOAD):
2023-05-09 11:10:05 +02:00
{
2024-06-21 14:12:28 +02:00
. = ADDR(.flash.rodata_end) - ORIGIN(ext_dram_seg);
2023-12-14 00:09:17 +01:00
. = ALIGN (CACHE_ALIGN);
2025-02-17 13:21:52 +01:00
} GROUP_LINK_IN(EXT_DRAM_REGION)
2023-05-09 11:10:05 +02:00
2024-03-06 23:50:55 -03:00
/* This section holds .ext_ram.bss data, and will be put in PSRAM */
2025-02-17 13:21:52 +01:00
.ext_ram.data (NOLOAD) :
2023-05-09 11:10:05 +02:00
{
2024-06-21 14:12:28 +02:00
_ext_ram_start = ABSOLUTE(.);
_ext_ram_noinit_start = ABSOLUTE(.);
#ifdef CONFIG_ESP32_WIFI_NET_ALLOC_SPIRAM
*libdrivers__wifi.a:(.noinit .noinit.*)
*libsubsys__net__l2__ethernet.a:(.noinit .noinit.*)
*libsubsys__net__lib__config.a:(.noinit .noinit.*)
*libsubsys__net__ip.a:(.noinit .noinit.*)
*libsubsys__net.a:(.noinit .noinit.*)
2025-02-17 13:21:52 +01:00
#endif
. = ALIGN(16);
*(.ext_ram_noinit.*)
2024-06-21 14:12:28 +02:00
. = ALIGN(16);
_ext_ram_noinit_end = ABSOLUTE(.);
2024-03-06 23:50:55 -03:00
_ext_ram_bss_start = ABSOLUTE(.);
*(.ext_ram.bss*)
2024-06-21 14:12:28 +02:00
. = ALIGN(16);
2025-06-05 15:42:03 +02:00
/* Custom modules sections list */
KEEP(*(.lvgl_buf*))
. = ALIGN(16);
KEEP(*(.lvgl_heap*))
. = ALIGN(16);
KEEP(*(.mbedtls_heap*))
. = ALIGN(16);
2024-06-21 14:12:28 +02:00
_ext_ram_bss_end = ABSOLUTE(.);
2023-05-09 11:10:05 +02:00
2025-06-05 15:42:03 +02:00
/* Used by Shared Multi Heap */
2025-02-17 13:21:52 +01:00
_ext_ram_heap_start = ABSOLUTE(.);
. += CONFIG_ESP_SPIRAM_HEAP_SIZE;
2025-01-07 14:04:24 +01:00
. = ALIGN(16);
2025-02-17 13:21:52 +01:00
_ext_ram_heap_end = ABSOLUTE(.);
2023-05-09 11:10:05 +02:00
2024-06-21 14:12:28 +02:00
_ext_ram_end = ABSOLUTE(.);
2025-02-17 13:21:52 +01:00
} GROUP_LINK_IN(EXT_DRAM_REGION)
2024-03-06 23:50:55 -03:00
#endif /* CONFIG_ESP_SPIRAM */
2023-05-09 11:10:05 +02:00
2024-09-04 14:28:07 +02:00
/* --- END OF SPIRAM --- */
2023-05-09 11:10:05 +02:00
2024-09-04 14:28:07 +02:00
/* --- XTENSA GLUE AND DEBUG BEGIN --- */
2023-05-09 11:10:05 +02:00
#ifdef CONFIG_GEN_ISR_TABLES
#include <zephyr/linker/intlist.ld>
#endif
#include <zephyr/linker/debug-sections.ld>
.xtensa.info 0 : { *(.xtensa.info) }
.xt.insn 0 :
{
KEEP (*(.xt.insn))
KEEP (*(.gnu.linkonce.x.*))
}
.xt.prop 0 :
{
KEEP (*(.xt.prop))
KEEP (*(.xt.prop.*))
KEEP (*(.gnu.linkonce.prop.*))
}
.xt.lit 0 :
{
KEEP (*(.xt.lit))
KEEP (*(.xt.lit.*))
KEEP (*(.gnu.linkonce.p.*))
}
.xt.profile_range 0 :
{
KEEP (*(.xt.profile_range))
KEEP (*(.gnu.linkonce.profile_range.*))
}
.xt.profile_ranges 0 :
{
KEEP (*(.xt.profile_ranges))
KEEP (*(.gnu.linkonce.xt.profile_ranges.*))
}
.xt.profile_files 0 :
{
KEEP (*(.xt.profile_files))
KEEP (*(.gnu.linkonce.xt.profile_files.*))
}
}
2024-09-02 14:45:05 +02:00
/* --- XTENSA GLUE AND DEBUG END --- */
2024-03-06 23:50:55 -03:00
2024-06-21 14:12:28 +02:00
ASSERT(((_iram_end - ORIGIN(iram0_0_seg)) <= LENGTH(iram0_0_seg)),
"IRAM0 segment data does not fit.")
ASSERT(((_end - ORIGIN(dram0_0_seg)) <= LENGTH(dram0_0_seg)),
"DRAM segment data does not fit.")
2023-05-29 09:20:49 -03:00
#if defined(CONFIG_ESP_SPIRAM)
2024-06-21 14:12:28 +02:00
ASSERT(((_ext_ram_end - _ext_ram_start) <= CONFIG_ESP_SPIRAM_SIZE),
2023-08-10 18:28:40 +12:00
"External SPIRAM overflowed.")
2024-03-06 23:50:55 -03:00
#endif