cancel
Showing results for 
Search instead for 
Did you mean: 

Bugreport: CubeMX makes incomplete GPIO Init of ADC2,3,4 at STM32G474RE

KTies
Associate

Hi,

I am working with my students on a GaN Amplifier. The HRTIM makes the PWM, while the ADCs 1,2,3,4 are converting 2 analog signals each with their injected channels. The ADCs are triggered by an event of the HRTIM with 1MHz.

I have created the code using STM32 Cube MX Version 5.3.0. The Toolchain is MDK ARM V5.

Result:

The GPIO Pins of ADC1 are generated correctly. But in the initialization code  MX_ADC2_Init();  MX_ADC3_Init(); and MX_ADC4_Init(); of ADC 2,3,4 I am missing the initialization of the GPIO Pins.

I have added the project as a zip file (except the driver files), please have a look at Gan_Amp_V1.ioc and /src/Adc.c.

Second thing:

The microcontroller STM32G474 runs with 170 MHz but the ADC is limited to 60 MHz.

The Clock generation of the ADC must be done hand coded.

In the Cube there is a tab for the clock tree. I suggest that you should place the ADC clock deinition in this tab.

In addition there should be a warining if yout overclock the ADCs.

Thanks,

Karl-Dieter Tieste

2 REPLIES 2

Hello @KTies​ 

Could you please share your .ioc file to check with.

Best regards,

Nesrine

Singh.Harjit
Senior II

Not related to your question but something you should consider.

According to the datasheet, depending on the voltage and whether you use one or more ADCs, the max ADC clock frequency changes. Since you are running four ADCs, the max clock rate at the highest voltage is 52MHz. See Table 66 in DS12288 Rev 4.