你这样写试试,不用单独去清FLAG,读了之后自动清除的uint8_t Usart2_RecvByte(void){ while (USART_GetFlagStatus(USART2, USART_FLAG_RXNE) == RESET) {} LED0=!LED0; return USART_ReceiveData(USART2);}