9G-STM32 MDK-ARM开发过程简介
三,配置STM32工程 在Keil uVision3的左面“Workspace”窗口下面的“EK-STM3210E”右击鼠标,选择“Options for Target "EK-STM3210E"”窗口; 1,在页面“Device”中选择上“STMicroelectronics”下面的STM32F103ZD”, 7,在页面“Utlites”中硬件FLASH编程工具“Cortex-M3 J-LINK”,并点开右面的“Settings”配置页面,选择SW接口并把速度改成2M; /* Private function prototypes -----------------------------------------------*/ /* Configure USART1_Tx as alternate function push-pull */ /* Configure USART1_Rx as input floating */
在页面“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”;
在“Flash Download”的编程算法选择上“STM32F10x High-density Flash”;
四,修改STM32工程
(待续)
附件:
1,serial.c 文件
/* Includes ------------------------------------------------------------------*/
#include "stm32f10x.h"
#include "stm32f10x_conf.h"
#include
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
USART_InitTypeDef USART_InitStructure;
GPIO_InitTypeDef GPIO_InitStructure;
/* Private functions ---------------------------------------------------------*/
void UART_Configuration(void)
{
/* Enable USART1 clocks */
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA | RCC_APB2Periph_USART1, ENABLE);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
GPIO_Init(GPIOA, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
GPIO_Init(GPIOA, &GPIO_InitStructure);
/* USARTx configured as follow:
- BaudRate = 115200 baud
- Word Length = 8 Bits
- One Stop Bit
- No parity
- Hardware flow control disabled (RTS and CTS signals)
- Receive and transmit enabled
*/
USART_InitStructure.USART_BaudRate = 115200;
USART_InitStructure.USART_WordLength = USART_WordLength_8b;
USART_InitStructure.USART_StopBits = USART_StopBits_1;
USART_InitStructure.USART_Parity = USART_Parity_No;
USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;
USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;
STM32MDKARM开 相关文章:
- Windows CE 进程、线程和内存管理(11-09)
- RedHatLinux新手入门教程(5)(11-12)
- uClinux介绍(11-09)
- openwebmailV1.60安装教学(11-12)
- Linux嵌入式系统开发平台选型探讨(11-09)
- Windows CE 进程、线程和内存管理(二)(11-09)