The MCU crashes unexpectedly, resets unexpectedly, or the program runs away

Publisher:RadiantBlossomLatest update time:2020-01-02 Source: eefocusKeywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

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:

Keywords:MCU Reference address:The MCU crashes unexpectedly, resets unexpectedly, or the program runs away

Previous article:STM8 study notes---external interrupt implementation
Next article:STM8 Study Notes---Read the STM8S003 MCU serial number

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号