2021-02-22 09:18 PM
void DMA1_Channel6_IRQHandler(void)
{
/* USER CODE BEGIN DMA1_Channel6_IRQn 0 */
/* USER CODE END DMA1_Channel6_IRQn 0 */
// HAL_DMA_IRQHandler(&hdma_usart2_rx);
/* USER CODE BEGIN DMA1_Channel6_IRQn 1 */
/*Checking the proper USART Port*/
//if (hdma->Instance == hdma_usart2_rx) {
if (!uartsParam.Rx_Flags) {
/*Push Rx1_Byte to buffer till stop byte "0x0D"*/
if (uartsParam.Rx_bytes != 0x0D) {
uartsParam.Rx_Frame_Byte_Uarts[uartsParam.rx_count_Uarts] =uartsParam.Rx_bytes;
uartsParam.rx_count_Uarts++;
HAL_DMA_IRQHandler(&hdma_usart2_rx);
HAL_UART_Receive_DMA(&huart2,&uartsParam.Rx_bytes,1);
} else if(uartsParam.Rx_bytes==0x0D){
uartsParam.Rx_Frame_Byte_Uarts[uartsParam.rx_count_Uarts] = uartsParam.Rx_bytes; /*Pushing the Stop Byte into the Buffer*/
uartsParam.Rx_Flags = 1;
}
}
/* USER CODE END DMA1_Channel6_IRQn 1 */
}
2021-02-22 11:09 PM
Which STM32?
What are the symptoms?
Read out and check/post the USART and DMA registers content.
JW