cancel
Showing results for 
Search instead for 
Did you mean: 

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.

JJoy.1
Associate III

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..

4 REPLIES 4
TDK
Guru

No, they are not.

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

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
Guru

Could be many reasons. This would be my guess:

https://community.st.com/s/article/FAQ-DMA-is-not-working-on-STM32H7-devices

Consider starting with a known example that works and modify it from there:

https://github.com/STMicroelectronics/STM32CubeH7/blob/ccb11556044540590ca6e45056e6b65cdca2deb2/Projects/NUCLEO-H7A3ZI-Q/Examples/UART/UART_TwoBoards_ComDMA/Src/main.c

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

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