<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);" class="elementToProof ContentPasted0">
>From e17fb5abf82d03baf25ee16433c9d6e9861e3e3a Mon Sep 17 00:00:00 2001
<div class="ContentPasted0">From: Dariusz Sabala <dariusz.sabala@creotech.pl></div>
<div class="ContentPasted0">Date: Tue, 25 Oct 2022 11:11:20 +0200</div>
<div class="ContentPasted0">Subject: [PATCH] bsps/arm: fix Cortex-M7 systick reload value</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">- see ARM DUI 0646C Arm Cortex-M7 Devices Generic User Guide</div>
<div class="ContentPasted0">  "The RELOAD value is calculated according to its use.</div>
<div class="ContentPasted0">  For example, to generate a multi-shot timer with a period</div>
<div class="ContentPasted0">  of N processor clock cycles, use a RELOAD value of N-1.</div>
<div class="ContentPasted0">  If the SysTick interrupt is required every 100 clock pulses,</div>
<div class="ContentPasted0">  set RELOAD to 99."</div>
<div class="ContentPasted0">- see routines used in CMSIS project for reference</div>
<div class="ContentPasted0">---</div>
<div class="ContentPasted0"> bsps/arm/shared/clock/clock-armv7m.c | 2 +-</div>
<div class="ContentPasted0"> 1 file changed, 1 insertion(+), 1 deletion(-)</div>
<div><br class="ContentPasted0">
</div>
<div class="ContentPasted0">diff --git a/bsps/arm/shared/clock/clock-armv7m.c b/bsps/arm/shared/clock/clock-armv7m.c</div>
<div class="ContentPasted0">index 255de1ca42..c870684980 100644</div>
<div class="ContentPasted0">--- a/bsps/arm/shared/clock/clock-armv7m.c</div>
<div class="ContentPasted0">+++ b/bsps/arm/shared/clock/clock-armv7m.c</div>
<div class="ContentPasted0">@@ -90,7 +90,7 @@ static void _ARMV7M_Clock_initialize_early(void)</div>
<div class="ContentPasted0"> </div>
<div class="ContentPasted0">   interval = (uint32_t) ((freq * us_per_tick) / 1000000);</div>
<div class="ContentPasted0"> </div>
<div class="ContentPasted0">-  systick->rvr = interval;</div>
<div class="ContentPasted0">+  systick->rvr = interval - 1;</div>
<div class="ContentPasted0">   systick->cvr = 0;</div>
<div class="ContentPasted0">   systick->csr = ARMV7M_SYSTICK_CSR_ENABLE | ARMV7M_SYSTICK_CSR_CLKSOURCE;</div>
<div class="ContentPasted0"> }</div>
<div class="ContentPasted0">-- </div>
<div class="ContentPasted0">2.34.1</div>
<br>
</div>
</body>
</html>