2025-06-09 6:06 PM
Hi I am working on a project with STM32H730IBK6Q and STM32Cube IDE 1.16
I am trying to use PA0_C as a GPIO, but the GPIO function is not connecting properly.
PA0 is used an ADC, not as a GPIO, so from how I understand muxing there should be no conflict.
But when I try to use PA0_C it reads a static value, even after I confirm connectivity.
How do I properly configure my project to use PA0_C as a gpio?
From the datasheet I got this cryptic instruction:
Analog switch between ports Pxy_C and Pxy PA0_C, PA1_C, PC2_C and PC3_C can be connected internally to PA0, PA1, PC2 and PC3, respectively (refer to SYSCFG_PMCR register in RM0468 reference manual). The switch is controlled by VDDSWITCH voltage level. It is defined through BOOSTVDDSEL bit of SYSCFG_PMCR. If the switch is closed the switch characteristics are given in the table below.
But nothing about what VDDSwitch is connected to physically or how to activate the pin properly in MX.
CubeMX doesn't throw any errors when I set up PA0_C as GPIO, it just generates code that doesn't work.
Please advise, thanks! This project is in a final stage of development and the lack of documentation on this issue has put us in a tight spot.
2025-06-09 6:12 PM
Sharing screenshots of PA0_C and PA0 configuration. Note that PA0_C does not work even if I deactivate the ADC function on PA0.
2025-06-09 7:03 PM - edited 2025-06-09 7:05 PM
PA0_C cannot be used as a GPIO independently of PA0.
You cannot use PA0 as an ADC and PA0_C as a GPIO.
You can use PA0_C as an ADC pin and PA0 as a GPIO.
If you're having issues or think an IOC is generating bad code, please attach it here so someone can take a look.
2025-06-09 8:53 PM - edited 2025-06-09 8:53 PM
If PA0_C cannot be used as a GPIO while PA0 is used as an ADC why does CubeMX allow me to configure it them such without throwing a warning? The documentation of this is completely unclear, I searched both the datasheet and manual thoroughly without finding an explanation. The fact that nothing warned of this will create major costs in our development cycle that would have been completely avoidable if the documentation or development tools had made proper note of how this functioned.
2025-06-09 9:16 PM
Sometimes software has bugs. The latest STM32CubeMX version doesn't allow you to do this. You're a few versions behind.
The Reference Manual seems consistent to me in explanation, especially Figure 77. Only thing PA0_C can do on its own (i.e. without the analog switch) is ADC. When the switch is closed, the two pins are tied--they are no longer independent.
2025-06-09 9:50 PM
Which reference manual are you seeing this in? I looked in the datasheet and it made no mention of this behavior or any reference to there being a different document that would explain it.