cancel
Showing results for 
Search instead for 
Did you mean: 

RCC Tim Prescaler selection for APB1 not working in LL

Kamil Duljas
Senior III

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);
}

Dudo
1 ACCEPTED SOLUTION

Accepted Solutions
Ghofrane GSOURI
ST Employee

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

View solution in original post

1 REPLY 1
Ghofrane GSOURI
ST Employee

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