From d919880a08b8130f2ccad9434ceba23430ca5e37 Mon Sep 17 00:00:00 2001 From: LuChiChick <1084116302@qq.com> Date: Tue, 4 Aug 2026 19:52:26 +0800 Subject: [PATCH] Modified the linker script to support the masked 32K extra untrusted FLASH space. Ideally, a total of 64K FLASH space is available to use. --- STM32G030xx_FLASH.ld | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/STM32G030xx_FLASH.ld b/STM32G030xx_FLASH.ld index 78181f6..cfd41f3 100644 --- a/STM32G030xx_FLASH.ld +++ b/STM32G030xx_FLASH.ld @@ -62,13 +62,22 @@ _Min_Stack_Size = 0x400; /* required amount of stack */ /* Specify the memory areas */ MEMORY { -RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 8K -FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 32K + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 8K + FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 32K + UNTRUSTED_FLASH (rx) : ORIGIN = 0x08008000, LENGTH = 32K /* 被屏蔽的不可信Flash区域 */ } /* Define output sections */ SECTIONS { + /* 指定不可信区域数据段存储 */ + .untrusted_data : + { + . = ALIGN(4); + *(.untrusted_data) + *(.untrusted_data.*) + } > UNTRUSTED_FLASH + /* The startup code goes first into FLASH */ .isr_vector : {