cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to use PA1 and PA1-C at the same time? CubeMX is throwing an error

EPala.2
Associate III

Hi, I am working on an STM32 project. Our current pinout uses PA1 and PA1-C for two different GPIO outputs, but when I try to do this in CubeMX I get an error:

EPala2_0-1691682168153.png

Is it impossible to use PA1 and PA1-C at the same time?

 

4 REPLIES 4
TDK
Guru

Yes, they can be both used at once, but PA1_C only has native connections to the ADC, so it will be limited to that use.

The red/pink background you see there is CubeMX telling you that those functions are not available for that pin due to the existing configuration choices (in this case, due to PA1 already being in use). Only the ones with white background (ADC1*) are available.

Just to be super clear: You can't use PA1 and PA1_C as two independent GPIO pins.

If you feel a post has answered your question, please click "Accept as Solution".
Peter BENSCH
ST Employee

TDK was a little faster, but supplementary:
PA1_C, like the other Pxn_C, is not a digital GPIO, but a direct connection to an ADC channel in order to minimise the influence of the digital block behind the GPIO (here PA1) and thus improve ADC performance. In some package variants, these Pxn_C can be connected to the corresponding digital GPIO via an analogue switch (see SYSCFG_PMCR). In this respect, as mentioned before, PA1_C cannot be used in addition to PA1 as an independent digital GPIO.

You did not mention which STM32H7 it is, but you can read about it in the respective reference manual (RM0399, RM0433, RM0455 or RM0468).

Regards
/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
TDK
Guru

Here's the figure showing the hardware architecture of the PAx_C pins and how they relate/connect to the PAx ones.

TDK_0-1691688038770.png

 

If you feel a post has answered your question, please click "Accept as Solution".

Hello EPala.2,

More details on FAQ: STM32H7 - How to read RAMECC_MxFAR failing address

Only big packages have both PA1 and PA1_C as shown on the table at the bottom of the page: TFBGA240+25, UFBGA176+25, UFBGA169.

On these packages, you can have e.g. ADC1_INP17 on PA1 and ADC1_INP1 on PA1_C with the analog switch open. In this case, ADC1_INP1 is a direct channel and ADC1_INP17 is a slow channel.

E.g. for the STM32H755xI, slow, fast and direct ADC channels identification is given at the bottom of Table 97 in the datasheet DS12919 Rev 2 with their characteristics inside the table.

Of course, on such a package, it is possible to use PA1 for another digital or analog function instead of ADC. But in this case, PA1_C can only be used as direct ADC channel with the analog switch open. That's  the reason why on your picture other functions are shown in red in STM32CubeMX. 

The same, it is possible to use PA1_C for a digital or analog function with the switch closed. But in this case, the PA1 can't be used at all. On big packages, I wouldn't recommend to do this.

Best regards