Looking at the map file, the SystemCoreClock address is 0x20000008
. What you want to make sure is - the loop below reads data from the correct location in flash while initializing RAM:
.LC0:
cmp r2, r3
ittt lt
ldrlt r0, [r1], #4
strlt r0, [r2], #4
blt .LC0
Check the value of r1 when r2 is 0x20000008 and then examine the value at that location. If those do not match, check the values around that address if you see the correct value.
The use of __etext
as the starting location of data seems a bit odd. Can you make the following changes in your startup code to use __DATA_ROM instead of __etext:
ldr r1, =__DATA_ROM
ldr r2, =__data_start__
ldr r3, =__data_end__
Thanks.