STM32W55 - UART DMA only odd byte is received
- April 30, 2024
- 1 reply
- 868 views
Hello,
I have a BLE application and I want to use UART DMA for communication between Nucleo and PC.
I have managed to get it working, however everytime only odd bytes are received. (One is received and the second one is not and again..) I'm attaching a screenshot from terminal. Here is my code, the communication is split by sending and receiving 1 byte, what I'm doing wrong? Can you please help me? Any suggestion would be appreciated! Thank you very much!
void Custom_APP_Init(void)
{
HAL_UART_Receive_DMA (&huart1, rx_message, 1);
}
void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
HAL_UART_Receive_DMA(&huart1, rx_message, 1);
if(transmit == 0)
{
HAL_UART_Transmit_DMA(&huart1, rx_message, 1);
transmit = 1;
}
}
void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
{
transmit=0;
}
