The MCU crashes unexpectedly, resets unexpectedly, or the program runs away. There are several reasons for this.
1. Array out of bounds.
Especially when using pointer operations, if there is an out-of-bounds situation, the consequences will be serious.
2. The power supply is unstable.
You can use an oscilloscope to monitor and check
3. Stack Overflow
Stack is a small space allocated in memory to temporarily store required data during program execution. The types of data stored generally include the following:
1. Local variables and parameters declared in the function
2. Function return value
3. CPU register value at interruption
4. The address returned after the function is executed
Therefore, in the compiler settings, be sure to reserve enough stack space.
Setting method in IAR:
Previous article:STM8 study notes---external interrupt implementation
Next article:STM8 Study Notes---Read the STM8S003 MCU serial number
- 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
- ASML predicts that its revenue in 2030 will exceed 457 billion yuan! Gross profit margin 56-60%
- 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?
- LORA SX1308
- Newbie question: When using the PCB antenna library, one of the antenna pins is not connected. I want to know how to solve it.
- Why is this power circuit connected like this?
- 【National Technology N32G430】03 Development foundation, the platform is emerging
- Four major Bluetooth antenna design methods
- Please recommend a microcontroller with 5V IO port output
- PowerBox
- I2C bus controls RDA5807M to achieve high-fidelity reception of FM signals
- Piezoelectric ceramic polarity detection system ET10
- I would like to ask you how to use timequest to analyze the delay time of the delay chain in FPGA.