Closed stsymbaliuk closed 3 years ago
Hi @stsymbaliuk,
Thank you for your contribution. In order to allow a better analysis of this problem, could you please give us the .ioc file that you are used to reproduce this issue. Thank you again for your contribution.
With regards,
Hi @RKOUSTM Here is my project and .ioc file for STM32F769I-DISCO board. MCU: STM32F69NIH STM32CubeMX Version 6.1.0 STM32CubeF7 Firmware Package V1.16.0 / 14-February-2020
TIM7 selected as Timebase Source HCLK in Clock config set to 1 MHz APB1 Prescaler is 4 APB1 Timer clocks: 0.5 MHz
In main() I have a loop which must toggle LEDs on board every 1000 ms.
I've already added fixes described in my previous message to stm32f7xx_hal_timebase_tim.c
to make it work.
If you generate project from CubeMX again changes in stm32f7xx_hal_timebase_tim.c
will be overwritten end problem appear. HAL_Delay() will be broken and LEDs will be on for a very long time.
Hi @stsymbaliuk,
Thank you for your contribution. After investigation, the point you reported is related to CubeMX tool . According to the following .ioc file, an update on the system clock configuration is proposed to solve your reported problem.
In general terms, we don't treat aspects related to CubeMX tool at GitHub level, they are rather treated at ST Community level. Now, as this issue is not directly related to software component published within this repository (CMSIS, HAL, BSP, etc.) but rather to ecosystem (CubeMX tool), please allow me to close it.
Thank you for your comprehension and thank you again for your contribution.
With regards,
TIM7 selected as Timebase Source HCLK in Clock config set to 1 MHz APB1 Prescaler is 4 APB1 Timer clocks: 0.5 MHz
MCU: STM32F746ZGT6 STM32CubeMX Version 6.1.0 STM32CubeF7 Firmware Package V1.16.0 / 14-February-2020
Observed behavior looks like
uwTick
does not change but in fact due to very high prescaler it counts very slow.File
stm32f7xx_hal_timebase_tim.c
,HAL_InitTick()
functionSo for
uwTimclock
less than 1 millionuwPrescalerValue
must be 0 and not4294967295
.Quick and dirty fix is to replace line
with
And line
can be replaced with
Or if such Timer clocks unsupported by CubeMX some error message can be displayed