AnsweredAssumed Answered

STM32F4 GPIO Reset Values

Question asked by Mr. Blinky on Sep 21, 2015
Latest reply on Sep 22, 2015 by Clive One
I have an issue that seems to be related to some fundamental lack of understanding about GPIO behavior that I can't figure out.  The most clear symptom I have identified is this:

I'm working with an STM32F405RGT6 and have PC5 driving an enable pin on a regulator that powers some accessories (not the MCU itself).  That enable pin is pulled low with an external 10k and driven high by the MCU during normal operation.  The intent is that any time the MCU enters a standby or reset condition that the regulator gets disabled by 10k pull-down thereby powering off all of the accessories as well.

This strategy (good one?) has been working well when putting the MCU in standby.  However, when enabling the IWDG today for the first time I've noticed that an MCU reset leaves the GPIO (PC5) configured after the reset so the accessory's regulator is never power cycled as I want.  In fact, all relevant registers remain configured and don't go back to their expected "reset" values.

STM32F4 reference manual RM0090 section 8.4.1 states that the MODER reset values for port C are 0x0000 0000 (input).  Doesn't this mean that following a IWDG reset that the MCU should start up with PC5 (and all other port C pins) in input mode?  Instead I'm observing through my debugger (verified with scope) that PC5 is still configured exactly the same with execution paused immediately after reset as it is during normal operation -- driven high by the MCU and the regulator remains enabled.

Relevant registers are below:

MODER5          0x1
OTYPER5          0x0
OSPEEDR5     0x0
PUPDR5          0x0
IDR5          0x1
ODR5          0x1