2021-02-05 11:32 AM
Hi,
I met a strange issue and wish to get help.
I wish to connect PC by UART. I try to use DMA but failed.
The following is my test code for DMA.
main () {
initialization code from CubeMX
HAL_UART_Transmit_DMA(&UART_Handle_Console, (uint8_t*)(listbuffer), len);
while ( HAL_UART_GetState(&UART_Handle_Console) != HAL_UART_STATE_READY);
HAL_UART_Transmit_DMA(&UART_Handle_Console, (uint8_t*)(listbuffer), len);
while ( HAL_UART_GetState(&UART_Handle_Console) != HAL_UART_STATE_READY);
vTaskStartScheduler();
}
If comment out vTaskStartScheduler, everything is OK.
If leave vTaskStartScheduler, the first DMA statement can run but PC got nothing. The second DMA statement cannot run because HAL_UART_GetState(&UART_Handle_Console) is always busy TX.
The above is my test code . My purpose is to use binary semaphore to control UART DMA connected to PC.
Thanks,
Solved! Go to Solution.
2021-02-06 11:23 AM
2021-02-05 12:17 PM
Can you put your code in code section please?
2021-02-06 01:41 AM
2021-02-06 11:23 AM
It is OK now after shrunk the size of heap.
Thanks for your support!