AnsweredAssumed Answered

[Bug] SAI1 PLL settings CubeMX

Question asked by Vinci on Sep 11, 2015
Latest reply on Oct 11, 2015 by STM32Cube-T
Hello

There is a bug in the current version of CubeMX using the L4 libs. The "PLLSAI1ClockOut" (and I assume the SAI2 one) isn't set within the generated SystemClock_Config function which leads to undefined behaviour within the function calls done by the clock configuration.

Upon reaching line 1174 of  stm32l4xx_hal_rcc_ex.c a macro writes the assumed value of PLLSAI1ClockOut to the whole PLLSAI1 configuration register and overwrites all settings already written.


/edit
code snippet
PeriphClkInit.PLLSAI1.PLLSAI1N = 70;
PeriphClkInit.PLLSAI1.PLLSAI1P = RCC_PLLP_DIV17;
PeriphClkInit.PLLSAI1.PLLSAI1Q = RCC_PLLQ_DIV2;
PeriphClkInit.PLLSAI1.PLLSAI1R = RCC_PLLR_DIV8;
PeriphClkInit.PLLSAI1.PLLSAI1ClockOut = RCC_PLLSAI1_SAI1CLK;  // missing line from CubeMX
HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit);

Outcomes