Solved
two UART DMA with timer interrupt
Hi, all
I am trying to receive packet from uart3 and send them to uart2
but the results of my trials are:
- transmit occurs every main cpu clock
- transmit occur just once
which I thought was:
- receive packet from uart3 when packet arrived, independently
- transmit that packet once for every 65ms
My problem is "once" and "every 65ms"
void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart) {
HAL_DMA_Abort_IT(&huart2);
}
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart) {
HAL_UART_Receive_DMA(&huart3, (uint8_t*)b, 2);
}
void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) {
HAL_UART_Transmit_DMA(&huart2, (uint8_t*)b, 2);
}
HAL_UART_Receive_DMA(&huart3, (uint8_t*)b, 2);It's what I tried, "b" is uint8_t array
Thanks.
