以SW4STM32为例
1.File->New->C Project,
2.Executable->Ac6 STM32 MCU Project 填写工程名字
3.选择MCU型号或者Create a new custom board
4.next选择固件Standard Peripheral Library,并下安装Download target firmware
5.保持默认"Add low level drivers in the project" "As sources in the application project"
6,Project里面Properties->C/C++ Build->Settings->MCU GCC Compiler->Includes添加自己的头文件的编译路径
7.完成