The explanation is added because the previous article is incomplete, but there are some reference values. Two articles combine to solve more problems.
1 open IAR software such as
2 in the menu bar, click Project----creat New project pops up a dialog box to select Stm8s Series and Empty project Click OK
3 Enter the Save settings for the project file, under the path of the project you want to save under the current project name folder, and then under the Project name folder, new app, BSP, CFG, libraries, and project total 5 files
App for storing apps
BSP Storage Board-level support package
CFG Storage Project configuration file
Libraries: Open source or official library files used in the project.
Project storage project, project compile connection output file.
The project is named after it is saved under the project file.
4 completed the construction of the new project, and then the official library of the transplant, first copy the official standard peripheral library path under the Libraries folder under the Stm8s_stdperiph_driver file to the project file name folder under the libraries file
Then copy the official standard peripheral library path under the project folder under the Stm8s_stdperiph_template folder under the Man.c stm8s_conf.h stm8s_it.c stm8s_it.h A total of 4 files to the app
6 Right-click the project name in the IAR to select the Add---Add Group option once added the app BSP CFG Libraries Four groups then add the Stmis_stdperiph_driver group under the Libraries group
After completing the group Add, start adding files, right-click the app group, select Add Add group, add files to the app groups main.c stm8s_conf.h stms_it.c stm8s_it.h four files
Also add all the files under the SRC folder under the Libraries library file to the libraries in the project
7 Start configuring IAR below
Right-click on the project selection Options Pop-up dialog box to select the corresponding chip
Then, by selecting the preprocessor project, in the additional Include Directories section, enter the path to the header package as follows in the C + + Compiler option.
$PROJ _dir\.
$PROJ _dir\. \libraries\stm8s_stdperiph_driver\inc
$PROJ _dir\. \app
$PROJ _dir\. \bsp
$PROJ _dir\. \cfg
and enter stm8s105 in the edit box of the defined symbols column. Tells the compiler to use the library.
Finally, in the Output converter option, select generate additional output in the format of Intel extended.
Start compiling the project below
The first compile time will prompt to save the project path we saved in the project folder
If an error occurs when compiling the entire project
Because the official library we use contains all of the peripherals, but the microcontroller we use contains only a subset of them, we need to not include that part in compiling.
Expand the Libraries group under the Stm8s_stdperiph_driver, see the red asterisk is the current MCU does not have peripherals, you can block them in turn do not participate in the compilation.
Select file with asterisk right-click----option
Hook it up.
If the package follows an error
Fatal error[pe035]: #error directive: "Please select first the target stm8l device used in your application
Double-click the hint, do not define a single-chip model, in fact, the library file has been defined so that we need to remove the comments
The addition of a new project in IAR