Skip to main content
Dave Nadler
Senior III
April 15, 2020
Question

BUG: CubeMX fails to initialize PLL2IS

  • April 15, 2020
  • 6 replies
  • 1007 views

STM32F437, STM32CubeIDE Version: 1.3.0

Build: 5720_20200220_1053 (UTC)

OS: Windows 10, v.10.0, x86_64 / win32

Java version: 1.8.0_202

IOC attached.

In CubeMX-generated main.c, the Q register is not set:

PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_PLLI2S;
 PeriphClkInitStruct.PLLI2S.PLLI2SN = 100;
 PeriphClkInitStruct.PLLI2S.PLLI2SR = 3;
 PeriphClkInitStruct.PLLI2S.PLLI2SQ = 2; // <<<<< DRN: Add value CubeMX forgot...

 ST - please verify you can reproduce this and a bug report filed.

@Amel NASRI (ST Employee)​, @Camilo LEMOS (ST Employee)​

PS: Please note this is a different bug than my prior bug report regarding MCO2:

https://community.st.com/s/question/0D50X0000BQQPIJSQ5/bug-cubemxgenerated-code-fails-to-properly-initialize-plli2s-mco2-etc

It looks like that was fixed, but this bug added as a new feature???

This topic has been closed for replies.

6 replies

waclawek.jan
Super User
April 16, 2020

> prior bug report regarding MCO2

Any link?

JW

Khouloud ZEMMELI
ST Employee
April 16, 2020

Hi @Dave Nadler​ ,

It will be internally checked.

Best regards,

Khouloud

Dave Nadler
Senior III
April 18, 2020

@Community member​ - Link to prior bug report added above, thanks for reminder. I also forgot to add the following...

@Khouloud ZEMMELI​ - Note that while the code carefully asserts a valid Q and then sets the internal register:

There is no Q register implemented for these parts (this divisor is fixed at 2).

The code is setting reserved/unused register bits.

Bogus code in stm32f4xx_hal_rcc_ex.c below:

/*----------------- In ANY Case of PLLI2S selected -----------------*/
 if((PeriphClkInit->PeriphClockSelection & RCC_PERIPHCLK_PLLI2S) == RCC_PERIPHCLK_PLLI2S)
 {
 /* Check for Parameters */
 assert_param(IS_RCC_PLLI2SQ_VALUE(PeriphClkInit->PLLI2S.PLLI2SQ)); // DRN: Q register DOES NOT EXIST on 437
 assert_param(IS_RCC_PLLI2SR_VALUE(PeriphClkInit->PLLI2S.PLLI2SR));
 
 /* Configure the PLLI2S multiplication and division factors */
 __HAL_RCC_PLLI2S_SAICLK_CONFIG(PeriphClkInit->PLLI2S.PLLI2SN, PeriphClkInit->PLLI2S.PLLI2SQ, PeriphClkInit->PLLI2S.PLLI2SR);
 }

waclawek.jan
Super User
April 18, 2020

Dave, thanks for the link... I knew I heard about something similar somewhere somewhen... ;)

I wonder, after so many fights with Cube/CubeMX (yes I've seen your recent post to lwip forum), why do you still use it at all?

Jan

Khouloud ZEMMELI
ST Employee
April 22, 2020

​Hi @Dave Nadler​ , Issue confirmed and fixed.

The fix will be available for the next CubeMX release.

Thanks for your feedback

Khouloud

Dave Nadler
Senior III
April 22, 2020

@Khouloud ZEMMELI​ - Can you please confirm fix is:

Do not set non-existent registers in stm32f4xx_hal_rcc_ex.c

Thanks,

Best Regards, Dave