STM32调试停在了startup文件的B.处,如下:
经排查是由于在Keil中打开了串口3的中断,并且失能了串口回调函数,自己没有写串口中断处理函数如下:
添加中断Handler之后正常
/** * @Function name USART3_IRQHandler * @Introduce BLE串口接收回调函数 * @Return NULL */ void USART3_IRQHandler(void){ HAL_UART_IRQHandler(&huart3); if(__HAL_UART_GET_FLAG(&huart3, UART_FLAG_IDLE) != RESET){ HAL_UART_DMAStop(&huart3); __HAL_UART_CLEAR_IDLEFLAG(&huart3); HAL_UART_Receive_DMA(&huart3,BlueRX_Buffer,BLUE_RXBUF_SIZE_MAX); QF_DebugPrintf("M: BLE MASSAGE:%s\r\n",BlueRX_Buffer); } }
标签:仿真,IRQHandler,HAL,UART,huart3,STM32,串口,调试 From: https://www.cnblogs.com/lesterbor/p/18002902