cancel
Showing results for 
Search instead for 
Did you mean: 

Uart Transmits only 2 bytes of data not more with MCSDK

STuser2
Senior II

I want to enable the UART communication in MCSDK software which is very time critical task, i enabled UART with DMA, the problem is it cannot transmit more than 2 bytes even if i give 3 or more for transmission

HAL_UART_Transmit_DMA(&huart3, buffer, 3);

I get the call back 

void HAL_UART_TxCpltCallback(UART_HandleTypeDef *huart)
{
	uartransmissioncomplete = true;
}

after every 2 bytes. 

I tested the same program only with UART it works fine transferring more bytes. So, can i just go ahead with transmitting 2 bytes for every call back function, or will i really be able to transfer more bytes in the complete project, since i don't want to disturb the main functionality, i want UART data for data logging. 

3 REPLIES 3
Saket_Om
ST Employee

Hello @STuser2 


@STuser2 wrote: 

I tested the same program only with UART it works fine transferring more bytes.


You mean UART without DMA?

Please refer to the example below: 

Projects/NUCLEO-G474RE/Examples/UART/UART_TwoBoards_ComDMA

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Saket_Om

You mean UART without DMA?

It is UART with DMA. I have programmed only UART and DMA to see if it works without the integration with motor control. 

When i integrate with the main program of motor control, there are so many other high priority interrupts running i am not sure how do i code the UART so that it does not get blocked, only question is why do i get a callback without transmitting all the bytes.   

Hello @STuser2 

Could you please share your code so that we can assist you more effectively?

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.
Saket_Om