As far as I knew, SYSTICK Timer is a 24-bit down counter. For now, I need to know the precise consumption time for the memcpy function. Suppose I set SysTick->RELOAD = 511, it will turn out two cases as the following description.

Define:

1. One cycle means 511 to 0 must be finish.

2. Two or more cycles mean 511 to 0, 511 to 0, ... , 511 to 0, 511 to i, i in [0, 511].

Case 1: Offset is small or normal, so the memcpy will finish in one cycles.

Case 2: Offset is very big, e.g. 16K. So the memcpy will finish in two or more cycles.

How do I get the "cycles" ?

Define:

1. One cycle means 511 to 0 must be finish.

2. Two or more cycles mean 511 to 0, 511 to 0, ... , 511 to 0, 511 to i, i in [0, 511].

Case 1: Offset is small or normal, so the memcpy will finish in one cycles.

Case 2: Offset is very big, e.g. 16K. So the memcpy will finish in two or more cycles.

How do I get the "cycles" ?

"Suppose I set SysTick->RELOAD = 511"As

clive1says, why do that?Why choose such a small value - why deliberately make the wrap-around such a big issue?

http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka8713.html

If you envisage that the operation will still take longer than one "cycle", then enable the SysTick

interrupt, and have the handler count the "cycles"...http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka8713.html

http://www.keil.com/pack/doc/cmsis/Core/html/group___sys_tick__gr.html

The 24-bit maximal would be 16777215 wouldn't it. 2^24-1