微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > 9G-STM32 MDK-ARM开发过程简介

9G-STM32 MDK-ARM开发过程简介

时间:11-29 来源:互联网 点击:

// STM_EVAL_COMInit(COM1, &USART_InitStructure);
/* Configure the USARTx */
USART_Init(USART1, &USART_InitStructure);
/* Enable the USARTx */
USART_Cmd(USART1, ENABLE);
}

/**
* @brief Retargets the C library printf function to the USART.
* @param None
* @retval None
*/
int fputc(int ch, FILE *f)
{
/* Place your implementation of fputc here */
/* e.g. write a character to the USART */
USART_SendData(USART1, (uint8_t) ch);

/* Loop until the end of transmission */
while(USART_GetFlagStatus(USART1, USART_FLAG_TXE) == RESET)
{}

return ch;
}

#ifdef USE_FULL_ASSERT

/**
* @brief Reports the name of the source file and the source line number
* where the assert_param error has occurred.
* @param file: pointer to the source file name
* @param line: assert_param error line source number
* @retval None
*/
void assert_failed(uint8_t* file, uint32_t line)
{
/* User can add his own implementation to report the file name and line number,
ex: printf("Wrong parameters value: file %s on line %d", file, line) */
printf("Wrong parameters value: file %s on line %d", file, line);
/* Infinite loop */
while (1)
{
}
}
#endif
/******************* (C) COPYRIGHT 2009 STMicroelectronics *****END OF FILE****/

2,main.c文件

/* Includes ------------------------------------------------------------------*/
#include "stm32f10x.h"
#include "stm32f10x_conf.h"
#include
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
extern void UART_Configuration(void);
/**
* @brief Main program.
* @param None
* @retval None
*/
int main(void)
{
/* Setup STM32 system (clock, PLL and Flash configuration) */
SystemInit();

UART_Configuration();

/* Output a message on Hyperterminal using printf function */
printf("");
printf("*** STM32-MDK V1.0 Build byyuanxihua@21cn.comon ("__DATE__ " - " __TIME__ ")");
printf("*** STM32-MDK V1.0 Rebooting ...");

/* Add your application code here
*/

/* Infinite loop */
while (1)
{
}
}
/******************* (C) COPYRIGHT 2009 STMicroelectronics *****END OF FILE****/

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top