From cad25827332c022744a07964c1237cca858fbf03 Mon Sep 17 00:00:00 2001 From: KLASSENTS Date: Fri, 30 May 2025 15:54:48 +0700 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BB=D1=8F=20=D1=83=D1=81=D1=82=D0=B0?= =?UTF-8?q?=D0=BD=D0=BE=D0=B2=D0=BA=D0=B8=20=D0=BF=D1=80=D0=B5=D0=B4=D0=B5?= =?UTF-8?q?=D0=BB=D0=B0=20=D0=B0=D0=B4=D1=80=D0=B5=D1=81=D0=B0=20=D0=B4?= =?UTF-8?q?=D0=BB=D1=8F=20=D0=BA=D0=B5=D1=88=D0=B8=D1=80=D0=BE=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F=20=D0=B8=D1=81=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7?= =?UTF-8?q?=D1=83=D1=8E=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BC=D0=B5=D0=BD=D0=BD?= =?UTF-8?q?=D1=83=D1=8E,=20=D0=BA=D0=BE=D1=82=D0=BE=D1=80=D0=B0=D1=8F=20?= =?UTF-8?q?=D0=BD=D0=B5=20=D1=83=D1=87=D0=B8=D1=82=D1=8B=D0=B2=D0=B0=D0=B5?= =?UTF-8?q?=D1=82=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D0=B5=20rodata?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cores/arduino/board.cpp | 5 ++--- cores/arduino/mik32/shared/ldscripts/spifi_cpp.ld | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/cores/arduino/board.cpp b/cores/arduino/board.cpp index ed7cb89..37d08f0 100644 --- a/cores/arduino/board.cpp +++ b/cores/arduino/board.cpp @@ -21,13 +21,12 @@ #define FLASH_END_OFFSET 0x1000 // values from ld script -extern uint8_t __TEXT_START__[]; -extern uint8_t __TEXT_END__[]; +extern uint8_t __RODATA__[]; // RAM-function for updating flash cache limit by app size to improve performance __attribute__((section(".ram_text"))) void updateCacheLimit(void) { - uint32_t new_limit = (uintptr_t)__TEXT_END__ - (uintptr_t)__TEXT_START__ + 128; // 128 byte for margin + uint32_t new_limit = (uintptr_t)__RODATA__ - SPIFI_BASE_ADDRESS; // limit cache size by flash size with margin if (new_limit > (FLASH_SIZE - FLASH_END_OFFSET)) new_limit = FLASH_SIZE - FLASH_END_OFFSET; diff --git a/cores/arduino/mik32/shared/ldscripts/spifi_cpp.ld b/cores/arduino/mik32/shared/ldscripts/spifi_cpp.ld index 0e80a68..d88e2ad 100644 --- a/cores/arduino/mik32/shared/ldscripts/spifi_cpp.ld +++ b/cores/arduino/mik32/shared/ldscripts/spifi_cpp.ld @@ -21,11 +21,10 @@ SECTIONS { *crt0.S.o(.text .text.*) *(.text.smallsysteminit) *(.text.SmallSystemInit) - /*. = ORIGIN(rom) + 0xC0;*/ - /*KEEP(*crt0.S.o(.trap_text))*/ *(.text) *(.text.*) + PROVIDE(__RODATA__ = .); *(.rodata) *(.rodata.*) . = ALIGN(CL_SIZE);