9G-STM32 MDK-ARM开发进程简介
一,预备MDK-ARM+JLINK+STM32软件包
1,在http://www.mcu123.com/news/Soft/embsof/arm/200908/505.html
下载RealView MDK-ARM 3.80a(MDK-ARM V3.80a,MDK3.80a)版别
mdk380a_mcu123.rar
http://esoft.mcu123.com/MCU123_temp_0080309@/arm/mdk380a_mcu123.rar
(注册机自行查找,装置进程略)
2,在http://www.segger.com/cms/jlink-software.html
下载Software and documentation pack V4.08l软件
Setup_JLinkARM_V408l.zip
http://www.segger.com/cms/admin/uploads/userfiles/file/J-Link/Setup_JLinkARM_V408l.zip
(JLINK自行购买,装置进程略)
3,在http://www.st.com/mcu/familiesdocs-110.html
下载ARM-based 32-bit MCU STM32F10xxx standard peripheral library
stm32f10x_stdperiph_lib.zip
http://www.st.com/stonline/products/support/micro/files/stm32f10x_stdperiph_lib.zip
二,树立STM32工程
1,解压stm32f10x_stdperiph_lib.zip软件包,把其间的“Libraries”和“Project”文件夹复制到“D:worksEK-STM3210E-MDK”,
在“D:worksEK-STM3210E-MDK”下树立“Drivers”、“Include”和“Source”空文件夹,在“D:workslccd-1.0.0Project”
下树立“Stm32f103”空文件夹,把“ProjectTemplate”下的C文件复制到“Source”和H文件复制到“Include”;
2,在Keil uVision3菜单中“Project”->“New uVision Project”翻开“Create New Project”窗口,挑选项目工程存储途径
“D:worksEK-STM3210E-MDKProjectStm32f103”填写项目文件名“stm32.uv2″,挑选“保存”后主动翻开“Select Device for
Target “Target 1″”窗口,在左边“CPU”页面下的“Data base”点开“STMicroelectronics”前面的“+”挑选上“STM32F103ZD”
点击“OK”再确认“是”;
3,在Keil uVision3菜单中“Project”->“New Project Workspace”翻开“Create New Multi Project Workspace”窗口,挑选项目
作业区存储途径“D:worksEK-STM3210E-MDKProjectStm32f103”填写作业区文件名“stm32.mpw”,点击“保存”翻开
“Create New Multi-Project Workspace”窗口,点击刺进项目,然后挑选到方才树立的“stm32.uv2″再点“OK”“确认”
即可树立一个新的 Workspace;
4,在Keil uVision3菜单中“Project”->“Manage”挑选“Project “stm32” Components”翻开“Components Environment and Books”窗口,
把“Target 1”改为“EK-STM3210E”把“Source Group 1”认为“BOOT”点击“OK”;并在“Groups”下树立“SRC”,“DRV”,“SRC”,
“INC”,“SDRV”等 目录;
5,在Keil uVision3的左边“Workspace”窗口下面的“BOOT”上右击鼠标,挑选“Add Files to Group “BOOT””挑选上文件
“D:worksEK-STM3210E-MDKLibrariesCMSISCoreCM3”文件夹下的“core_cm3.c”和“system_stm32f10x.c”文件,和
D:worksEK-STM3210E-MDKLibrariesCMSISCoreCM3startuparm文件夹下的“startup_stm32f10x_hd.s”后点击“CLOSE”退出;
6,在Keil uVision3的左边“Workspace”窗口下面的“SDRV”上右击鼠标,挑选“Add Files to Group “SDRV””挑选上文件
“D:worksEK-STM3210E-MDKLibrariesSTM32F10x_StdPeriph_Driversrc”文件夹下的一切C文件后点击“CLOSE”退出;
7,在Keil uVision3的左边“Workspace”窗口下面的“SRC”上右击鼠标,挑选“Add Files to Group “SRC””挑选上文件
“D:worksEK-STM3210E-MDKSource”文件夹下的“main.c”和“stm32f10x_it.c”文件后点击“CLOSE”退出;
8,在Keil uVision3的左边“Workspace”窗口下面的“DRV”上右击鼠标,挑选“Add Files to Group “DRV””挑选上文件
“D:worksEK-STM3210E-MDKSource”文件夹下的“serial.c”文件后点击“CLOSE”退出;
三,装备STM32工程
在Keil uVision3的左边“Workspace”窗口下面的“EK-STM3210E”右击鼠标,挑选“Options for Target “EK-STM3210E””窗口;
1,在页面“Device”中挑选上“STMicroelectronics”下面的STM32F103ZD”,
在页面“TarGet”中挑选上“USE microLIB”;
2,在页面“Output”中挑选上“Select Folder for Objects…”,在文件夹挑选框中指定到途径:
D:worksEK-STM3210E-MDKProjectStm32f103obj 后点击“OK”;并勾选上Create HEX File,
发生“Debug information”阅读“Browse information”;
3,在页面“Listing”中挑选上“Select Folder for Listing…”,在文件夹挑选框中指定到途径:
D:worksEK-STM3210E-MDKProjectStm32f103lst 后点击“OK”;并勾选上C Compiler Listing
和 C Preprocessor Listing (看看自己是否需求);
4,在页面“C/C++”中的“Include Paths ”,中增加:
….LibrariesSTM32F10x_StdPeriph_Driverinc
….LibrariesCMSISCoreCM3
….Include
在页面“C/C++”中的“Preprocessor Symbols”,中增加:
USE_STDPERIPH_DRIVER, USE_FULL_ASSERT, STM32F10X_HD,USE_STM3210C_EVAL
5,在页面“ASM”中的“Include Paths ”,中增加:
….LibrariesSTM32F10x_StdPeriph_Driverinc
….LibrariesCMSISCoreCM3
….Include
在页面“ASM”中的“Preprocessor Symbols”,中增加:
USE_STDPERIPH_DRIVER, USE_FULL_ASSERT, STM32F10X_HD,USE_STM3210C_EVAL6,在页面“Debug”中挑选右边的硬件仿真功用的“Cortex-M3 J-LINK”,并点开右面的“Settings”装备页面,挑选SW接口并把速度改成2M;
在“Flash Download”的编程算法挑选上“STM32F10x High-density Flash”;
7,在页面“Utlites”中硬件FLASH编程东西“Cortex-M3 J-LINK”,并点开右面的“Settings”装备页面,挑选SW接口并把速度改成2M;
在“Flash Download”的编程算法挑选上“STM32F10x High-density Flash”;
四,修正STM32工程
(待续)