- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
First I tried the DMA code example from the sw datasheet. Than I used the single line codes. I see the DMA register working and status on 0x800020 changing. But somehow the sent data to the memory register 0x800000 does not change. Any idea? Any good code example? I did find out if you don't init the DMA the length register update can change the whole DMA registers. # include <stdio.h># include "sys/alt_dma.h"# include "system.h"# include "altera_avalon_dma_regs.h"# include "altera_avalon_dma.c" // for init function unsigned int *p = (unsigned int*)(0x400000); void *pdma = (void*) DMA_0_BASE; int main(void) { //init IOWR_ALTERA_AVALON_DMA_STATUS(DMA_0_BASE, 0); IOWR_ALTERA_AVALON_DMA_LENGTH(DMA_0_BASE, 0); //dma IOWR_ALTERA_AVALON_DMA_RADDRESS(DMA_0_BASE, (int)p); IOWR_ALTERA_AVALON_DMA_WADDRESS(DMA_0_BASE, 0x00800000); IOWR_ALTERA_AVALON_DMA_LENGTH(DMA_0_BASE, 20); // wcon 1, rcon 0, leen 1, ween 0, Reen 0, I_en 1, go 1,32 bit 100 -> ok IOWR_ALTERA_AVALON_DMA_CONTROL(DMA_0_BASE, 0x029C); printf ("Transfer successful!\n"); return( 0 ); }Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Two suggestions:
1) Clear the DMA control register before doing anything else: IOWR_ALTERA_AVALON_DMA_CONTROL(DMA_0_BASE, 0); (This ensures that the DMA init code within the HAL won't interfere with your operation). 2) Double-check that the DMA write master is connected to the slave at address 0x00800000.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Check your bus configuration in SOPC.
That caught me once. Everyting was running fine, except the data was not coming through. It turned out to be a missing bus connection.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page