2023-03-11 11:29 PM
Does anyone have the same issue?
Link to a similar question:
I also want the cubeMX to add "RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};"automatically command in "void SystemClock_Config(void)" function, but it isn't.
Solved! Go to Solution.
2023-03-12 12:45 AM
In src folder you have generated file stm...._hal_msp.c and in it
for example
void HAL_LTDC_MspInit(LTDC_HandleTypeDef* hltdc)
{
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
if(hltdc->Instance==LTDC)
{
/* USER CODE BEGIN LTDC_MspInit 0 */
/* USER CODE END LTDC_MspInit 0 */
/** Initializes the peripherals clock
*/
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_LTDC;
PeriphClkInitStruct.PLLSAI.PLLSAIN = 66;
PeriphClkInitStruct.PLLSAI.PLLSAIR = 2;
PeriphClkInitStruct.PLLSAIDivR = RCC_PLLSAIDIVR_2;
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
{
Error_Handler();
}
simply use Search in your project ...
2023-03-12 12:34 AM
I mean this is in msp file under peripheral init...
2023-03-12 12:40 AM
I'm sorry, but would you be able to provide more detailed information?
2023-03-12 12:45 AM
In src folder you have generated file stm...._hal_msp.c and in it
for example
void HAL_LTDC_MspInit(LTDC_HandleTypeDef* hltdc)
{
RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
if(hltdc->Instance==LTDC)
{
/* USER CODE BEGIN LTDC_MspInit 0 */
/* USER CODE END LTDC_MspInit 0 */
/** Initializes the peripherals clock
*/
PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_LTDC;
PeriphClkInitStruct.PLLSAI.PLLSAIN = 66;
PeriphClkInitStruct.PLLSAI.PLLSAIR = 2;
PeriphClkInitStruct.PLLSAIDivR = RCC_PLLSAIDIVR_2;
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
{
Error_Handler();
}
simply use Search in your project ...