2024-09-26 01:56 AM
Hello, i am using STM32H723 Microcontroller. I need to create a region in the memory(preferably whole sector 7) that is not erasable during debugging process. To do this i made the following changes in the linker script:
MEMORY
{
ITCMRAM (xrw) : ORIGIN = 0x00000000, LENGTH = 64K
DTCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K
FLASH (rx) : ORIGIN = 0x08000000, LENGTH = 896K
USER_DAT (r) : ORIGIN = 0x080E0000, LENGTH = 128K
RAM_D1 (xrw) : ORIGIN = 0x24000000, LENGTH = 320K
RAM_D2 (xrw) : ORIGIN = 0x30000000, LENGTH = 32K
RAM_D3 (xrw) : ORIGIN = 0x38000000, LENGTH = 16K
}
SECTIONS
{
untouched areas
.
.
.user_data(NOLOAD) :
{
. = ALIGN(4);
KEEP(*(.user_data))
} > USER_DAT
And i am trying to write to this memory space with HAL_FLASH Functions. But when i debug, my datas are erased. How can i do this?
Solved! Go to Solution.
2024-09-26 04:36 AM
2024-09-26 02:12 AM
Hello,
I think you can keep that region (User_DAT) undeclared in the linker.
USER_DAT (r) : ORIGIN = 0x080E0000, LENGTH = 128K
2024-09-26 04:05 AM
Hello, Thank you for your answer.
I tried it and it is erased again.
2024-09-26 04:36 AM