[PATCH] Updated tick implementation for HAL_GetTick

Robin Müller robin.mueller.m at gmail.com
Tue Apr 20 17:09:43 UTC 2021


Okay, there is some issue with the rtems function to get the uptime
nanoseconds.. The call appears to crash for some reason.

Kind Regards
Robin

On Tue, 20 Apr 2021 at 18:31, Robin Mueller <robin.mueller.m at gmail.com>
wrote:

> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20210420/c8869ca9/attachment.html>


More information about the devel mailing list