Forum Discussion
Altera_Forum
Honored Contributor
15 years agoWords are swapped after DMA transfer
Hello, I'm trying to copy data from one part of the DDR2 Memory via DMA to the other parts. First I fill a part of the DDR2 memory with data (a counter). Then I copy this part to a different...
Altera_Forum
Honored Contributor
15 years agoThis gives as output:
Transfer size: 0x10
Content of TX DDR2 SDRAM after DMA operation
Address 0xC000000: 1
Address 0xC000004: 2
Address 0xC000008: 3
Address 0xC00000C: 4
Address 0xC000010: 5
Address 0xC000014: 6
Address 0xC000018: 7
Address 0xC00001C: 8
Content of RX DDR2 SDRAM after DMA operation
Address 0xD500004: 1
Address 0xD500008: 2
Address 0xD50000C: 3
Address 0xD500010: 4
Address 0xD500014: 540006
Address 0xD500018: 540007
Address 0xD50001C: 540008
Address 0xD500020: 540009
Memory compare from starting addresses 0xC000000 and 0xD500004
with 0x10 bytes gives 0x0
Transfer size: 0x10
Content of TX DDR2 SDRAM after DMA operation
Address 0xD500004: 1
Address 0xD500008: 2
Address 0xD50000C: 3
Address 0xD500010: 4
Address 0xD500014: 540006
Address 0xD500018: 540007
Address 0xD50001C: 540008
Address 0xD500020: 540009
Content of RX DDR2 SDRAM after DMA operation
Address 0xF000004: 540001
Address 0xF000008: 3
Address 0xF00000C: 2
Address 0xF000010: 540006
Address 0xF000014: 0
Address 0xF000018: 0
Address 0xF00001C: 0
Address 0xF000020: 0
Memory compare from starting addresses 0xD500004 and 0xF000004
with 0x10 bytes gives 0xFFFFFFAC
The 540006 etc. is old data that I didn't clear yet. Clearing it with the following function, makes those values 0. memset((void*)memory_base,0x00, memory_size); //Clear memory