new project
1.Create Project
Create a project directory
Create an empty C Source in it
Click Project | New μVision Project...
Select STMicroelectronics | STM32F1 Series | STM32F103 | STM32F103RC
in bottom left-hand PropertyList
box
Click OK
Check the following components
CMSIS | CORE
Device | Startup
- all peripherals needed in
Device | StdPeriph Drivers
Click OK
Click Project | Manage | Project Items...
Add a group into Groups
box
Select the groups and add the C Source
2. Manage Include & Define
Click Project | Options for Target '<target_name>'...
Switch to C/C++
tab
Add following string to Define
of Preprocessor Symbols
>STM32F10X_HD, USE_STDPERIPH_DRIVER
3. Configure crystal Oscillator
Switch to Target
tab of the previous window
Change the value in Xtal (MHz):
textbox to 8.0
4.upload the program
a. To use J-Link:
Switch to Debug
tab of the previous window
Select top right-hand Use:
and J-LINK / J-TRACE Cortex
in the combobox
click settings,change the port
to SW
Switch to Flash Download
check Reset and Run
press F7
and F8
b. To be able to download hex through serial port:
Switch to Output
tab of the previous window
Check Create HEX File
checkbox
project-manage-runtime environment
#.For myself ,I would like to do these extra things.
a. Add mylib
copy the mylib
directory to the workspace.
add mylib.c
to a group.
add the mylib
directory to the including path.