cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX Generating Incorrect Code for Clock Configuration

Terence D
Senior
Posted on September 27, 2017 at 23:56

I've used the STM32CubeMX application to setup the main PLL and PLLI2S as shown below:

0690X00000608PIQAY.png

When I generate the code, it generates the following:

PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_I2S;

PeriphClkInitStruct.PLLI2S.PLLI2SN = 123;

PeriphClkInitStruct.PLLI2S.PLLI2SM = 8;   // <--- Compilation failure, PLLI2SM is not structure element

PeriphClkInitStruct.PLLI2S.PLLI2SR = 5;

PeriphClkInitStruct.I2SClockSelection = I2S_CLOCK_PLL;  

// <-- I2SClockSelection is not a struct element

if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)

{

_Error_Handler(__FILE__, __LINE__);

}

As shown in the comments in the code above, both PLLI2SM and I2SClockSelection are not members of their respective structures.  This results in a compilation failure...  Anyone know what's going on here?

#stm32f429-discovery #i2s
1 ACCEPTED SOLUTION

Accepted Solutions
Jeanne Joly
Senior III
Posted on February 06, 2018 at 15:18

Hello

tmdarwen

,

Just to be precise, this issue was solved in CubeMX4.

You can upgrade your CubeMX with the latest (cubeMX4.24).

BR. Jeanne

View solution in original post

6 REPLIES 6
Imen.D
ST Employee
Posted on September 28, 2017 at 10:41

Hello,

Please share your ioc file and precise which CubeMx version are you using ?

Best Regards

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Terence D
Senior
Posted on September 28, 2017 at 17:53

Thank you, Imen.

Posted on September 28, 2017 at 17:17

Hi Imen - I'm using STM32CubeMX Version 4.1, STM32Cibe V1.0. I've attached my ioc file.

-Terence

________________

Attachments :

I2SGeneratedTest4.ioc.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HyPB&d=%2Fa%2F0X0000000b76%2FrvsyzcO7R.kw_6C.jT2qmdixHPW0kSAsJM4j5R_jrkk&asPdf=false
Posted on September 28, 2017 at 17:45

Hi

tmdarwen

,

Thanks for sharing this issue.

I checked and confirm the error for

PLLI2SM and I2SClockSelection.

I raised thisissue internally to CubeMx team tofix it.

Thanks and Best Regards

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Jeanne Joly
Senior III
Posted on February 06, 2018 at 15:18

Hello

tmdarwen

,

Just to be precise, this issue was solved in CubeMX4.

You can upgrade your CubeMX with the latest (cubeMX4.24).

BR. Jeanne

Posted on February 06, 2018 at 15:20

Thank you

Joly.Jeanne