Previously, I developed directly with registers, but it was quite troublesome. I wrote the code directly according to the English technical manual for register development of stm8s103. Now I have switched to stm8L and have to look back at the English documentation. I personally feel that the development efficiency is still very low for a novice like me. Now I have downloaded a firmware from the community to see if I can build a project using the library. (I have previously seen the process of others building projects, but I was not successful because I was not familiar with IAR. Now I have just got it to work without any errors.)
1 First download a copy of the engineering firmware stsw-stm8016. The firmware will be sent to the resources later, or you can download it from the stm32/stm8 community.
2. Create an iar project
The project created here is as follows (I have already done it):
Note: The app file contains the BSP driver we wrote ourselves, the lib file contains the firmware, and there are three files
These three files are placed directly in the project.
Finished as follows:
xxconf.h file is used to load the firmware's .h file
xxit.h contains some declarations of interrupt functions.
3 Then create a bsp.c and .h file (this is not necessarily the case here, but it is the case here)
Then the content of bsp.h is as follows:
Remark:
4 Then load the directory where the source code .h file is located into iar:
5. Finally, main:
6 After the compilation is successful, you can then quickly copy and paste the development documentation provided in the firmware package^_^.
7 The above are some key steps for me in this construction project. I made a lot of mistakes in these areas before.
8 This is just one way I build projects here. There are many developers who have their own directory arrangements for building projects. I personally feel that the document settings are quite good and it is worth my time to study them further. . . . .
Note: Regarding the issue of locking the file library file mentioned above, you can also click the properties of the relevant file under the file directory, and then remove the option of the "read-only" attribute, and then you can modify the library file directly in IAR.
Previous article:STM8L051 buzzer beep--library function version (not using TIM2 to calibrate LSI)
Next article:Benefits of STM8--Atomthreads real-time operating system
- 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
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
- Modify system time in docker container
- TI DSP bootloader and online upgrade
- Questions about creating schematic package in Orcad
- EEWORLD University Hall----Live Replay: Dadatong helps you unlock the new generation of ADAS technology
- What are the six axes in a six-axis robot?
- Three-phase sensorless sine wave BLDC drive (MS39549 and MS39545)
- Pre-registration for the prize live broadcast | TI uses DLP micro-projection technology to design augmented reality smart glasses
- Please recommend some technical public accounts and recent thoughts
- Come here to apply for the DFRobot Xingkong board~
- Which one has a 50 ohm impedance matching circuit? Please refer to it.