stm32-hal

Cannot transmit every characters through UART

狂风中的少年 提交于 2019-11-28 12:34:41
I am using stm32f0 MCU. I would like to transmit every single byte received from the uart out of the uart. I am enabling an interrupt on every byte received from uart. My code is quite simple. uint8_t Rx_data[5]; //Interrupt callback routine void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) { if (huart->Instance == USART1) //current UART { HAL_UART_Transmit(&huart1, &Rx_data[0], 1, 100); HAL_UART_Receive_IT(&huart1, Rx_data, 1); //activate UART receive interrupt every time on receiving 1 byte } } My PC transmits ASCII 12345678 to stm32. If things work as expected, the PC should be

Cannot transmit every characters through UART

白昼怎懂夜的黑 提交于 2019-11-27 07:07:06
问题 I am using stm32f0 MCU. I would like to transmit every single byte received from the uart out of the uart. I am enabling an interrupt on every byte received from uart. My code is quite simple. uint8_t Rx_data[5]; //Interrupt callback routine void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) { if (huart->Instance == USART1) //current UART { HAL_UART_Transmit(&huart1, &Rx_data[0], 1, 100); HAL_UART_Receive_IT(&huart1, Rx_data, 1); //activate UART receive interrupt every time on receiving