Phenomenon: After the program is burned into the board, the MCU does not start and freezes. It can only run after commenting out some byte arrays.
analyze:
This is the IAR compilation method, which causes the watchdog to overflow. The watchdog is activated as soon as the MSP430 microcontroller is powered on, but before entering the main() function, the software will initialize some data used, such as arrays. If the number is defined to be large and the initialization time is long, it may cause the watchdog to overflow, the microcontroller resets, then restarts, initializes again, overflows again, and resets again... The program will never enter the main function.
Solution:
Use the low-level initialization function: int __low_level_init(void). This function will automatically place the low-level initialization function at the very beginning of the program, where the watchdog can be turned off. After the low-level initialization function is executed, data initialization will be performed, and finally the main() function will be entered.
void main()
{
}
int __low_level_init(void)
{
WDTCTL = WDTPW+WDTHOLD; // Stop WDT
/* Insert your low-level initializations here */
/*
* Return value:
*
* 1 - Perform data segment initialization.
* 0 - Skip data segment initialization.
*/
return 1;
}
There is no need to call this function, the compiler automatically puts it at the beginning.
Of course, you can also write in all the hardware initialization functions, so that the hardware is prepared before entering the main function, avoiding other bugs.
__no_init unsigned char all_25665[] ={
//4K+ bytes
};
Previous article:MSP430 MCU Writing Info Memory
Next article:MSP430F5438A Memory Flash Read and Write Operations
- Popular Resources
- Popular amplifiers
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- Basic concepts of antenna
- How to use C2000 CLA and solutions to common CLA memory problems
- 30 principles for learning to get along with colleagues
- MSP430G2553-PC communication protocol
- India launches cow dung chip, claims it can reduce mobile phone radiation and prevent disease
- Infrared transmitter and receiver chip HT12A, HT12D, TSOP17378 data
- Resistance data of six materials
- The first article GD32VF103C START development board unboxing running lights
- How to eliminate the influence of gravity acceleration on accelerometer
- 【Development and application based on NUCLEO-F746ZG motor】14. Parameter configuration - motor parameter configuration