2020-06-21 10:16 PM
Hello,
I use CubeIDE 1.3.0, STM32F769II.
When i debug variable value.
I found value having strange value.
It always happen when i click "reset chip".
Memory address is 0x20012C0.
when i start debug. It have 0 value.
But when i click "reset chip". 0x20012C0 memory value is changed.
How can i fix it.
Please help me.
Thanks.
2020-06-22 04:57 AM
Some variables get initialized during boot. This address could be within one of them. Why do you think it's a problem or that it should be 0?
2020-06-22 02:34 PM
Place a data breakpoint on that address, or single-step from the reset vector.
JW
2020-06-22 02:41 PM
Review .MAP file, check stack settings.
Walk the Reset_Handler code.
Could also be debugger related.
2020-06-22 04:47 PM
This address is .data sector, not .bss.
It is initialized global address sector.
So it should be set 0.
2020-06-22 05:10 PM
You are right.
I set break point this address.
Reset_Handler change value sometimes.
But i allocate 0x20012C0 address into .data sector (Initialized global variable) not .bss .
finally 0x20012C0 address value should be set to 0.
Because it initialized global variable.
Reset_Handler:
ldr sp, =_estack /* set stack pointer */
/* Copy the data segment initializers from flash to SRAM */
movs r1, #0
b LoopCopyDataInit
CopyDataInit:
ldr r3, =_sidata
ldr r3, [r3, r1]
str r3, [r0, r1]
adds r1, r1, #4
LoopCopyDataInit:
ldr r0, =_sdata
ldr r3, =_edata
adds r2, r0, r1
cmp r2, r3
bcc CopyDataInit
ldr r2, =_sbss
b LoopFillZerobss
/* Zero fill the bss segment. */
FillZerobss:
movs r3, #0
str r3, [r2]
adds r2, r2, #4
LoopFillZerobss:
ldr r3, = _ebss
cmp r2, r3
bcc FillZerobss
Reset_Handler set 0 in CopyDataInit function.
LoopFillzerobss function change 0x20012C0 address value.
How can i do that. :sad_but_relieved_face:
2020-06-22 05:31 PM
Usually you just define variables and let the linker sort out where to put them. That way there is a clear separation between .data and .bss. The default startup script relies on this to be the case.
> But i allocate 0x20012C0 address into .data sector (Initialized global variable) not .bss .
How did you do this? What does your linker file look like?
2020-06-22 05:40 PM
Thank you for your answer.
I define large size variable.
"Para" variable allocated 0x200004b4 ~ 0x20002014.