Forum Discussion
Altera_Forum
Honored Contributor
15 years agoresult=alt_avalon_sgdma_do_async_transfer(sgdma_sd ram, &desc[0])
hi: in the niosII BST ,I am puzzled in the the code below : ...... result=alt_avalon_sgdma_do_async_transfer(sgdma_sdram, &desc[0]); if(!result) printf("Writing the head of the receive des...
Altera_Forum
Honored Contributor
15 years agothanks for your reply~
in short, I want to translate a frame of image by SGDMA, that is, translating 320*230=76800 bytes from FIFO(custom sopc component) to sdram. according to the manual, alt_avalon_sgdma_construct_mem_to_mem_desc() can translate 65535(length type is alt_u16),so I should use "for-loop"to translate 76800 bytes data.the code is below: for(buffer_counter=0;buffer_counter<=1;buffer_coun ter++) { alt_u32 *write_addr = (alt_u32 *) (DDR_SDRAM_BASE+0xE000*buffer_counter); alt_avalon_sgdma_construct_mem_to_mem_desc( &desc[buffer_counter], &desc[buffer_counter+1], read_addr, write_addr, 65535, 1, 0); } result=alt_avalon_sgdma_do_async_transfer(); if(!result) printf("Writing the head of the receive descriptor list to the DMA failed\n"); I use niosII debug mode test the above code,I find that "result" cannot be set to 1 or 0,I donnot know the reason,then I try to change the 65535 to 1024 ,2048..which the translation length is much less than 65530,then I can get the "result" which the value is "0". in short ,can I translate image data using SGDMA like the above way?which details I have overlook? thanks !