STM 32 has a serious BUG when resetting:
1. The power-on reset and the external watchdog chip reset cannot be distinguished! RCC_FLAG_BORRST, RCC_FLAG_PINRST, RCC_FLAG_LPWRRST are all reset!
2. In this way, when the key code is initialized during power-on reset, these codes do not need to be restarted when the watchdog is reset. This key code will cause abnormal application business! If the two interrupts are inseparable, the system abnormality will affect the business when the watchdog is reset!
/*
RCC_FLAG_BORRST: POR/PDR or BOR reset //Power-on/power-down reset (POR/PDR reset) or brownout (BOR) reset
RCC_FLAG_PINRST: Pin reset //NRST pin may be watchdog reset
RCC_FLAG_PORRST: POR/PDR reset
RCC_FLAG_SFTRST: Software reset
RCC_FLAG_IWDGRST: Independent Watchdog reset
RCC_FLAG_WWDGRST: Window Watchdog reset
RCC_FLAG_LPWRRST: Low Power reset
*/
/*********************************************************************************************
Function Name: SysRstSrcRecordParameters
: NoneReturn
Value: System restart times recordDescription
: Record the system restart methodAuthor
: Li ShaoxiongVersion
: V1.0 November 12, 2012
******************************************************************************/
u8 SysRstSrcRecord(u8 *pstRest)
{
//u8 uchInfoChange=0;
pstRest[0] = RCC_GetFlagStatus(RCC_FLAG_BORRST);
pstRest[1] = RCC_GetFlagStatus(RCC_FLAG_PINRST);
pstRest[ 2] = RCC_GetFlagStatus(RCC_FLAG_PORRST);
pstRest[3] = RCC_GetFlagStatus(RCC_FLAG_SFTRST);
pstRest[4] = RCC_GetFlagStatus(RCC_FLAG_IWDGRST);
pstRest[5] = RCC_GetFlagStatus(RCC_FLAG_WWDGRST);
pstRest[6] = RCC_GetFlagStatus(RCC_FLAG_LPWRRST);
}
Previous article:STM32 reset type judgment and software reset
Next article:STM32 protects the program by reading the unique ID number of the chip to prevent plagiarism
- Popular Resources
- Popular amplifiers
- Learn ARM development(16)
- Learn ARM development(17)
- Learn ARM development(18)
- Embedded system debugging simulation tool
- A small question that has been bothering me recently has finally been solved~~
- Learn ARM development (1)
- Learn ARM development (2)
- Learn ARM development (4)
- Learn ARM development (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Detailed explanation of intelligent car body perception system
- How to solve the problem that the servo drive is not enabled
- Why does the servo drive not power on?
- What point should I connect to when the servo is turned on?
- How to turn on the internal enable of Panasonic servo drive?
- What is the rigidity setting of Panasonic servo drive?
- How to change the inertia ratio of Panasonic servo drive
- What is the inertia ratio of the servo motor?
- Is it better for the motor to have a large or small moment of inertia?
- What is the difference between low inertia and high inertia of servo motors?
- How to test ch9328?
- 【ATmega4809 Curiosity Nano Review】 Flashing Light
- Slappy.io, a web development environment for CircuitPython
- Thermal resistance measurement circuit
- Sharing a video of a senior hardware engineer simulating DDR3 SDRAM with Cadence ------- Signal integrity DDR3 timing analysis
- Prepare to make a low-cost ESP32 small board
- Chip CH551 please write a simple program
- Score points! Tell us how you have prepared for the eSports tournament so far and what you think.
- Prize live broadcast opens up IoT society Nichicon's new power storage device
- SensorTile.box_--Unicleo-GUI debugging tutorial