AnsweredAssumed Answered

stm32f407 -- PINRSTF is set after power cycle

Question asked by naphtali on Jan 23, 2018

Should the NRST external reset (PINRST) be set on an STM32F407 after a power reset?

 

 

 

I want to be able to count the number of each type of resets in my code. The problem that I have is that the NRST pin reset is always set after a power cycle. I check it and then clear the register each boot cycle, so I don't think that this should be happening. Also, if I pull the NRST pin low while the power is up (to manually generate an external reset), I only get an NRST pin reset and not a power reset (which is expected).

 

Code:

----

 

// The flag will be set if this reset has occured and never cleared
if (RCC_GetFlagStatus(RCC_FLAG_IWDGRST) == SET) m_ResetOccured[RST_IWDG] = true;
if (RCC_GetFlagStatus(RCC_FLAG_SFTRST ) == SET) m_ResetOccured[RST_SFT ] = true;
if (RCC_GetFlagStatus(RCC_FLAG_PORRST ) == SET) m_ResetOccured[RST_PWR ] = true;
if (RCC_GetFlagStatus(RCC_FLAG_PINRST ) == SET) m_ResetOccured[RST_NRST] = true;
if (RCC_GetFlagStatus(RCC_FLAG_BORRST ) == SET) m_ResetOccured[RST_BOR ] = true;

 

// Clears reset flags

RCC_ClearFlag();

 

----

 

Am I correct in assuming that the PINRST should not be set during a power cycle?

Outcomes