2x timer period by using system timer

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.

@jefftenney @aggarg I have tested your tips, the value of SystemCoreClock is still modified incorrectly. But the problem was finally solved.

For our board, except SystemCoreClockUpdate() we should also call another function CLOCK_Init() from SDK to initialize the SystemCoreClock before we start the task scheduler. And those two functions will set the SystemCoreClock that was incorrectly assigned in startup to right value. I will continue to look into how the startup actually works. Sorry for my carelessness and thanks again for your time.

1 Like

Thank for taking time to report your solution.