cancel
Showing results for 
Search instead for 
Did you mean: 

DMA configuration for UART Rx

SS.Sagar
Associate III
Posted on June 13, 2016 at 18:57

Hi,

I m using nucleo board STM32F103 and Keil Compiler.

I have configured UART and DMA(for UART Rx) using CubeMX. 

But, While starting DMA using HAL_DMA_Start_IT function i m confused. following is the prototype of the function.

HAL_StatusTypeDef HAL_DMA_Start_IT(DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t DataLength)

SrcAddress : Here i think array where i can store the data

DstAddress : Which start address i should give? UART RX register or pointer from UART_HandleTypeDef.pRxBuffPtr structure.

#dma-uart-usart-hal #nucleo #stm32cubemx
4 REPLIES 4
AvaTar
Lead
Posted on June 13, 2016 at 19:14

For Rx, the ''source'' address would be the UART->DR (or RDR) register, and the ''destination'' the start address of you receive buffer.

For Tx, it would be the other way around.

Check the CubeMX documentation - if any. Sorry, I'm no Cube guy.

The reference manual for the F10x cores is another suggested read, the DMA resgisters are well-documented there.

slimen
Senior
Posted on June 14, 2016 at 00:43

Hi,

As mentionned in the 

http://www.st.com/content/ccc/resource/technical/document/user_manual/72/52/cc/53/05/e3/4c/98/DM00154093.pdf/files/DM00154093.pdf/jcr:content/translations/en.DM00154093.pdf

(13.2.8 HAL_DMA_Start_IT) :

SrcAddress is the source memory Buffer address

DstAddress is the destination memory Buffer address

You can have a look to

http://www.st.com/content/ccc/resource/technical/document/reference_manual/59/b9/ba/7f/11/af/43/d5/CD00171190.pdf/files/CD00171190.pdf/jcr:content/translations/en.CD00171190.pdf

 which provides information on how to use the STM32F1 and peripherals.

Also, refer to this manual 

http://www.st.com/content/ccc/resource/technical/document/user_manual/10/c5/1a/43/3a/70/43/7d/DM00104712.pdf/files/DM00104712.pdf/jcr:content/translations/en.DM00104712.pdf

to have more idea about DMA configuration in STM32CubeMx.

Regards

SS.Sagar
Associate III
Posted on June 14, 2016 at 05:58

Thanks AvaTar and forumstm32 for clearing my confusion.

SS.Sagar
Associate III
Posted on June 14, 2016 at 06:00

.