1. We need to add those files to run a program:
First of all, we need to have a certain understanding of the library files. Among them, STM32F10xR.LIB is a packaged .C file, which includes stm32f10x_conf.c stm32f10x_adc.c stm32f10x_gpio.c, etc. To use these C functions, just include the header files stm32f10x_conf.h stm32f10x_adc.h stm32f10x_gpio.h, but the header files can also be directly included with stm32f10x_lib.h, so we only need to add the four files in SOURCE in GROUP in Keil.
The stm32f10x_vector.s is the startup file. Some versions are called startup_stm32f10x_hd.s. The name is determined by the version and chip model. In short, its function is to start the code. The stm32f10x_lib.h is included in main.c. The stm32f10x_it.c is the interrupt-related program and is not used for the time being. The above pictures are not compiled. If compiled, you will see that there will be many .H header files under the .C file.
You can also right-click on the C file to hide these .H header files.
Let's take a look at what is added to the program of the HuoNiu development board to run a pipeline program:
From here, we can see that there is a library file LIB which contains only 5 .C files to be used. You don't need to add header files in the process of adding files, because after you add the corresponding C files, the header files will be automatically included after compilation. As long as you put the header files in the correct location, now let's talk about how to add the correct location so that KEIL can find the header files. First look at the following figure
To change the location of the header file in this marquee program of Huoniu, you can change the location of the inc folder. Then you just need to find this location according to the location in the picture above, and recompile it to point to the new location.
If you want to add a new location for the header file, use the following figure
In summary, there are two points: a: First, add the startup file, the .C file written by the user, and the C file in the function library
b: Then just specify the location of the .h file so that the compiler can find them during compilation.
2. The following mainly talks about the meaning of each C file and the meaning of each header file:
a. First is stm32f10x_map.h. This file actually changed its name in the new version. Now its name is stm32f10x.h. It defines the startup settings and all register macro definitions.
b. You can ignore the addition of core_cm3.h for now. Beginners don’t need it. It is kernel-related knowledge.
c. stm32f10x_conf.h is used to include
#include "stm32f10x_adc.h"
#include "stm32f10x_bkp.h"
#include "stm32f10x_can.h"
#include "stm32f10x_crc.h"
#include "stm32f10x_dac.h"
#include "stm32f10x_dbgmcu.h"
#include "stm32f10x_dma.h"
#include "stm32f10x_exti.h"
#include "stm32f10x_flash.h"
#include "stm32f10x_gpio.h"
#include "stm32f10x_i2c.h"
#include "stm32f10x_iwdg.h"
#include "stm32f10x_pwr.h"
#include "stm32f10x_rcc.h"
#include "stm32f10x_rtc.h"
#include "stm32f10x_spi.h"
#include "stm32f10x_tim.h"
#include "stm32f10x_usart.h"
#include "stm32f10x_wwdg.h"
#include "misc.h" and other files to avoid writing too many included header files in the main function, which is not concise enough. However, in the main function main, stm32f10x.h is used to include stm32f10x_conf.h. In this way, directly including in the main function is equivalent to including so many header files above, which is equivalent to the transfer function.
d. stdint.h defines integer types such as int16_t, uint32_t, and int64_t. These can be used instead of short, unsigned long long, etc. when an integer of a certain size is needed.
e. system_stm32f10x.h, microcontroller-specific system file
I have to admit that the library files loaded by the program supporting the HuoNiu development board are really too messy. You have to read the contents of many library files yourself to understand their usage and meaning.
Previous article:stm32 firmware library file description
Next article:STM32 MCU key debounce and FPGA key debounce
- 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
- Why software-defined vehicles transform cars from tools into living spaces
- How Lucid is overtaking Tesla with smaller motors
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Vietnam's chip packaging and testing business is growing, and supply-side fragmentation is splitting the market
- Vietnam's chip packaging and testing business is growing, and supply-side fragmentation is splitting the market
- Three steps to govern hybrid multicloud environments
- Three steps to govern hybrid multicloud environments
- Microchip Accelerates Real-Time Edge AI Deployment with NVIDIA Holoscan Platform
- Microchip Accelerates Real-Time Edge AI Deployment with NVIDIA Holoscan Platform
- Regarding the number of bits of the microcontroller, the number of bits of the ADC, and the number of bits of the PWM, ADC and PWM are both indicators that reflect the resolution...
- Please teach me an op amp circuit - RMS to DC circuit
- 【Silicon Labs Development Kit Review】+ PWM Example Test
- Porter-3: Will this topology work?
- Problem with the abs function
- Xunwei i.MX6ULL development board-Transplant OpenCv2.4.9-QT program compilation
- Microcontroller selection
- Made a tool to use serial port IAP to realize batch online upgrade program
- Things that electronic hardware engineers need to know
- EEWORLD University ---- Automotive/Industrial Millimeter Wave Radar Sensors