2022-03-31 10:30 AM
In CubeMX 6.5.0. I detected a missing clock specification for OctoSPI:
void PeriphCommonClock_Config(void)
{
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
/** Initializes the peripherals clock
*/
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_ADC|RCC_PERIPHCLK_SPI3
|RCC_PERIPHCLK_SPI2|RCC_PERIPHCLK_SPI1
|RCC_PERIPHCLK_UART8|RCC_PERIPHCLK_FDCAN
|RCC_PERIPHCLK_USART6|RCC_PERIPHCLK_UART7
|RCC_PERIPHCLK_UART4|RCC_PERIPHCLK_USART3
| RCC_PERIPHCLK_OSPI; // <<< is missing !!!
PeriphClkInitStruct.PLL2.PLL2M = 4;
PeriphClkInitStruct.PLL2.PLL2N = 200;
PeriphClkInitStruct.PLL2.PLL2P = 10;
PeriphClkInitStruct.PLL2.PLL2Q = 5;
PeriphClkInitStruct.PLL2.PLL2R = 4;
PeriphClkInitStruct.PLL2.PLL2RGE = RCC_PLL2VCIRANGE_1;
PeriphClkInitStruct.PLL2.PLL2VCOSEL = RCC_PLL2VCOWIDE;
PeriphClkInitStruct.PLL2.PLL2FRACN = 0;
PeriphClkInitStruct.PLL3.PLL3M = 2;
PeriphClkInitStruct.PLL3.PLL3N = 100;
PeriphClkInitStruct.PLL3.PLL3P = 2;
PeriphClkInitStruct.PLL3.PLL3Q = 2;
PeriphClkInitStruct.PLL3.PLL3R = 2;
PeriphClkInitStruct.PLL3.PLL3RGE = RCC_PLL3VCIRANGE_2;
PeriphClkInitStruct.PLL3.PLL3VCOSEL = RCC_PLL3VCOWIDE;
PeriphClkInitStruct.PLL3.PLL3FRACN = 0;
PeriphClkInitStruct.OspiClockSelection = RCC_OSPICLKSOURCE_PLL2;
PeriphClkInitStruct.Spi123ClockSelection = RCC_SPI123CLKSOURCE_PLL3;
PeriphClkInitStruct.FdcanClockSelection = RCC_FDCANCLKSOURCE_PLL2;
PeriphClkInitStruct.Usart234578ClockSelection = RCC_USART234578CLKSOURCE_PLL3;
PeriphClkInitStruct.Usart16ClockSelection = RCC_USART16910CLKSOURCE_PLL3;
PeriphClkInitStruct.AdcClockSelection = RCC_ADCCLKSOURCE_PLL2;
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
{
Error_Handler();
}
}
Please correct in next release of CubeMX.
BR GS
Solved! Go to Solution.
2022-04-01 03:34 AM
Thank you very much for your input,
From our database, I think the issue has been already spotted, and a fix expected for 6.6.0.
Anyways, I entered a ticket, and hopefully the fix will be validated against your input as well.
Again thank you.
#125631
2022-04-01 02:32 AM
Hello,
Thank you for reporting that,
Could you share an ioc file that highlights the issue ?
2022-04-01 02:50 AM
Hello Mike,
please see attached the IOC where the clock reference is missing. Clocksource is selected to PLL2R for OCTOSPI.
On the other hand:
In case I change the clocksource to PLL1Q, the clock initialisation is included in the OctoSPI initialisation and is done correctly. But it then no longer appears in the PeriphCommonClock_Config.
BR GS
2022-04-01 03:34 AM
Thank you very much for your input,
From our database, I think the issue has been already spotted, and a fix expected for 6.6.0.
Anyways, I entered a ticket, and hopefully the fix will be validated against your input as well.
Again thank you.
#125631