修改main函数
int main(void)
{
HAL_Init();
SystemClock_Config();
MX_GPIO_Init();
MX_DMA_Init();
MX_USART1_UART_Init();
/* USER CODE BEGIN 2 */
HAL_UART_Transmit(&huart1, (uint8_t*)dat, sizeof(dat), 0xFFFF);
HAL_UART_Receive_DMA(&huart1, recv_buf, 13); //使能DMA接收
/* USER CODE END 2 */
while (1)
{
}
}
|