Forum Discussion
111 Replies
- Altera_Forum
Honored Contributor
What Quartus version do you work with? The NIOS EDS is a download at the Altera website, right next to Quartus.
From the IDE help, I guess it should be right-click on the project, then select properties, System library properties. - Altera_Forum
Honored Contributor
This is my code: I dunno why it wont work... the data cant be written into sdram.
--- 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" //#include "sys/alt_timestamp.h" int main() { int i; int a=100; unsigned int dst = SDRAM_BASE + 0x400000; IOWR_ALTERA_AVALON_DMA_STATUS(DMA_BASE, 0x00); for(i=0;i<100;i++) { IOWR(PERIPHERAL_0_BASE, 0, 30); IOWR_ALTERA_AVALON_DMA_RADDRESS(DMA_BASE, PERIPHERAL_0_BASE); IOWR_ALTERA_AVALON_DMA_WADDRESS(DMA_BASE,dst); IOWR_ALTERA_AVALON_DMA_LENGTH(DMA_BASE,100); } IOWR_ALTERA_AVALON_DMA_CONTROL(DMA_BASE,0X199); for(i=0;i<100;i++) { printf("%d\n", IORD(dst, i)); } } --- Quote End --- - Altera_Forum
Honored Contributor
I am using QII V9.0 and Nios II IDE V9.0
- Altera_Forum
Honored Contributor
Do you wait for the transfer to finish?
Also, 0x199 does not seem correct. I thought you data is 32bit wide? - Altera_Forum
Honored Contributor
Oh... yeah 32bit... how to wait for transfer to finish?
- Altera_Forum
Honored Contributor
while (IORD_ALTERA_AVALON_DMA_STATUS(DMA_BASE) & 1)==0); ?
but I'd suggest using usleep until you confirm the DMA working. - Altera_Forum
Honored Contributor
i tried but still cant... can you pls provide me a fragment of code of how it run, like i am just using FIFO as peripherals? data is 0-9
- Altera_Forum
Honored Contributor
Your SOPC connections are ok?
- Altera_Forum
Honored Contributor
- Altera_Forum
Honored Contributor
Looks ok to me.
Try reading back the DMA registers, if the correct values are really set.