cancel
Showing results for 
Search instead for 
Did you mean: 

stm32f769 cube MX software not setting DMAT and DMAR

Hello,

I am using STM32F769 microcontroller.  I have used Cube MX to configure USART1 for Tx and Rx and DMA channels 2 and 7.  I have started a data transmission using HAL_DMA_Start function but noting is happening.  Using debugger I have found that in USART1 CR3 the DMAT and DMAR are reset.  When I put a break point at the point where HAL_DMA_Start is called and manually set DMAT in CR3 the data is transmitted.  Have I missed something in the configuration of USART1 and DMA or do I need to write some code to set these bits after the MX generated initialisation code has finished?

Thanks

2 REPLIES 2
Ghofrane GSOURI
ST Employee

Hello @chris239955_stm1_stmicro_com 

First let me thank you for posting.

Based on your description, let's try to add the following line of code :

USART1->CR3 |= UART_DMA_RX_ENABLE | UART_DMA_TX_ENABLE;

Consider using  the functions 

The  HAL_UART_Receive_DMA function is used to start receiving data via DMA.

The HAL_UART_Transmit_DMA function is used to start transmitting data via DMA.

Could you please provide your IOC.

THX

Ghofrane

TDK
Guru

HAL_UART_Start_DMA should be used to initiate sending data, not HAL_DMA_Start.

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