cancel
Showing results for 
Search instead for 
Did you mean: 

DMA Peripheral Base Address

blue_dolphin1987
Associate II
Posted on December 05, 2013 at 07:46

Hi ,

I am new to Stm32 . While browsing through the examples i noticed something that i dont understand for DMA . In the DMA-UART example,

// In the initialzation code 
DMA_InitStructure.DMA_PeripheralBaseAddr = USARTy_DR_Base;
// In the header file
#define USARTy_DR_Base 0x40004404

From the datasheet , UART2 is at 0x4000 4400 - 0x4000 47FF. Why does the header file defines it at 0x 4000 4404 ? Thanks
2 REPLIES 2
francescatodiego
Associate II
Posted on December 05, 2013 at 12:24

The uart perhiperal target/source for DMA transfer is the UART data register (USARTy_DR)

offset 0x00000004 in uart perhiperal register area.

(See Usart register map table in device reference manual)

Config also

DMA_InitStructure.DMA_PeripheralInc      = DMA_PeripheralInc_Disable;

DMA  transfer always read from/write to same register (or address if you prefer)

Posted on December 05, 2013 at 13:02

Personally I think the following form is a bit more portable

DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)&USART1->DR;

// Register transfer goes to/from
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..