1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

cpu/esp32: add flashpage support to linker scripts

This commit is contained in:
Gunar Schorcht 2022-12-31 13:20:16 +01:00
parent 6f9c64c6cb
commit 80833a74e8
8 changed files with 71 additions and 1 deletions

View File

@ -84,9 +84,16 @@ MEMORY
#ifdef CONFIG_APP_BUILD_USE_FLASH_SECTIONS
/* Flash mapped constant data */
#ifdef MODULE_PERIPH_FLASHPAGE
drom0_0_seg (R) : org = 0x3F400020,
len = 0x400000 - 0x20 - CONFIG_ESP_FLASHPAGE_CAPACITY
drom0_1_seg (R) : org = ORIGIN(drom0_0_seg) + LENGTH(drom0_0_seg),
len = CONFIG_ESP_FLASHPAGE_CAPACITY
#else
drom0_0_seg (R) : org = 0x3F400020, len = 0x400000-0x20
/* (See iram0_2_seg for meaning of 0x20 offset in the above.) */
#endif /* MODULE_PERIPH_FLASHPAGE */
#endif // CONFIG_APP_BUILD_USE_FLASH_SECTIONS
/* RTC fast memory (executable). Persists over deep sleep.

View File

@ -466,7 +466,6 @@ SECTIONS
. = ALIGN(ALIGNOF(.flash.rodata));
} >default_rodata_seg
_rodata_start = ABSOLUTE(.);
.flash.rodata : ALIGN(0x10)
{
_flash_rodata_start = ABSOLUTE(.);
@ -617,6 +616,17 @@ SECTIONS
_heap_start = ABSOLUTE(.);
_sheap = ABSOLUTE(.);
} > dram0_0_seg
#ifdef MODULE_PERIPH_FLASHPAGE
.flash_writable (NOLOAD) : ALIGN(65536)
{
_fp_mem_start = . ;
KEEP(*(SORT(.flash_writable.*)))
_fp_mem_end = . ;
. = ALIGN(4096);
_end_fw = . ;
} > drom0_1_seg
#endif
}
ASSERT(((_iram_end - ORIGIN(iram0_0_seg)) <= LENGTH(iram0_0_seg)),

View File

@ -72,9 +72,16 @@ MEMORY
#if CONFIG_APP_BUILD_USE_FLASH_SECTIONS
/* Flash mapped constant data */
#ifdef MODULE_PERIPH_FLASHPAGE
drom0_0_seg (R) : org = 0x3C000020,
len = 0x800000 - 0x20 - CONFIG_ESP_FLASHPAGE_CAPACITY
drom0_1_seg (R) : org = ORIGIN(drom0_0_seg) + LENGTH(drom0_0_seg),
len = CONFIG_ESP_FLASHPAGE_CAPACITY
#else
drom0_0_seg (R) : org = 0x3C000020, len = 0x800000-0x20
/* (See iram0_2_seg for meaning of 0x20 offset in the above.) */
#endif /* MODULE_PERIPH_FLASHPAGE */
#endif // CONFIG_APP_BUILD_USE_FLASH_SECTIONS
/**

View File

@ -599,6 +599,16 @@ SECTIONS
} > dram0_0_seg
_eheap = phy_param_rom;
#ifdef MODULE_PERIPH_FLASHPAGE
.flash_writable (NOLOAD) : ALIGN(65536)
{
_fp_mem_start = . ;
KEEP(*(SORT(.flash_writable.*)))
_fp_mem_end = . ;
. = ALIGN(4096);
_end_fw = . ;
} > drom0_1_seg
#endif
}
ASSERT(((_iram_end - ORIGIN(iram0_0_seg)) <= LENGTH(iram0_0_seg)),

View File

@ -90,9 +90,16 @@ MEMORY
#ifdef CONFIG_APP_BUILD_USE_FLASH_SECTIONS
/* Flash mapped constant data */
#ifdef MODULE_PERIPH_FLASHPAGE
drom0_0_seg (R) : org = 0x3F000020,
len = 0x3f0000-0x20 - CONFIG_ESP_FLASHPAGE_CAPACITY
drom0_1_seg (R) : org = ORIGIN(drom0_0_seg) + LENGTH(drom0_0_seg),
len = CONFIG_ESP_FLASHPAGE_CAPACITY
#else
drom0_0_seg (R) : org = 0x3F000020, len = 0x3f0000-0x20
/* (See iram0_2_seg for meaning of 0x20 offset in the above.) */
#endif /* MODULE_PERIPH_FLASHPAGE */
#endif // CONFIG_APP_BUILD_USE_FLASH_SECTIONS
/* RTC fast memory (executable). Persists over deep sleep.

View File

@ -592,6 +592,17 @@ SECTIONS
. = _heap_end;
_eheap = ABSOLUTE(.);
#ifdef MODULE_PERIPH_FLASHPAGE
.flash_writable (NOLOAD) : ALIGN(65536)
{
_fp_mem_start = . ;
KEEP(*(SORT(.flash_writable.*)))
_fp_mem_end = . ;
. = ALIGN(4096);
_end_fw = . ;
} > drom0_1_seg
#endif
}
ASSERT(((_iram_text_end - ORIGIN(iram0_0_seg)) <= LENGTH(iram0_0_seg)),

View File

@ -90,9 +90,16 @@ MEMORY
#if CONFIG_APP_BUILD_USE_FLASH_SECTIONS
/* Flash mapped constant data */
#ifdef MODULE_PERIPH_FLASHPAGE
drom0_0_seg (R) : org = 0x3C000020,
len = 0x800000-0x20 - CONFIG_ESP_FLASHPAGE_CAPACITY
drom0_1_seg (R) : org = ORIGIN(drom0_0_seg) + LENGTH(drom0_0_seg),
len = CONFIG_ESP_FLASHPAGE_CAPACITY
#else
drom0_0_seg (R) : org = 0x3C000020, len = 0x800000-0x20
/* (See iram0_2_seg for meaning of 0x20 offset in the above.) */
#endif /* MODULE_PERIPH_FLASHPAGE */
#endif // CONFIG_APP_BUILD_USE_FLASH_SECTIONS
/**

View File

@ -619,6 +619,17 @@ SECTIONS
. = _heap_end;
_eheap = ABSOLUTE(.);
#ifdef MODULE_PERIPH_FLASHPAGE
.flash_writable (NOLOAD) : ALIGN(65536)
{
_fp_mem_start = . ;
KEEP(*(SORT(.flash_writable.*)))
_fp_mem_end = . ;
. = ALIGN(4096);
_end_fw = . ;
} > drom0_1_seg
#endif
}
ASSERT(((_iram_end - ORIGIN(iram0_0_seg)) <= LENGTH(iram0_0_seg)),