[PATCH] Updated tick implementation for HAL_GetTick

Robin Mueller robin.mueller.m at gmail.com
Tue Apr 20 16:31:31 UTC 2021


This now uses rtems_clock_get_uptime_nanoseconds
to calculate the uptime ticks in milliseconds.
---
 bsps/arm/stm32h7/start/bspstart.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/bsps/arm/stm32h7/start/bspstart.c b/bsps/arm/stm32h7/start/bspstart.c
index 2fc8133cca..7ae39f1410 100644
--- a/bsps/arm/stm32h7/start/bspstart.c
+++ b/bsps/arm/stm32h7/start/bspstart.c
@@ -32,9 +32,11 @@
 
 #include <stm32h7xx_hal.h>
 
+/* Get number of milliseconds elapsed since startup */
 uint32_t HAL_GetTick(void)
 {
-  return 0;
+  uint64_t temp = rtems_clock_get_uptime_nanoseconds() / (1000 * 1000);
+  return temp;
 }
 
 uint32_t stm32h7_systick_frequency(void)
-- 
2.25.1



More information about the devel mailing list