cancel
Showing results for 
Search instead for 
Did you mean: 

HALL bug not setting clock ?

Linas L
Senior II

Hello. I was working on example generated by cubeMX (new version) on STM32L562VET6Q processor and canbus.

Example code of networking worked just fine, but copying code to my LL based project made CANBUS inoperable.

I was able to track down what is different, and find one line of code that its not generated or set in LL RCC library.

in original example it was that was working

    PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_FDCAN;
    PeriphClkInit.FdcanClockSelection = RCC_FDCANCLKSOURCE_PLL;
    if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK)
    {
      Error_Handler();
    }

While my code only had one line:

LL_RCC_SetFDCANClockSource(LL_RCC_FDCAN_CLKSOURCE_PLL);

But it never worked. Tracking what is different i was able to that in HALL version of code, it also does this:

SET_BIT(RCC->PLLCFGR, (RCC_PLL_48M1CLK));

So what do I am missing ? What is LL eqvivalent of this call ?

With this added to my LL project, can-bus started working as it should.

Thanks !

1 REPLY 1
TDK
Guru

> So what do I am missing ? What is LL equivalent of this call ?

/**
  * @brief  Enable PLL output mapped on 48MHz domain clock
  * @rmtoll PLLCFGR      PLLQEN        LL_RCC_PLL_EnableDomain_48M
  * @retval None
  */
__STATIC_INLINE void LL_RCC_PLL_EnableDomain_48M(void)
{
  SET_BIT(RCC->PLLCFGR, RCC_PLLCFGR_PLLQEN);
}

If you feel a post has answered your question, please click "Accept as Solution".