Altera_Forum
Honored Contributor
12 years agomSGDMA: write_extended_descriptor() hangs
Hi all,
I was wondering if anyone has had the following problem. Using the information provided by the mSGDMA wiki (http://www.alterawiki.com/wiki/modular_sgdma and http://www.alterawiki.com/wiki/modular_sgdma_video_frame_buffer), I put together a st-to-mm system very similar to the mSGDMA video frame buffer example. My stream is being provided by a test pattern generator. When I step through my NIOS code, when I reach the "write_extended_descriptor()" command, my code stops and the debugger indicates that it is still stepping. So I don't get a 0 or error code from write_extended_descriptor. It would seem that my code is hanging somewhere in "write_extended_descriptor()"...but that is weird no? control_bits = DESCRIPTOR_CONTROL_TRANSFER_COMPLETE_IRQ_MASK ; // set the SOP and EOP bits for packet support (note that the GO BIT gets set within the constructor control_bits |= DESCRIPTOR_CONTROL_GENERATE_SOP_MASK | DESCRIPTOR_CONTROL_GENERATE_EOP_MASK | DESCRIPTOR_CONTROL_END_ON_EOP_MASK; // Construct the SGDMA descriptor //DMA_CTRL_CH1_DESCRIPTOR_SLAVE_BASE //DMA_CTRL_CH1_CSR_BASE construct_extended_st_to_mm_descriptor(mSGDMA_DESC_ptr_Ch1, (alt_u32 *)dest_address, frameSize, control_bits, 0, 0, 0); Here is a snippet of my code...basically everything prior to the write_extended_descriptor() executes... printf("Descriptor constructed\n"); while (read_descriptor_buffer_full(DMA_CTRL_CH1_CSR_BASE) != 0) {} // spin until there is room to commit another frame printf("Descriptor buffer ready\n"); // do some error checking to determine if the descriptor was written properly if(write_extended_descriptor (DMA_CTRL_CH1_CSR_BASE, DMA_CTRL_CH1_DESCRIPTOR_SLAVE_BASE, mSGDMA_DESC_ptr_Ch1) != 0) { printf("Failed to write descriptor to the st_to_mm_descriptor SGDMA port.\n"); return 1; } I should mention, I had to wrap the "sgdma_dispatcher.h" header file as follows to have my code compile in C++:# ifdef __cplusplus extern "C" {# endif /* __cplusplus */# include "sgdma_dispatcher.h"# ifdef __cplusplus }# endif Thanks in advance for any help.