cancel
Showing results for 
Search instead for 
Did you mean: 

Is GPIO Ports RCC->AHBENR.IOPxEN required to be set to allow AF functions to operate.

SJame
Associate

Am trying to reduce the power consumption for STM32F0xx & G0xx applications.

Reading the documentation it is not clear if I can disable a AHBENR.IOPxEN bit in the RCC block

once a port is configured and still retain any GPIO port Alternate Functionality. Tests on the bench seem to imply I can with a TIMER configured in PWM mode.

Is the GPIOx IOPxEN bit required to be set for any GPIOx configured with a AFn function, for that AFn function to operate correctly? Any restrictions.?

3 REPLIES 3

In theory, you should need the GPIO clock only to access GPIO registers, so you should be able to use them as AF after having configured them previously; but be aware of potential problems ahead.

https://community.st.com/s/question/0D50X00009XkhLwSAJ/disabling-gpio-clocks-for-af-io-fails

JW

SJame
Associate

Thanks for the update waclawek.jan; https://community.st.com/s/question/0D50X00009XkhLwSAJ/disabling-gpio-clocks-for-af-io-fails would implies that for some devices and AF functions the GPIO clock IOPxEN is required.

Can anyone from ST provide a list of AF functions that require the GPIO clock to be enabled, or is this a case of try it and see! (Not the best way forward)

Please note, that this is a primarily user-driven forum, with casual ST presence. If you need ST to answer your question, contact ST directly or through a FAE.

Also note, that that thread was abandoned before coming to a definitive conclusion. Try and see is not the worst option in this case; IMO if any peripheral you use requires GPIO clock, you'll see it immediately.

OTOH, you may start with checking whether disabling the GPIO clock brings any noticeable power consumption difference.

JW