cancel
Showing results for 
Search instead for 
Did you mean: 

[Bug] SAI1 PLL settings CubeMX

vincenthamp9
Associate III
Posted on September 11, 2015 at 16:13

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

2 REPLIES 2
Nesrine M_O
Lead II
Posted on September 28, 2015 at 19:08

Hi Vinci,

Thank you for your feedback. The issue has been reported internally.

-Syrine-

stm32cube-t
Senior III
Posted on October 11, 2015 at 20:55

Dear user,

Please upgrade to 4.10.1. This issue has been fixed.

Thank you