cancel
Showing results for 
Search instead for 
Did you mean: 

HAL_UART_Transmit_DMA issues in FreeRTOS

Jianxuan He
Associate II

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,

1 ACCEPTED SOLUTION

Accepted Solutions

It is OK now after shrunk the size of heap.

Thanks for your support!

View solution in original post

3 REPLIES 3
Sirac
Associate III

Can you put your code in code section please?​

Piranha
Chief II

It is OK now after shrunk the size of heap.

Thanks for your support!