esp32c3: update linker script to support binary blobs
To be able to link with the binary blobs that provide wifi and BLE, the linker script needs a few tweaks.
Этот коммит содержится в:
родитель
2fb2113168
коммит
70f1a5429a
1 изменённых файлов: 21 добавлений и 10 удалений
|
@ -58,7 +58,7 @@ SECTIONS
|
||||||
*/
|
*/
|
||||||
.rodata : ALIGN(4)
|
.rodata : ALIGN(4)
|
||||||
{
|
{
|
||||||
*(.rodata .rodata.*)
|
*(.rodata*)
|
||||||
. = ALIGN (4);
|
. = ALIGN (4);
|
||||||
} >DROM
|
} >DROM
|
||||||
|
|
||||||
|
@ -97,6 +97,7 @@ SECTIONS
|
||||||
_sdata = ABSOLUTE(.);
|
_sdata = ABSOLUTE(.);
|
||||||
*(.sdata)
|
*(.sdata)
|
||||||
*(.data .data.*)
|
*(.data .data.*)
|
||||||
|
*(.dram*)
|
||||||
. = ALIGN (4);
|
. = ALIGN (4);
|
||||||
_edata = ABSOLUTE(.);
|
_edata = ABSOLUTE(.);
|
||||||
} >DRAM
|
} >DRAM
|
||||||
|
@ -113,12 +114,22 @@ SECTIONS
|
||||||
. += SIZEOF(.data);
|
. += SIZEOF(.data);
|
||||||
} > IRAM
|
} > IRAM
|
||||||
|
|
||||||
/* Initialization code is loaded into IRAM. This memory area is also used by
|
/* IRAM segment. This contains some functions that always need to be loaded
|
||||||
* the heap, so no RAM is wasted.
|
* in IRAM, and contains initialization code.
|
||||||
|
* The initialization code is later reclaimed for the heap, so no RAM is
|
||||||
|
* wasted.
|
||||||
*/
|
*/
|
||||||
.init : ALIGN(4)
|
.iram : ALIGN(4)
|
||||||
{
|
{
|
||||||
|
*(.iram*)
|
||||||
|
*(.wifislprxiram*)
|
||||||
|
*(.wifiextrairam*)
|
||||||
|
*(.wifi0iram*)
|
||||||
|
*(.wifislpiram*)
|
||||||
|
*(.wifirxiram*)
|
||||||
|
__init_start = .;
|
||||||
*(.init)
|
*(.init)
|
||||||
|
__init_end = .;
|
||||||
} >IRAM
|
} >IRAM
|
||||||
|
|
||||||
/* Dummy section to put the IROM segment exactly behind the IRAM segment.
|
/* Dummy section to put the IROM segment exactly behind the IRAM segment.
|
||||||
|
@ -132,7 +143,7 @@ SECTIONS
|
||||||
. += 0x18; /* esp_image_header_t */
|
. += 0x18; /* esp_image_header_t */
|
||||||
. += SIZEOF(.rodata) + ((SIZEOF(.rodata) != 0) ? 0x8 : 0); /* DROM segment (optional) */
|
. += SIZEOF(.rodata) + ((SIZEOF(.rodata) != 0) ? 0x8 : 0); /* DROM segment (optional) */
|
||||||
. += SIZEOF(.data) + ((SIZEOF(.data) != 0) ? 0x8 : 0); /* DRAM segment (optional) */
|
. += SIZEOF(.data) + ((SIZEOF(.data) != 0) ? 0x8 : 0); /* DRAM segment (optional) */
|
||||||
. += SIZEOF(.init) + 0x8; /* IRAM segment */
|
. += SIZEOF(.iram) + 0x8; /* IRAM segment */
|
||||||
. += 0x8; /* IROM segment header */
|
. += 0x8; /* IROM segment header */
|
||||||
} > IROM
|
} > IROM
|
||||||
|
|
||||||
|
@ -158,17 +169,17 @@ SECTIONS
|
||||||
* The magic value comes from here:
|
* The magic value comes from here:
|
||||||
* https://github.com/espressif/esp-idf/blob/61299f879e/components/bootloader/subproject/main/ld/esp32c3/bootloader.ld#L191
|
* https://github.com/espressif/esp-idf/blob/61299f879e/components/bootloader/subproject/main/ld/esp32c3/bootloader.ld#L191
|
||||||
*/
|
*/
|
||||||
ASSERT((_edata + SIZEOF(.init)) < 0x3FCDE710, "the .init section overlaps with the stack used by the boot ROM, possibly causing corruption at startup")
|
ASSERT((_edata + SIZEOF(.iram)) < 0x3FCDE710, "the .iram section overlaps with the stack used by the boot ROM, possibly causing corruption at startup")
|
||||||
}
|
}
|
||||||
|
|
||||||
/* For the garbage collector.
|
/* For the garbage collector.
|
||||||
* Note that _heap_start starts after _edata (without caring for the .init
|
* Note that _heap_start starts after _edata + most of the IRAM section.
|
||||||
* section), because the .init section isn't necessary anymore after startup and
|
* It starts just before the initialisation code, which isn't necessary anymore
|
||||||
* can thus be overwritten by the heap.
|
* after startup and can thus be overwritten by the heap.
|
||||||
*/
|
*/
|
||||||
_globals_start = _sbss;
|
_globals_start = _sbss;
|
||||||
_globals_end = _edata;
|
_globals_end = _edata;
|
||||||
_heap_start = _edata;
|
_heap_start = _edata + SIZEOF(.iram) - (__init_end - __init_start);
|
||||||
_heap_end = ORIGIN(DRAM) + LENGTH(DRAM);
|
_heap_end = ORIGIN(DRAM) + LENGTH(DRAM);
|
||||||
|
|
||||||
_stack_size = 4K;
|
_stack_size = 4K;
|
||||||
|
|
Загрузка…
Создание таблицы
Сослаться в новой задаче