Forum Discussion
Altera_Forum
Honored Contributor
15 years agoI think now my DMA is working... But it seems like it cannot write into the memory.. my code:
--- Quote Start --- #include "io.h"# include <stdio.h># include <unistd.h># include <sys/alt_dma.h># include "altera_avalon_dma_regs.h"# include "altera_avalon_pio_regs.h"# include "alt_types.h"# include "system.h" int main() { int i; for(i=0; i<100; i++) { IOWR(PERIPHERAL_0_BASE, 0, i); } IOWR_ALTERA_AVALON_DMA_STATUS(DMA_BASE, 0x00); IOWR_ALTERA_AVALON_DMA_RADDRESS(DMA_BASE, PERIPHERAL_0_BASE); IOWR_ALTERA_AVALON_DMA_WADDRESS(DMA_BASE, EXT_SRAM_BASE); IOWR_ALTERA_AVALON_DMA_LENGTH(DMA_BASE, 200); IOWR_ALTERA_AVALON_DMA_CONTROL(DMA_BASE, 0x1102); IOWR_ALTERA_AVALON_DMA_CONTROL(DMA_BASE, 0x10A); printf("done\n"); for(i=0; i<100; i++) { printf("%d\n", IORD(EXT_SRAM_BASE, i)); } return 0; } --- Quote End --- i disable the interrupt and add in the softreset initially... update: result is: done 0 -1 -1 -1 -1 then all are -1....