From 2b73c30a9d15b12631e7ddb35f744598e83d4361 Mon Sep 17 00:00:00 2001 From: LuChiChick <1084116302@qq.com> Date: Mon, 14 Sep 2026 15:56:05 +0800 Subject: [PATCH] Split the UNTRUSTED_FLASH into the .untrusted_text and .untrusted_rodata sections for code and read-only data storage. --- STM32G030xx_FLASH.ld | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/STM32G030xx_FLASH.ld b/STM32G030xx_FLASH.ld index cfd41f3..b3ec069 100644 --- a/STM32G030xx_FLASH.ld +++ b/STM32G030xx_FLASH.ld @@ -70,12 +70,18 @@ MEMORY /* Define output sections */ SECTIONS { - /* 指定不可信区域数据段存储 */ - .untrusted_data : + .untrusted_text : /* 不可信区域指令段 */ { . = ALIGN(4); - *(.untrusted_data) - *(.untrusted_data.*) + *(.untrusted_text) + *(.untrusted_text.*) + } > UNTRUSTED_FLASH + + .untrusted_rodata (READONLY): /* 不可信区域只读数据段 */ + { + . = ALIGN(4); + *(.untrusted_rodata) + *(.untrusted_rodata.*) } > UNTRUSTED_FLASH /* The startup code goes first into FLASH */