(If you need IAR installation package, STM8S001J firmware package and information, please contact me. I will not upload files.)
Installation of the first compilation environment
I chose IAR software, this software needs to be cracked, so it needs a registration machine to activate. The process is Baidu IAR crack installation, the first one is Baidu Knows. The steps are relatively simple and easy to understand. The only problem I encountered is that when the registration machine is activated, the type is not selected correctly, so the activation of the ActivationInfo file fails, and there is no response file.
The reason for this problem is that the default is ARM, and there is STM8 in the options later. We need to select this before it can be activated successfully.
The establishment of the second project
Project creation: 1. To create a workspace, select the menu File->New Workspace
2. To create a project, select the Project menu, select Create New Project
3. After the creation is completed, we need to change the parameters of the project. Right-click the parameter name, a menu will appear, and select the first Options...
4. Click Options… The following interface appears. The red box contains the various options we need to choose.
(1) Click the first option, general options
Select the model of the microcontroller used in the Target Device
5. The second step is to click the third C/C++ Compiler in the vertical row on the left.
We click the green arrow in the Preprocessor option of C/C++ Compiler to add the path of our header file, otherwise it will not compile. The point to note is that after clicking the blue arrow Click to add, add the directory and change it to PROJDIR PROJ_DIRPROJ
D
IR format. This is easy to make mistakes!
6. Click Output Converter on the left. I set it up like this to generate a HEX file.
7. Click Debugger on the left, select ST-LINK, and choose to use ST-LINK for debugging
8. Add project files
Use of STM8S001J MCU
1. Selection of firmware library
I chose version 2.3.1. Some versions do not support this chip and cannot find this type of chip.
2. STM8S001J can only be programmed once and cannot be programmed repeatedly, and the microcontroller is locked
Question: When I want the microcontroller to communicate with the PC through the serial port, after setting the serial port initialization and serial communication baud rate, and burning the code to the microcontroller, I can enter the DEBUG. When I single-step to the library function of the serial port initialization, it will run away. After a few seconds, the system automatically exits the DEBUG.
Solution: I thought the MCU was broken at first, but it didn't work even after I replaced it. The solution is that the default pin of the option bytes is 8-pin as UART1_TX. Once the serial port is initialized, the SWIM on 8-pin will be initialized as UART1_TX, which can't be used as a debug line during DEBUG, so an error is reported.
So we need to change the 01 of ST-LINK's option bytes to a high voltage, use pin 5 as UART1_TX, and then delay for five seconds at the beginning of the code. If the setting is not successful, you can re-burn it. If there is no delay, the 8-pin SWIM will be initialized as soon as the power is turned on, and we will not be able to burn the code, and the MCU will be locked.
Previous article:STM8 lights up the first LED
Next article:STM8L firmware burning encryption process
- 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?
- USB Type-C® and USB Power Delivery: Designed for extended power range and battery-powered systems
- RAQ #223: How to measure and determine soft-start timing without a soft-start equation?
- RAQ #223: How to measure and determine soft-start timing without a soft-start equation?
- GigaDevice's full range of automotive-grade SPI NOR Flash GD25/55 wins ISO 26262 ASIL D functional safety certification
- GigaDevice's full range of automotive-grade SPI NOR Flash GD25/55 wins ISO 26262 ASIL D functional safety certification
- New IsoVu™ Isolated Current Probes: Bringing a New Dimension to Current Measurements
- New IsoVu™ Isolated Current Probes: Bringing a New Dimension to Current Measurements
- Infineon Technologies Launches ModusToolbox™ Motor Kit to Simplify Motor Control Development
- Infineon Technologies Launches ModusToolbox™ Motor Kit to Simplify Motor Control Development
- STMicroelectronics IO-Link Actuator Board Brings Turnkey Reference Design to Industrial Monitoring and Equipment Manufacturers
- MSP430F5529 general I/O port settings
- PWM principle PWM frequency and duty cycle detailed explanation
- TI mmWave sensors for contactless private gesture detection
- Monitoring electric energy meter based on IoT --- Hardware display
- PIC Timer0
- Question about the value of pull-up resistor
- I would like to ask what specific things I need to learn to write drivers for hardware in FPGA
- Millimeter wave guided weapons and their countermeasure technology
- Analog Discovery 2 Review (3) Frequency Response Test Tool
- Four major measurement parameter instrument control system fault analysis steps