Skip to main content
JJoy.1
Associate III
June 21, 2021
Question

Hi, I am using STM32H7A3 Nucleo Board. I am using HAL_UART_Transmit() to transmit UART data and HAL_UARTEx_ReceiveToIdle_DMA() for receiving data.

  • June 21, 2021
  • 3 replies
  • 1020 views

Is  the below calls are required between every transmit and receive call, if we are using DMA?

if(HAL_UART_DeInit(&UartHandle) != HAL_OK)

 {

  Error_Handler();

 }  

 if(HAL_UART_Init(&UartHandle) != HAL_OK)

 {

  Error_Handler();

 }

Please give a clarification..

This topic has been closed for replies.

3 replies

TDK
June 21, 2021

No, they are not.

"If you feel a post has answered your question, please click ""Accept as Solution""."
JJoy.1
JJoy.1Author
Associate III
June 22, 2021

Ok.

PFA code.

Do you know why i am not able to receive interrupt by using " HAL_UARTEx_ReceiveToIdle_DMA(&huart2, (uint8_t *) RxBuf, RxBuf_SIZE);"

Sometimes in RxBuf i got 'd' continuously(what i am transmittting).

Please let me know what i need to do to get RxBuf correctly.

Thanks,

Jestina

TDK
June 22, 2021
"If you feel a post has answered your question, please click ""Accept as Solution""."
JJoy.1
JJoy.1Author
Associate III
June 23, 2021

Hi

Thanks for the response.

I am connecting a Modem to my STM32H7 board.

If i comment below lines

 if(HAL_UART_Transmit(&huart2, (uint8_t *)"d" , 1,TX_TIMEOUT) != HAL_OK)

Error_Handler();

I am able to receive the log from my modem when i press the RESET key in modem.

What i am not getting is "Transmitting continuously character d from STM32 and pressing RESET, I am expecting some logs from Modem. But i am not able to receive any log. Its receiving only char d".

Normal case DMA receive is working. I made some MPU configurations as well.

What i need to know is why i am not receiving anything if i transmit continuously ...

Thanks,

Jestina