新手上路 
 
	- 积分
 - 32
 
        - 金钱
 - 32 
 
       - 注册时间
 - 2017-8-27
 
      - 在线时间
 - 6 小时
 
 
 
 | 
 
1金钱 
 
我在使用STM32F767开发板,学习《35.UART接收-串口接收测试小实验》视频教程中遇到两个编译问题 
1...\OBJ\Template.axf: Error: L6200E: Symbol HAL_UART_RxCpltCallback multiply defined (by usart.o and main.o); 
2...\OBJ\Template.axf: Error: L6200E: Symbol USART1_IRQHandler multiply defined (by usart.o and main.o)。 
我是按照楼主的教程代码编写,他用STM32F429编译的没有问题,我使用STM32F767编译出现以上两处错误。经过仔细核对没有解决,以下是我的代码,请高手帮忙指导指导。 
 
#include "sys.h" 
#include "delay.h" 
#include "usart.h"  
u8 rdata[1]; 
UART_HandleTypeDef usart1_handler; 
void uart1_init() 
{ 
 usart1_handler.Instance = USART1; 
 usart1_handler.Init.BaudRate = 115200; 
 usart1_handler.Init.WordLength = UART_WORDLENGTH_8B; 
 usart1_handler.Init.StopBits = UART_STOPBITS_1; 
 usart1_handler.Init.HwFlowCtl = UART_HWCONTROL_NONE; 
 usart1_handler.Init.Mode = UART_MODE_TX_RX; 
 usart1_handler.Init.Parity = UART_PARITY_NONE; 
  
 HAL_UART_Init(&usart1_handler); 
} 
 
void HAL_UART_MspInit(UART_HandleTypeDef *huart) 
{ 
 GPIO_InitTypeDef GPIO_Initure; 
  
 if(huart->Instance == USART1) 
 { 
  __HAL_RCC_GPIOA_CLK_ENABLE();   //ʹÄÜGPIOAʱÖÓ 
  __HAL_RCC_USART1_CLK_ENABLE();   //ʹÄÜUSART1ʱÖÓ 
  GPIO_Initure.Pin = GPIO_PIN_9; 
  GPIO_Initure.Mode = GPIO_MODE_AF_PP; 
  GPIO_Initure.Pull = GPIO_PULLUP; 
  GPIO_Initure.Speed = GPIO_SPEED_HIGH; 
  GPIO_Initure.Alternate = GPIO_AF7_USART1; 
  HAL_GPIO_Init(GPIOA,&GPIO_Initure); 
   
  GPIO_Initure.Pin = GPIO_PIN_10; 
  HAL_GPIO_Init(GPIOA,&GPIO_Initure); 
   
  HAL_NVIC_SetPriority(USART1_IRQn,3,3); 
  HAL_NVIC_EnableIRQ(USART1_IRQn); 
 } 
} 
void USART1_IRQHandler(void) 
{ 
 HAL_UART_IRQHandler(&usart1_handler); 
 HAL_UART_Receive_IT(&usart1_handler,rdata,sizeof(rdata)); 
} 
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) 
{ 
 u8 rec; 
 if(huart->Instance == USART1) 
 {                                                                                                                                         
  rec = *( (huart->pRxBuffPtr)-1 ); 
  //rec = rdata[0]; 
  HAL_UART_Transmit(&usart1_handler,&rec,1,1000); 
 } 
} 
int main(void) 
{ 
 //u8 buff[] = "test&My name is yaojun"; 
  
 Cache_Enable();                 //´ò¿ªL1-Cache 
 HAL_Init();            //³õʼ»¯HAL¿â 
 Stm32_Clock_Init(432,25,2,9);   //ÉèÖÃʱÖÓ,216Mhz 
 delay_init(216); 
 uart1_init(); 
 HAL_UART_Receive_IT(&usart1_handler,rdata,sizeof(rdata)); 
  
 while(1) 
 { 
 // HAL_UART_Transmit(&usart1_handler,buff,sizeof(buff),1000); 
 // delay_ms(500); 
 }  
} 
 |   
 
 
 
 
 
 |