2199593_en-US

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

2199593_en-US

2199593_en-US

After modifying the .ld file, both the sram_data and sram_bss segments have shifted backwards.

First, allocate a p_flash area in memory for storing data during power loss.

sensen_1_0-1762387934845.png

int_flash : ORIGIN = 0x0043E000, LENGTH = 0x2000

And place this area in SECTIONS for declaration.

sensen_1_1-1762388012892.png

Fix a struct at this position

sensen_1_2-1762388887617.png

The left side is where the structure is fixed to the p_flash area, while the right side is not fixed.

sensen_1_3-1762389072953.png

It seems that the data in the sram_bss and sram_data areas have been pushed to the end. Before the data was fixed to 0x0043E000, the initialization data for these global variables was stored starting at 0x00426420. After the data was fixed at 0x0043E000, the storage location for the initialization data of these global variables shifted to start at 0x0043E100.


What I want to know is why the data is shifted to this position. Also, I have already partitioned out this 8K area, but why is there still other data stored in it? During later use, because these data are on the same page, erasing and writing operations were performed, which led to the entry into HardFault_Handler.


Thank you all for your support.

Re: After modifying the .ld file, both the sram_data and sram_bss segments have shifted backwards.

According to your description it behaves exactly how you set it up in the linker.

I don't understand relation to bss/sdata, you haven't taken screenshot of this section completely and what you changed there and why.

Tags (1)
No ratings
Version history
Last update:
‎11-21-2025 04:57 AM
Updated by: