cancel
Showing results for 
Search instead for 
Did you mean: 

stm32f407 -- PINRSTF is set after power cycle

dibs
Associate II
Posted on January 23, 2018 at 14:43

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?

#reset #stm32-f4
0 REPLIES 0