Why do we say the program is fine? First of all, it compiles successfully, and secondly, we have configured the registers correctly, but it still runs wrong.
Especially compared to the STM8S103F3 and other microcontrollers with only a pitiful 8K storage space, it is really painful. Okay, no more nonsense, based on my experience:
Use IAR platform, COSMIC is very bad, I advise you not to use it.
1. The debug mode optimization is set to none. If the program still crashes after compiling and running under this condition, it may be due to the Option byte setting problem. For example, if you use the PWM function of TIM2_CH1, but your Option byte is not set, the program will crash when running (this is the first time I have encountered such a weird MCU).
2. If the program is really large, you need to set the optimization to middle, so be careful. IAR's optimization has some minor issues. Although middle can be compiled, it may crash when downloaded. Be especially careful. The solution is to optimize the code and try to get a usable version with optimization set to none, and then slowly add other code, otherwise you will end up with a very ugly death!
Previous article:STM8 SPI routine communication error
Next article:STM8 chip application precautions
Recommended ReadingLatest update time:2024-11-17 01:39
- Popular Resources
- Popular amplifiers
- STM8 C language programming (1) - basic program and startup code analysis
- Description of the BLDC back-EMF sampling method based on the STM8 official library
- STM32 MCU project example: Smart watch design based on TouchGFX (8) Associating the underlying driver with the UI
- uCOS-III Kernel Implementation and Application Development Practical Guide - Based on STM32 (Wildfire)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- MSP430 Main Memory Bootloader Introduction
- ADS software simulation post summary
- Filter function judgment
- 【Beetle ESP32-C3】Download CircuitPython
- How do you measure performance when developing software using a real-time operating system?
- Free evaluation - Topmicro intelligent display module (6) PIP small keyboard
- There are tens of millions of Bluetooth platforms on the market, which one do you like best?
- MicroPython Hands-on (10) - Learn MaixPy Neural Network KPU from scratch
- Where can I download the ST sensor package (PCB library)? It's actually very simple
- How to solve the problem that VS-rk3399 motherboard adb link cannot be established?