cancel
Showing results for 
Search instead for 
Did you mean: 

BUG: CubeMX fails to initialize PLL2IS

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???

6 REPLIES 6

> prior bug report regarding MCO2

Any link?

JW

Khouloud ZEMMELI
ST Employee

Hi @Dave Nadler​ ,

It will be internally checked.

Best regards,

Khouloud

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

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

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

The fix will be available for the next CubeMX release.

Thanks for your feedback

Khouloud

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

Do not set non-existent registers in stm32f4xx_hal_rcc_ex.c

Thanks,

Best Regards, Dave