Mohamed Ayman commented on a discussion on bsps/arm/stm32h7/start/bspstart.c: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1144#note_146136 > /* Get number of milliseconds elapsed since startup */ > uint32_t HAL_GetTick(void) > { > - return rtems_clock_get_ticks_since_boot() * > - rtems_configuration_get_milliseconds_per_tick(); > + return (uint32_t)( > + (uint64_t) rtems_clock_get_ticks_since_boot() * > + rtems_configuration_get_milliseconds_per_tick() > +); I added a command to identify all places where HAL_GetTick() is used in a rollover-safe manner using the standard subtraction idiom. This ensures any 32-bit wraparound of the tick counter is handled correctly. the command: **`grep -rn "HAL_GetTick().*-\|--.*HAL_GetTick" --include="*.c" .`** examples: * stm32h7xx_hal_sd.c:442: if ((HAL_GetTick() - tickstart) \>= SDMMC_DATATIMEOUT) * stm32h7xx_hal_rcc.c:450: if ((uint32_t)(HAL_GetTick() - tickstart) \> HSE_TIMEOUT_VALUE) {width=900 height=558} and sorry for late responding -- View it on GitLab: https://gitlab.rtems.org/rtems/rtos/rtems/-/merge_requests/1144#note_146136 You're receiving this email because of your account on gitlab.rtems.org.
_______________________________________________ bugs mailing list [email protected] http://lists.rtems.org/mailman/listinfo/bugs
