Forum Discussion
Altera_Forum
Honored Contributor
16 years agoDMA Transfer Issue
Hi,
I have build a system which has NIOS II, DDR SDRAM controller, On-Chip RAM, UART,DMA Controller. My program memory is DDR SDRAM. I have connected DMA controller between DDR SDRAM and On-Chip Memory. I have written a program to transfer data from SDRAM to on-chip memory, before transfering the data from DDR SDRAm i write an incremental data pattern into DDR SDRAM. the program executes but i am not seeing the pattern data into my On-Chip RAM why i don't know? is logically i am correct to DMA the data from program memory i.e. DDR SDRAM to On-chip RAM?? Thanks, Bhupesh14 Replies
- Altera_Forum
Honored Contributor
Make sure the contents written to memory before the DMA transfer are not cached. See the software handbook for the Nios II processor for more details on cache bypassing.
- Altera_Forum
Honored Contributor
Hi BadOmen,
I am using NIOS s version of CPU, i think it does not have data cache. The address range for SDRAM is 00000000h to 01FFFFFFh before SDRAM there is an clock crossing bridge it's address range is 02000000h to 03FFFFFFh. My program code size is 40Kbytes. I write a data pattern of 64 words starting at address 00100000. My on-chip RAM is at address 05000000h. After DMA when i check at 00100000h address i see the data pattern. but when i see at 05000000h i see some garbage value, before DMA value at 05000000h was 0h. Any idea why is going wrong? thanks, bhupesh - Altera_Forum
Honored Contributor
If your sdram has an adress range from 00000000h to 01FFFFFFh and your clock crossing bridge starts at 02000000h assuming only the sdram is behind that bridge, then it is correct that this bridge has an adress range from 02000000h to 03FFFFFFh as you just have to add both adress values.
your problem is that you write to 00100000 but there is no sdram, as you must take the bridge into account, you have no memory between 00000000h to 01FFFFFFh i bet it will work if you change 00100000 to 02100000 - Altera_Forum
Honored Contributor
Hi MSchmitt,
Yes my SDRAM is behind clock crossing bridge. I tried with 02100000 insted of 00100000 but no sucess. I will try to tap some signal n see... thanks - Altera_Forum
Honored Contributor
now i am a bit confused.
if your sdram is behind the bridge and that bridge is between nios and dma the nios and dma must have the same adress to gain access. so i wonder why you see your pattern at 00100000 instead of 02100000 could you post a screenshot of the sopc to see the connection between nios, dma bridge and sdram ? - Altera_Forum
Honored Contributor
- Altera_Forum
Honored Contributor
could you please attach a bigger picture, unfortunately it is very hard to read it
- Altera_Forum
Honored Contributor
- Altera_Forum
Honored Contributor
- Altera_Forum
Honored Contributor
i see no mistake in sopc.
your ddr memory must be at 02000000 and i do not see any memory at 00100000 you programm uses values from system.h DDR_SDRAM_BASE is this value 00000000 or is it 02000000 ? if you modify your application a bit case 'B': // DDR write operation DDR_write_ADDRESS = to_hex(&packet[1]); data = to_hex(&packet[9]); for(i=1;i<=32;i++) { IOWR(DDR_write_ADDRESS,0,data); iprintf("Written %08x to address %08x \n", data, DDR_write_ADDRESS); DDR_write_ADDRESS += 1; data += 1; } break; now could enter any real adress without system.h now try again 02100000