cancel
Showing results for 
Search instead for 
Did you mean: 

UART can not DMA TO SRAM2 ?

n.serina
Associate III
Posted on January 03, 2018 at 14:35

uint8_t *pSRAM = (uint8_t*)SRAM2_BASE;

HAL_UART_Receive_DMA(&huart2,

pSRAM ,25

); // uses DMA1

This code Does not put byte on SRAM2 when UART2 receives data. 

but below works 

uint8_t *pSRAM = (uint8_t*)SRAM1_BASE;

HAL_UART_Receive_DMA(&huart2,pSRAM );

When i debug the code , KEIL memory window shows bytes coming in SRAM1_BASE but not in SRAM2_BASE. 

#stm32-f4 #kit-stm32f4-discovery #dma-normal
4 REPLIES 4
Posted on January 03, 2018 at 14:44

Which mcu?

What is the value of SRAM2_BASE?

JW

Posted on January 03, 2018 at 14:48

 ,

 ,

STM32F446RE

♯ define SRAM1_BASE 0x20000000U /*!<, SRAM1(112 KB) base address in the alias region */

 ,

♯ define SRAM2_BASE 0x2001C000U /*!<, SRAM
Posted on January 03, 2018 at 15:09

Ok, the problem is keil's memory window not showing bytes coming in . ! when i verified contents of pointer its indeed having bytes what i sent over uart.  but why keil does not display SRAM2 contents ??

Posted on January 03, 2018 at 15:14

I do use DMA1 into SRAM2 on an STM32F446RE, and it works for me.

I don't use Cube, though.

Read out and post the relevant DMA registers (including status).

JW