Question
STM32F4 GPIO Reset Values
Posted on September 21, 2015 at 18:53
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 0x1OTYPER5 0x0OSPEEDR5 0x0PUPDR5 0x0IDR5 0x1ODR5 0x1