Skip to main content
Terence D
Associate III
September 27, 2017
Solved

STM32CubeMX Generating Incorrect Code for Clock Configuration

  • September 27, 2017
  • 6 replies
  • 1221 views
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
This topic has been closed for replies.
Best answer by Jeanne Joly
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

6 replies

ST Technical Moderator
September 28, 2017
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

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
Terence D
Terence DAuthor
Associate III
September 28, 2017
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
ST Technical Moderator
September 28, 2017
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

In order to give better visibility on the answered topics, please click on 'Best answer' on the reply which solved your issue or answered your question. Thanks
Terence D
Terence DAuthor
Associate III
September 28, 2017
Posted on September 28, 2017 at 17:53

Thank you, Imen.

Jeanne Joly
Jeanne JolyBest answer
Associate
February 6, 2018
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

Terence D
Terence DAuthor
Associate III
February 6, 2018
Posted on February 06, 2018 at 15:20

Thank you

Joly.Jeanne

‌