2023-04-03 11:14 PM
Greetings! :)
Usecase:
Nucleo-F756ZG
CubeMx 6.8.0
Set PLL to 216 Mhz,
Enable RCC->Tim prescaler selection.
On "Clock Configuration" set 216 Mhz for APB1 Timer clocks
When use HAL, It works fine. PeriphCommonClock_Config() has been genereated, but if i change on LL, autogenerated code will not set TIMPRE bit configuration in the RCC_DCKCFGR register.
void PeriphCommonClock_Config(void)
{
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
/** Initializes the peripherals clock
*/
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_TIM;
PeriphClkInitStruct.TIMPresSelection = RCC_TIMPRES_ACTIVATED;
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
{
Error_Handler();
}
}
As the datasheet mentioned:
"The timers connected to APB2 are clocked from TIMxCLK up to 216 MHz, while the timers connected to APB1 are clocked
from TIMxCLK either up to 108 MHz or 216 MHz depending on TIMPRE bit configuration in the RCC_DCKCFGR register."
Perhaps missing function is:
__STATIC_INLINE void LL_RCC_SetTIMPrescaler(uint32_t Prescaler)
{
MODIFY_REG(RCC->DCKCFGR1, RCC_DCKCFGR1_TIMPRE, Prescaler);
}
Solved! Go to Solution.
2023-04-04 03:25 AM
Hello @Kamil Duljas
Thank you for your contributions and for your detailed explanations,
I confirm the issue on my side, it has been reported to STM32CubeMX development team .
Internal ticket number: 149033(This is an internal tracking number and is not accessible or usable by customers).
I will keep you posted with updates.
Thx,
Ghofrane
2023-04-04 03:25 AM
Hello @Kamil Duljas
Thank you for your contributions and for your detailed explanations,
I confirm the issue on my side, it has been reported to STM32CubeMX development team .
Internal ticket number: 149033(This is an internal tracking number and is not accessible or usable by customers).
I will keep you posted with updates.
Thx,
Ghofrane