Skip to main content
LNash.1
Associate
March 30, 2022
Solved

Can anyone explain how to enable the ADC Clock Source on an STM32H753ZI using STM32 Cube?

  • March 30, 2022
  • 6 replies
  • 10132 views

I'm new to Cube IDE and Cube MX but I've been trying to create a simple project based on an STM32H753ZI to investigate ADC capture.

Having enabled a few channels on ADC3 I looked in the clock tree to find the ADC clock speed but it's greyed out. When I hover over the ADC Clock Mux section I get a message saying "ADC Clock Source is not available" and to configure one in the Pinout Tab ADC.

I can't see any options that mention anything to do with a clock in the ADC section (or , I've seen screenshots from the STM32H743 where there is a "Clock Prescaler" option under ADC_Settings, but I don't see this option in my case. I've seen that sometimes options only become visible when other options have first been set, so hopefully this is something simple that I've overlooked.

Any help would be welcomed.

This topic has been closed for replies.
Best answer by mƎALLEm

Hello,

It's a known bug in CubeMx. It will be fixed in coming versions of the tool.

Internal ticket number: 124251

So try to use older version of CubeMx.

6 replies

mƎALLEm
mƎALLEmBest answer
ST Technical Moderator
March 30, 2022

Hello,

It's a known bug in CubeMx. It will be fixed in coming versions of the tool.

Internal ticket number: 124251

So try to use older version of CubeMx.

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
LNash.1
LNash.1Author
Associate
March 31, 2022

I didn't realise the CubeMX version was tied to the CubeIDE version (I was under the impression that you installed CubeMX separately). I've tried downloading en.st-stm32cubeide_1.8.0_11526_20211126_0815_x86_64.exe_v1.8.0.zip multiple times from the ST website but the file seems to be broken (7zip reports an error and Windows won't open the zip file either). Please can you ask someone to check this file please?

mƎALLEm
ST Technical Moderator
March 31, 2022

Hello,

You can download CubeMx separetly from this link and generate code for CubeIDE. Go to "Select version" menu to download an older version:

0693W00000LwRBkQAN.pngYou can open a new thread for the latest issue you reported.

Thank you for your understanding.

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
SChen.10
Visitor II
April 11, 2022

I have been fighting against the same problem for the last few weeks. At one point in time, the ADC clock was miraculously turned on in CubeMX. Instead of fighting another battle against CubeIDE/CubeMX installation, I saved the working version of the stm32h7xx_hal_msp.c and reused it over the new one created by CubeMX.

Attached are the diff screenshot and function code.

0693W00000Lxd8GQAR.png

void HAL_ADC_MspInit(ADC_HandleTypeDef* hadc)
{
 GPIO_InitTypeDef GPIO_InitStruct = {0};
 RCC_PeriphCLKInitTypeDef PeriphClkInitStruct = {0};
 if(hadc->Instance==ADC3)
 {
 /* USER CODE BEGIN ADC3_MspInit 0 */
 
 /* USER CODE END ADC3_MspInit 0 */
 
 /** Initializes the peripherals clock
 */
 PeriphClkInitStruct.PeriphClockSelection = RCC_PERIPHCLK_ADC;
 PeriphClkInitStruct.PLL2.PLL2M = 4;
 PeriphClkInitStruct.PLL2.PLL2N = 9;
 PeriphClkInitStruct.PLL2.PLL2P = 4;
 PeriphClkInitStruct.PLL2.PLL2Q = 2;
 PeriphClkInitStruct.PLL2.PLL2R = 2;
 PeriphClkInitStruct.PLL2.PLL2RGE = RCC_PLL2VCIRANGE_3;
 PeriphClkInitStruct.PLL2.PLL2VCOSEL = RCC_PLL2VCOMEDIUM;
 PeriphClkInitStruct.PLL2.PLL2FRACN = 3072;
 PeriphClkInitStruct.AdcClockSelection = RCC_ADCCLKSOURCE_PLL2;
 if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInitStruct) != HAL_OK)
 {
 Error_Handler();
 }
 
 /* Peripheral clock enable */
 __HAL_RCC_ADC3_CLK_ENABLE();
 
 __HAL_RCC_GPIOF_CLK_ENABLE();
 /**ADC3 GPIO Configuration
 PF10 ------> ADC3_INP6
 */
 GPIO_InitStruct.Pin = GPIO_PIN_10;
 GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
 GPIO_InitStruct.Pull = GPIO_NOPULL;
 HAL_GPIO_Init(GPIOF, &GPIO_InitStruct);
 
 /* ADC3 interrupt Init */
 HAL_NVIC_SetPriority(ADC3_IRQn, 5, 0);
 HAL_NVIC_EnableIRQ(ADC3_IRQn);
 /* USER CODE BEGIN ADC3_MspInit 1 */
 
 /* USER CODE END ADC3_MspInit 1 */
 }
 
}

LNash.1
LNash.1Author
Associate
April 12, 2022

Thank you for your help, I'm sure this will help others who find this post.

Following the advice of SofLit I'd downloaded V1.8 of the CubeIDE; the download now appears to now have been fixed.

en.st-stm32cubeide_1.8.0_11526_20211126_0815_x86_64.exe_v1.8.0.zip

MD5: 24db76ddbd4052e55b5f7537223d543d

SHA256: d5e520960b3d5ecef0f13609ac90ab82e93db13bd30b99f692458e28ca25d5d9

SChen.10
Visitor II
April 12, 2022

Thanks for the information. I downloaded the earlier version of CubeIDE and CubeMX but they don't allow me to open the files created by a new version. I have too much invested in the current project so I guess I am stuck with my method until the newer version fixes the problem.

I wish there were errata sheets of the software tools (maybe there are I didn't know) so I wouldn't spend so much time fighting the tools.

Pavel A.
April 12, 2022

>  but they don't allow me to open the files created by a new version.

Edit the .ioc file and change the Cube version to what matches your older CubeMX.

(of course, keep a backup).

Chances are it will open.

Hansel
Senior
June 7, 2022

It's been two months and a new version of cubeMX still hasn't been pushed. When is this expected to be fixed and made available to the community?

willcfj
Associate III
June 14, 2022

Thanks for this post! After several hours of analyzing got enough for a decent Google search and presto, this thread! Kind of OK if every once in a while the problem isn't my coding! Alas too late to revert to an older CubeMX, so will go work on other parts of the project until the fix comes out. Hopefully soon though, it has been a while.

will

SChen.10
Visitor II
August 17, 2022

Just updated STM32CubeMX from Version 6.5.0 to 6.6.1.

After migrating the project to the newer version, I agreed to run the automatic clock issues solver and the ADC clock is properly configured now.