UART DMA with RTOS
Hi all,
I spent hours but I cannot make UART work in DMA circular mode with RTOS (CMSIS V2).
Can someone send me a simple example ?
I would like to receive characters from PC (various length commands: 8-10 chars) and process them in another task parallel. Then save the position and next time start processing the commands in the buffer from the previous position.What I experienced is that ReceiveBuffer contains one only character. When I put a breakpoint at HAL_UART_Receive_DMA line and send the characters, in next iteration I see the whole string received.Finally a made it work. Hw issue is always the last thing what I'm suspecting...
I guess somehow I have to wait till the streaming is finished.
I haven't noticed this in device manager:

Replacing the USB-UART converter solved the issue and uC receiving the incoming stream with DMA.
This snippet seems working:
void StartDefaultTask(void *argument)
{
HAL_UARTEx_ReceiveToIdle_DMA(&huart5, (uint8_t*)ReceiveBuffer, 256);
for(;;)
{
if(ReceiveBuffer[shift]!='\0')
{
osMessageQueuePut(MessageBufferQueueHandle, &(ReceiveBuffer[shift]), 0, 0); //saving to queue
ReceiveBuffer[shift]='\0';
shift++;
}
osDelay(50);
}
}
