User manual
STM8 C tutorial UM0036
340/385 Doc ID 7705 Rev 11
Figure 268. Select the MCU
4. Click on the name of the MCU (STM8S208MB), then click on the Select button. The
name of the MCU now appears in the Selected MCU field.
5. Edit the file mcuregs.h. As we changed to the STM8S MCU family, activate the
definition of the STM8S_FAMILY constant and change the definition of the
STM8L_FAMILY constant into a comment.
6. Changing the MCU part number may introduce differences in some peripheral register
addresses. To limit your effort, ST provides Include files for all part numbers, defining
at least register addresses. These files are available in <st_toolset>\include. To adapt
the tutorial to your microcontroller you must just modify the file to include in mcuregs.h.
RESULT:
Your project is now associated with a specific microcontroller. STVD only allows you to
connect to hardware that supports the target MCU. If you change the MCU, you must rebuild
the application for the change to be valid.
12.2.2 Customize the C compiler options
In this step we will change the options used by the C compiler, to add the path to
STMicroelectronic’s include files.
1. In the Project Settings window, C Compiler tab, select Preprocessor in the
Category list box.