stm32 学习--创建项目
开发环境:MDK + stc32f103C8
步骤:
1.project --> new uVision project -->stm32f103C8
2.这时会提示,是否加载startup代码,选yes 后,项目里会自动加一个 stm32f10x.s
3.new file (创建你的代码 main.c)
例如:
#include "stm32f10x_lib.h"int main(void){ while(1) { }}
4.添加 stm32f10x_lib.h 的实现代码
要把 ..\Keil\ARM\RV31\LIB\ST\STM32F10R.LIB 添加到工程
5.编译链接(这时没有*.hex文件出来)
6.project -->Option for target .....---> output-->mark the "creat hex file"
7.再编译
8.OK